aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2020-09-01 16:20:16 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-09-01 12:11:00 -0400
commit9f5d95976895132976d9d6c14e7a35781d6f1e15 (patch)
tree018aa33fe43c909be61df0cdb3a99a7b6203a271 /Makefile
parentd79864058a643671bbed8f587edd893aada928da (diff)
Makefile: Fix in-tree clean/distclean
Doing 'make clean' or 'make distclean' in a freshly cloned tree results in: make: *** No rule to make target 'ninja-clean', needed by 'clean'. Stop. Make the fallback rules global. While here, change the ninjatool recipe to always have a zero exit status and thus prevent make to emit a warning. Fixes: a56650518f5b ("configure: integrate Meson in the build system") Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <159897001659.442705.15538955005543395950.stgit@bahia.lan> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 8 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 049e2ffa03..ed354c43b0 100644
--- a/Makefile
+++ b/Makefile
@@ -54,13 +54,6 @@ export NINJA=./ninjatool
# enough to prime the rest of the build.
ninjatool: build.ninja
-# Only needed in case Makefile.ninja does not exist.
-.PHONY: ninja-clean ninja-distclean clean-ctlist
-clean-ctlist:
-ninja-clean::
-ninja-distclean::
-build.ninja: config-host.mak
-
Makefile.ninja: build.ninja ninjatool
./ninjatool -t ninja2make --omit clean dist uninstall cscope TAGS ctags < $< > $@
-include Makefile.ninja
@@ -115,6 +108,13 @@ ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fa
endif
endif
+# Only needed in case Makefile.ninja does not exist.
+.PHONY: ninja-clean ninja-distclean clean-ctlist
+clean-ctlist:
+ninja-clean::
+ninja-distclean::
+build.ninja: config-host.mak
+
include $(SRC_PATH)/rules.mak
# lor is defined in rules.mak
@@ -195,7 +195,7 @@ recurse-clean: $(addsuffix /clean, $(ROM_DIRS))
######################################################################
clean: recurse-clean ninja-clean clean-ctlist
- -test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean
+ if test -f ninjatool; then ./ninjatool $(if $(V),-v,) -t clean; fi
# avoid old build problems by removing potentially incorrect old files
rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
find . \( -name '*.so' -o -name '*.dll' -o -name '*.[oda]' \) -type f \