diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2015-01-24 16:08:13 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2015-01-24 16:27:16 +0100 |
commit | a19dd1d73ece5384c87c42477eb36265f127015d (patch) | |
tree | 967e39bc364043cd5c5f7b5c0467f138f6c4a5ae /Makefile | |
parent | 31530d93448bdf93c0797540a73c6b67586ad5e1 (diff) |
Rework Makefile targets
Since $(BUILDDIR) depended on the phony target "check", it was always
considered out-of-date. So it was always rebuilt resulting in running
the "cmake" command again even if it was already run.
Add a new phony target "cmake_build" that always triggers the cmake build
and make $(PROG) depend on it.
Running "make" a second time now doesn't run cmake again.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -19,18 +19,18 @@ JSMODULES=$(wildcard js/lib/*.js) VERSION?=$(SPECVERSION) RELEASE?=CommonMark-$(VERSION) -.PHONY: all spec leakcheck clean fuzztest dingus upload jshint test testjs benchjs update-site upload-site check npm debug mingw archive tarball ziparchive testtarball testziparchive testlib bench astyle +.PHONY: all cmake_build spec leakcheck clean fuzztest dingus upload jshint test testjs benchjs update-site upload-site npm debug mingw archive tarball ziparchive testtarball testziparchive testlib bench astyle -all: $(PROG) man/man3/cmark.3 +all: cmake_build man/man3/cmark.3 @echo "Binaries can be found in $(BUILDDIR)/src" -$(PROG): $(BUILDDIR) +$(PROG): cmake_build + +cmake_build: $(BUILDDIR) @make -j2 -C $(BUILDDIR) -check: +$(BUILDDIR): $(SRCDIR)/html_unescape.h $(SRCDIR)/case_fold_switch.inc @cmake --version > /dev/null || (echo "You need cmake to build this program: http://www.cmake.org/download/" && exit 1) - -$(BUILDDIR): check $(SRCDIR)/html_unescape.h $(SRCDIR)/case_fold_switch.inc mkdir -p $(BUILDDIR); \ cd $(BUILDDIR); \ cmake .. -G "$(GENERATOR)" -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) |