Follow-up Comment #5, bug #102 (project make): Re: Comment #3: > All is well. So why the error?
Yes, this is exactly the bug. The problem is that make generates the error before it realizes that it could rebuild the target. I've tried on a couple of occassions to fix this by delaying the error message until make is sure there's no way to rebuild the target, but the behavior of make in these areas is complex enough that it's not so simple and my attempts failed. Re: Comment #4: > a bona fide bug in include resolution. No, it's not a bug. This is expected behavior. The way GNU make works is it first reads ALL the makefiles, THEN it tries to rebuild ALL the makefiles that don't exist or are not up to date, THEN it re-execs. It does not rebuild one makefile, re-exec, rebuild the next makefile, re-exec, etc. which is the behavior it would need to have in order for your environment to work properly. If you want that behavior you can get it: one way is to move the include $(SOMEDIR)/Defs.mk line into Master.mk itself; that way it won't be visible until after Master.mk is built. If you don't want to do that due to ordering or other issues, you can include a trigger in Master.mk that enables the rest of the includes; for example your top-level makefile could be: include Master.mk ifdef SOMEDIR include $(SOMEDIR)/Defs.mk endif ifdef SOME_OTHER_DIR include $(SOME_OTHER_DIR)/Rules.mk endif _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?102> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make