I cannot figure out why make is giving me this. I run “make clean; make” then “make install” and I get a “make: Nothing to be done for `install’.” message. Here is my install target:
$(phony install): $(OBJFILES)
@$(shell cp $(OBJFILES) ../../)
I changed it from using a “.PHONY: install” to “$(phony install)” because I saw someone online who said that was also a way to do phony targets, and I was stumped. To be honest, I’m rather new to writing my own Makefiles, but it seems simple enough. I’m sure I’m missing something obvious and I will feel dumb here in a second. 😛
Okay, weird thing. It seems that make is executing the install target, but is still saying “nothing to be done” this is weird. Also, if I do “make clean; make install” it installs just fine and doesn’t give me any messages like that. So, it is only when the object files need rebuilt that “install” is seeing that it needs to be run. That doesn’t make sense. I should be able to run “make; make install”!
You don’t need to use
$(shell ...)inside a recipe, instead write command as it is. Also, I’ve never heard about$(phony ...), and I guess that it is not valid (try to run Make with--warn-undefined-variablesoption).