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-05-16 10:30:24 +02:00
|
|
|
all: $(TARGETS) ;
|
2008-07-01 08:25:40 +02:00
|
|
|
|
2008-07-01 21:52:38 +02:00
|
|
|
$(TARGETS): cmake-build
|
2017-05-16 10:30:24 +02:00
|
|
|
ln -s -f $(BUILDDIR)/$@ $@
|
2008-07-01 21:52:38 +02:00
|
|
|
|
2017-05-16 10:30:24 +02:00
|
|
|
cmake $(BUILDDIR)/CMakeCache.txt:
|
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-05-16 10:30:24 +02:00
|
|
|
cmake-build: $(BUILDDIR)/CMakeCache.txt
|
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
|
|
|
|
2008-08-04 11:51:11 +02:00
|
|
|
%: cmake
|
2008-07-01 21:52:38 +02:00
|
|
|
$(ECHO) "Running make $@…"
|
2017-05-16 10:30:24 +02:00
|
|
|
$(MAKE) -C $(BUILDDIR) $@
|
2008-07-01 21:52:38 +02:00
|
|
|
|
2017-05-16 10:30:24 +02:00
|
|
|
.PHONY: cmake-build cmake install distclean tags
|