I am facing an error while running my c program using makefile. When I run the following command directly on the terminal,the program runs correctly
$ ./a.out test1.c test2.c
(a.out is the executable generated by compiling the program,test1.c and test2.c are the command line arguments)
But when I write the below in makefile:
all : compile run
compile :
gcc ConsonantVowelCount15.c
run :
./a.out $(INPUT)
and run the following command on terminal
$ make INPUT=test1.c\ test2.c
It gives the output followed by following error
makefile:6: recipe for target 'run' failed
make: *** [run] Error 45
run : compileinstead ofrun :compiletoa.outand userun: a.outto have a makefile that actually means something useful. The useall: run. You can also addcompile: a.outif you still want to be able to typemake compile. That being said all that may have nothing to do with the problem since you haven't actually told us what the problem is. The actual error is above the snippet of error you pasted.