Say you have a Makefile with two pseudo targets, “all” and “debugging”. The purpose of "debug" is to create the same project as "everything", except for some different compilation switches (for example, -ggdb). Since the targets use different compilation keys, you obviously need to rebuild the entire project if you switch between them. But GNUmake naturally does not recognize this.
So, if you type make all , you will get
Building ... ...
Then, if you type make debug , you will get
make: Nothing to be done for `debug'.
So my question is: how do you implement a clean solution in the Makefile to notice that the last build used different pseudo-target or different compilation keys than the one you currently want? If they are different, the Makefile will restore everything.
makefile gnu-make target
Elliot cameron
source share