Question: Write a Makefile such that the command $ make compiles the program hello.cpp and produces an executable named hello . The Makefile should include a
Write a Makefile such that the command $ make compiles the program hello.cpp and produces an executable named hello .
The Makefile should include a target named clean so that the command $ make clean removes the executable file hello .
I was thinking that because there is only one file that gets compiled by a make file, it doesn't need the who line that lists it's dependencies? So it would besometing like
g++ -o hello hello.c clean: rm *.o hello
Would this be the right train of thought?
Thanks in advance
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
