Sublime Forum

Created a C Build System. How do I execute after compiling?

#1

I created a simple build system to compile C programs(on mac):

{ "cmd": "gcc", "$file", "-o", "$file_base_name"] }

Now I’m trying to get it to execute after compiling so I can see the output in the build window. I have tried adding another cmd to execute it however it just tries to run the second command then and doesn’t compile first. If the program is already compiled it will just run the already compiled program.

Is there a way to make it run the file after it is done compiling?

This is what I tried:

{ "cmd": "gcc", "$file", "-o", "$file_base_name"], "cmd": "./$file_base_name" }

Thanks for the help.

0 Likes

#2

You have to run the “gcc” command with a batch file, which in turn executes the output after creation.

0 Likes