2008-07-01 21:19:09 +02:00
|
|
|
ifeq (,$(VERBOSE))
|
|
|
|
MAKEFLAGS:=$(MAKEFLAGS)s
|
|
|
|
ECHO=echo
|
|
|
|
else
|
|
|
|
ECHO=@:
|
|
|
|
endif
|
|
|
|
|
2009-04-08 17:48:52 +02:00
|
|
|
TARGETS=awesome
|
2017-05-16 10:30:24 +02:00
|
|
|
BUILDDIR=build
|
2008-07-01 08:25:40 +02:00
|
|
|
|
2017-06-25 20:04:32 +02:00
|
|
|
all: check-unit $(TARGETS) ;
|
2008-07-01 08:25:40 +02:00
|
|
|
|
2008-07-01 21:52:38 +02:00
|
|
|
$(TARGETS): cmake-build
|
|
|
|
|
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-05-16 10:30:24 +02:00
|
|
|
cd $(BUILDDIR) && cmake $(CMAKE_ARGS) "$(@D)" ..
|
2008-07-01 08:25:40 +02:00
|
|
|
|
2017-07-04 10:17:12 +02:00
|
|
|
cmake-build: $(BUILDDIR)/Makefile
|
2008-07-01 21:52:38 +02:00
|
|
|
$(ECHO) "Building…"
|
2017-05-16 10:30:24 +02:00
|
|
|
$(MAKE) -C $(BUILDDIR)
|
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-05-16 10:30:24 +02:00
|
|
|
$(RM) -r $(BUILDDIR) $(TARGETS)
|
2008-07-01 21:19:09 +02:00
|
|
|
$(ECHO) " done"
|
2008-07-01 08:25:40 +02:00
|
|
|
|
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
|