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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!