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 <psychon@znc.in>
This commit is contained in:
parent
82b51c2715
commit
5f92eda6bf
6
Makefile
6
Makefile
|
@ -13,7 +13,7 @@ all: $(TARGETS) ;
|
||||||
$(TARGETS): cmake-build
|
$(TARGETS): cmake-build
|
||||||
ln -s -f $(BUILDDIR)/$@ $@
|
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) "Creating build directory and running cmake in it. You can also run CMake directly, if you want."
|
||||||
$(ECHO)
|
$(ECHO)
|
||||||
mkdir -p $(BUILDDIR)
|
mkdir -p $(BUILDDIR)
|
||||||
|
@ -36,8 +36,8 @@ distclean:
|
||||||
$(RM) -r $(BUILDDIR) $(TARGETS)
|
$(RM) -r $(BUILDDIR) $(TARGETS)
|
||||||
$(ECHO) " done"
|
$(ECHO) " done"
|
||||||
|
|
||||||
%: cmake
|
%: $(BUILDDIR)/CMakeCache.txt
|
||||||
$(ECHO) "Running make $@…"
|
$(ECHO) "Running make $@…"
|
||||||
$(MAKE) -C $(BUILDDIR) $@
|
$(MAKE) -C $(BUILDDIR) $@
|
||||||
|
|
||||||
.PHONY: cmake-build cmake install distclean tags
|
.PHONY: cmake-build install distclean tags
|
||||||
|
|
Loading…
Reference in New Issue