The main assembly file for C might look like this:
{ "cmd" : ["/path/to/gcc", "$file_name", "-o", "${file_base_name}", "-lgsl", "-lgslcblas", "-lm" , "-Wall"], "selector" : "source.c", "shell":false, "working_dir" : "$file_path", "variants": [ { "name": "Run", "cmd": ["bash", "-c", "/path/to/gcc '${file}' -Wall -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"] } ] }
To simply compile, press command + b .
To compile, press command + shift + b
The only thing you need to do is point the path to your gcc and enable the libraries you use (I left some GSL stuff for this example). $_variables are sublime assembly system variables and should not be changed. For more information about these variables, see here .
Here you can put the real assembly file:
~/Library/Application Support/Sublime Text 2/Packages/User/C.sublime-build
source share