How do you implement a Makefile that remembers the last build target?
问题 Let's say you have a Makefile with two pseudo-targets, 'all' and 'debug'. The 'debug' target is meant to build the same project as 'all', except with some different compile switches (like -ggdb, for example). Since the targets use different compile switches, you obviously need to rebuild the entire project if you switch between the two. But GNUmake doesn't naturally recognize this. So if you type make all you'll get Building ... ... Then if you type make debug , you get make: Nothing to be