Execution of a makefile in C
I have a TP of C to go to college, I made my little makefile and everything but I do not know how to run an automatic execution just after the compilation, from the makefile (not found on the web).
In fact what I'd like is that when the teacher looks at the tp that I sent him, that he did do "make" to compile, and one or two executions of the program will launch by their own.
What should I put in the makefile?
Re: Execution of a makefile in C
The best solution would probably make a batch file that would run the makefile in the program first and then the program.
Re: Execution of a makefile in C
The trick is that the teacher asked us to put everything in the makefile (well if I remember correctly ...). But what a batch file?
Re: Execution of a makefile in C
Here is a link detailing how to create a Makefile:
http://www.hsrl.rutgers.edu/ug/make_help.html
Once the Makefile created, you simply type make
Than you create an executable that you will use by doing:. / Nom_executable (nom_executable is the name you will assign)
Re: Execution of a makefile in C
Thank you, but I know this site and I know how to create a makefile to compile with. I may be wrong the way I asked my question. What I want: my makefile compile and run the program.
So when the teacher corrects my tp, he will "make", compile and execute the program automatically.
ie no need to do. /executable
I know this is possible because the teacher shows us examples of ongoing and it is said and c is what we demand for the tp, but I do not know how to get this result.