Message ID | 1347755441-6499-1-git-send-email-vapier@gentoo.org |
---|---|
State | New |
Headers | show |
Il 16/09/2012 02:30, Mike Frysinger ha scritto: > There's no reason to require configure to run before running a clean > target, so check MAKECMDGOALS before. > > Signed-off-by: Mike Frysinger <vapier@gentoo.org> > --- > Makefile | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/Makefile b/Makefile > index 1cd5bc8..e75740c 100644 > --- a/Makefile > +++ b/Makefile > @@ -14,9 +14,11 @@ config-host.mak: $(SRC_PATH)/configure > @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh > else > config-host.mak: > +ifeq ($(findstring clean,$(MAKECMDGOALS)),) Please use instead: ifneq ($(filter-out %clean,$(MAKECMDGOALS)),) so that "make clean all" still gives error. Paolo > @echo "Please call configure before running make!" > @exit 1 > endif > +endif > > GENERATED_HEADERS = config-host.h trace.h qemu-options.def > ifeq ($(TRACE_BACKEND),dtrace) > @@ -398,7 +400,9 @@ qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \ > > # Add a dependency on the generated files, so that they are always > # rebuilt before other object files > +ifeq ($(findstring clean,$(MAKECMDGOALS)),) > Makefile: $(GENERATED_HEADERS) > +endif > > # Include automatically generated dependency files > # Dependencies in Makefile.objs files come from our recursive subdir rules >
On Sunday 16 September 2012 05:52:47 Paolo Bonzini wrote: > Il 16/09/2012 02:30, Mike Frysinger ha scritto: > > There's no reason to require configure to run before running a clean > > target, so check MAKECMDGOALS before. > > > > --- a/Makefile > > +++ b/Makefile > > @@ -14,9 +14,11 @@ config-host.mak: $(SRC_PATH)/configure > > @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh > > else > > config-host.mak: > > +ifeq ($(findstring clean,$(MAKECMDGOALS)),) > > Please use instead: > > ifneq ($(filter-out %clean,$(MAKECMDGOALS)),) > > so that "make clean all" still gives error. that breaks `make` though. or rather, `make` no longer errors out. need to make it a little more complicated to handle this. -mike
Il 16/09/2012 22:03, Mike Frysinger ha scritto: >>> > > +ifeq ($(findstring clean,$(MAKECMDGOALS)),) >> > >> > Please use instead: >> > >> > ifneq ($(filter-out %clean,$(MAKECMDGOALS)),) >> > >> > so that "make clean all" still gives error. > that breaks `make` though. or rather, `make` no longer errors out. need to > make it a little more complicated to handle this. Perhaps MAKECMDGOALS ?= all does it? Paolo
diff --git a/Makefile b/Makefile index 1cd5bc8..e75740c 100644 --- a/Makefile +++ b/Makefile @@ -14,9 +14,11 @@ config-host.mak: $(SRC_PATH)/configure @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh else config-host.mak: +ifeq ($(findstring clean,$(MAKECMDGOALS)),) @echo "Please call configure before running make!" @exit 1 endif +endif GENERATED_HEADERS = config-host.h trace.h qemu-options.def ifeq ($(TRACE_BACKEND),dtrace) @@ -398,7 +400,9 @@ qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \ # Add a dependency on the generated files, so that they are always # rebuilt before other object files +ifeq ($(findstring clean,$(MAKECMDGOALS)),) Makefile: $(GENERATED_HEADERS) +endif # Include automatically generated dependency files # Dependencies in Makefile.objs files come from our recursive subdir rules
There's no reason to require configure to run before running a clean target, so check MAKECMDGOALS before. Signed-off-by: Mike Frysinger <vapier@gentoo.org> --- Makefile | 4 ++++ 1 file changed, 4 insertions(+)