2008-07-01 21:19:09 +02:00
|
|
|
ifeq (,$(VERBOSE))
|
|
|
|
MAKEFLAGS:=$(MAKEFLAGS)s
|
|
|
|
ECHO=echo
|
|
|
|
else
|
|
|
|
ECHO=@:
|
|
|
|
endif
|
|
|
|
|
2017-05-16 10:30:24 +02:00
|
|
|
BUILDDIR=build
|
2008-07-01 08:25:40 +02:00
|
|
|
|
2019-01-12 11:46:23 +01:00
|
|
|
# Run "make" in $(BUILDDIR) by default.
|
|
|
|
# This is required to generate all files already, which should not be generated
|
|
|
|
# with "(sudo) make install" only later.
|
|
|
|
cmake-build: $(BUILDDIR)/Makefile
|
|
|
|
$(ECHO) "Building…"
|
|
|
|
$(MAKE) -C $(BUILDDIR)
|
2008-07-01 21:52:38 +02:00
|
|
|
|
2017-07-04 10:17:12 +02:00
|
|
|
$(BUILDDIR)/Makefile:
|
2017-05-16 10:20:30 +02:00
|
|
|
$(ECHO) "Creating build directory and running cmake in it. You can also run CMake directly, if you want."
|
|
|
|
$(ECHO)
|
2017-05-16 10:30:24 +02:00
|
|
|
mkdir -p $(BUILDDIR)
|
2008-07-01 21:52:38 +02:00
|
|
|
$(ECHO) "Running cmake…"
|
2017-10-23 22:24:58 +02:00
|
|
|
cd $(BUILDDIR) && cmake $(CMAKE_ARGS) "$(CURDIR)"
|
2008-07-01 08:25:40 +02:00
|
|
|
|
2008-07-01 22:16:47 +02:00
|
|
|
tags:
|
|
|
|
git ls-files | xargs ctags
|
|
|
|
|
|
|
|
install:
|
2008-07-01 21:52:38 +02:00
|
|
|
$(ECHO) "Installing…"
|
2017-05-16 10:30:24 +02:00
|
|
|
$(MAKE) -C $(BUILDDIR) install
|
2008-07-01 08:25:40 +02:00
|
|
|
|
2008-07-01 21:52:38 +02:00
|
|
|
distclean:
|
2008-07-01 21:19:09 +02:00
|
|
|
$(ECHO) -n "Cleaning up build directory…"
|
2017-10-23 22:25:18 +02:00
|
|
|
$(RM) -r $(BUILDDIR)
|
2008-07-01 08:25:40 +02:00
|
|
|
|
2017-10-22 15:32:37 +02:00
|
|
|
# Use an explicit rule to not "update" the Makefile via the implicit rule below.
|
|
|
|
Makefile: ;
|
|
|
|
|
2017-07-04 10:17:12 +02:00
|
|
|
%: $(BUILDDIR)/Makefile
|
|
|
|
$(ECHO) "Running make $@ in $(BUILDDIR)…"
|
2017-05-16 10:30:24 +02:00
|
|
|
$(MAKE) -C $(BUILDDIR) $@
|
2008-07-01 21:52:38 +02:00
|
|
|
|
2017-05-16 10:31:15 +02:00
|
|
|
.PHONY: cmake-build install distclean tags
|