make: Nothing to be done for `all'

前端 未结 7 1833
北荒
北荒 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:10

    I arrived at this peculiar, hard-to-debug error through a different route. My trouble ended up being that I was using a pattern rule in a build step when the target and the dependency were located in distinct directories. Something like this:

    foo/apple.o: bar/apple.c $(FOODEPS)
    
    %.o: %.c
        $(CC) $< -o $@
    

    I had several dependencies set up this way, and was trying to use one pattern recipe for them all. Clearly, a single substitution for "%" isn't going to work here. I made explicit rules for each dependency, and I found myself back among the puppies and unicorns!

    foo/apple.o: bar/apple.c $(FOODEPS)
        $(CC) $< -o $@
    

    Hope this helps someone!

提交回复
热议问题