From 5f92eda6bf456115d3ecb48000667b6e0511a42b Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Tue, 16 May 2017 10:31:15 +0200 Subject: [PATCH] Makefile: Run cmake less often Previously, running make in the build/ directory depended on the "cmake" target which was running the cmake command. This target was phony, meaning that it was always considered to be out of date and needed to be re-generated. Change this so that instead things depend on the CMakeCache.txt file. If that file is already there, we do not re-run cmake. Signed-off-by: Uli Schlachter --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6dee69b50..514a285c6 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ all: $(TARGETS) ; $(TARGETS): cmake-build ln -s -f $(BUILDDIR)/$@ $@ -cmake $(BUILDDIR)/CMakeCache.txt: +$(BUILDDIR)/CMakeCache.txt: $(ECHO) "Creating build directory and running cmake in it. You can also run CMake directly, if you want." $(ECHO) mkdir -p $(BUILDDIR) @@ -36,8 +36,8 @@ distclean: $(RM) -r $(BUILDDIR) $(TARGETS) $(ECHO) " done" -%: cmake +%: $(BUILDDIR)/CMakeCache.txt $(ECHO) "Running make $@…" $(MAKE) -C $(BUILDDIR) $@ -.PHONY: cmake-build cmake install distclean tags +.PHONY: cmake-build install distclean tags