make: Nothing to be done for `all'

前端 未结 7 1832
北荒
北荒 2020-11-29 21:14

I am going through an eg pgm to create a make file.

http://mrbook.org/tutorials/make/

My folder eg_make_creation contains the following files,



        
7条回答
  •  青春惊慌失措
    2020-11-29 22:11

    Make is behaving correctly. hello already exists and is not older than the .c files, and therefore there is no more work to be done. There are four scenarios in which make will need to (re)build:

    • If you modify one of your .c files, then it will be newer than hello, and then it will have to rebuild when you run make.
    • If you delete hello, then it will obviously have to rebuild it
    • You can force make to rebuild everything with the -B option. make -B all
    • make clean all will delete hello and require a rebuild. (I suggest you look at @Mat's comment about rm -f *.o hello

提交回复
热议问题