[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Avoid generation of include files when doing "make clean"

From: Warlich, Christof
Subject: RE: Avoid generation of include files when doing "make clean"
Date: Wed, 4 Apr 2012 13:13:27 +0200

Hi Stephen,

thanks, that's just what I need :-).



-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Stephan Beal
Sent: Mittwoch, 4. April 2012 12:31
To: address@hidden
Subject: Re: Avoid generation of include files when doing "make clean"

On Wed, Apr 4, 2012 at 12:20 PM, Warlich, Christof <
address@hidden> 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
    toc2.flags.making_clean = 0

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
$(c-bins.DEPSFILE): $(toc2.files.makefile) $(c-bins.RULES_GENERATOR)
        @echo "Generating c-bins rules: $(c-bins.list)"; \
        $(call,c-bins,$(c-bins.list)) > $@
# 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)

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
Help-make mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]