Home Download Buy Blog Forum Support

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

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

Postby BumontheRun on Thu Sep 01, 2011 1:44 am

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

Code: Select all
{
   "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:

Code: Select all
{
   "cmd": ["gcc", "$file", "-o", "$file_base_name"],
   "cmd": "./$file_base_name"
}


Thanks for the help.
BumontheRun
 
Posts: 1
Joined: Wed Aug 31, 2011 11:01 pm

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

Postby jbrooksuk on Thu Sep 01, 2011 10:06 am

You have to run the "gcc" command with a batch file, which in turn executes the output after creation.
jbrooksuk
 
Posts: 754
Joined: Sun Apr 11, 2010 10:37 am
Location: England


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 23 guests