I want to specify some command line parameters in a makefile. I normally run my program like
this:
gcc -o prog prog2.c prog.c
./prog text1.txt text2.txt
Makefile:
prog: prog2.o prog.o
gcc -o prog prog2.o prog.o
prog2.o: prog2.c prog2.h
gcc -c prog2.c
clean :
rm prog2.o
How do I include the txt files here?
Also how do I give executions in a single make file. Say if I also want to run
gcc -o prog prog3.c prog.c
./prog text1.txt text2.txt
Make a
runtarget:Then you can say
make run, or justmakeifrunis the first target in theMakefile.