Skip to content

Instantly share code, notes, and snippets.

@Tomaszal
Last active November 2, 2017 17:08
Show Gist options
  • Save Tomaszal/556f030dfdceb035ca40e084975090a3 to your computer and use it in GitHub Desktop.
Save Tomaszal/556f030dfdceb035ca40e084975090a3 to your computer and use it in GitHub Desktop.
My C Sublime build system config. Prints results in Sublime's shell. Has an option to capture standard streams (pipes contents of file "in" to stdin & pipes stdout to file "out").
{
"selector": "source.c",
"file_patterns": ["*.c"],
"working_dir": "$file_path",
"shell": true,
"linux":
{
"shell_cmd": "gcc $file_name -o ${file_base_name}.bin && echo | ./${file_base_name}.bin && echo \n"
},
"windows":
{
"shell_cmd": "gcc $file_name -o ${file_base_name}.exe && echo | ${file_base_name}.exe && echo.",
"env":
{
"PATH": "C:/MinGW/bin"
}
},
"variants":
[
{
"name": "Capture standard streams (stdin & stdout)",
"linux":
{
"shell_cmd": "gcc $file_name -o ${file_base_name}.bin && cat in | ./${file_base_name}.bin > out && cat out && echo \n"
},
"windows":
{
"shell_cmd": "gcc $file_name -o ${file_base_name}.exe && type in | ${file_base_name}.exe > out && type out && echo.",
"env":
{
"PATH": "C:/MinGW/bin"
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment