Hi Stephen, thanks, that's just what I need :-).
Cheers, Chris -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Stephan Beal Sent: Mittwoch, 4. April 2012 12:31 To: [email protected] Subject: Re: Avoid generation of include files when doing "make clean" On Wed, Apr 4, 2012 at 12:20 PM, Warlich, Christof < [email protected]> wrote: > It works fine when I call 'make' and then 'make clean'. But when I call > 'make clean' a second time, it generated the include file first, before > deleting it right afterwards. Does anyone have an idea how this can be > avoided? > Hi, Chris, Here's how one of my projects does it: ifneq (,$(strip $(filter distclean clean,$(MAKECMDGOALS)))) toc2.flags.making_clean = 1 else toc2.flags.making_clean = 0 endif and then change the rules for the bins/dlls/etc to act appropriately during the cleanup: ifeq (1,$(toc2.flags.making_clean)) $(c-bins.DEPSFILE): ; @true else $(c-bins.DEPSFILE): $(toc2.files.makefile) $(c-bins.RULES_GENERATOR) $(c-bins.makefile) @echo "Generating c-bins rules: $(c-bins.list)"; \ $(call toc2.call.generate-rules,c-bins,$(c-bins.list)) > $@ endif # REMINDER: we MUST include the file, even if doing clean, so that the # bins cleanup rules actually get performed. -include $(c-bins.DEPSFILE) deps: $(c-bins.DEPSFILE) bins: however, note the "REMINDER" comment - in my particular case i have to -include even during cleanup because my BINS rules are auto-generated and include the cleanup code for the BINS. i remember changing the cleanup rules (as opposed to the other rules) to react to the is-making-clean flag at one point, but i cannot find that example now (i might have gotten rid of it because of the above-described auto-generation bit). -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal _______________________________________________ Help-make mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-make _______________________________________________ Help-make mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-make
