2008-07-01 08:25:40 +02:00
|
|
|
builddir=.build-$(shell hostname)-$(shell gcc -dumpmachine)-$(shell gcc -dumpversion)
|
|
|
|
|
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
|
2008-07-01 21:52:38 +02:00
|
|
|
BUILDLN=build
|
2008-07-01 08:25:40 +02:00
|
|
|
|
2008-07-01 21:52:38 +02:00
|
|
|
all: $(TARGETS) $(BUILDLN) ;
|
2008-07-01 08:25:40 +02:00
|
|
|
|
2008-07-01 21:52:38 +02:00
|
|
|
$(TARGETS): cmake-build
|
|
|
|
ln -s -f ${builddir}/$@ $@
|
2008-07-01 08:25:40 +02:00
|
|
|
|
2008-07-01 21:52:38 +02:00
|
|
|
$(BUILDLN):
|
2008-09-29 16:21:36 +02:00
|
|
|
test -e $(BUILDLN) || ln -s -f ${builddir} $(BUILDLN)
|
2008-07-01 21:52:38 +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)
|
2008-07-01 21:19:09 +02:00
|
|
|
mkdir -p ${builddir}
|
2008-07-01 21:52:38 +02:00
|
|
|
$(ECHO) "Running cmake…"
|
2009-05-08 19:54:38 +02:00
|
|
|
cd ${builddir} && cmake $(CMAKE_ARGS) "$(@D)" ..
|
2008-07-01 08:25:40 +02:00
|
|
|
|
2008-07-01 21:52:38 +02:00
|
|
|
cmake-build: ${builddir}/CMakeCache.txt
|
|
|
|
$(ECHO) "Building…"
|
|
|
|
$(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…"
|
|
|
|
$(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…"
|
2008-07-01 21:52:38 +02:00
|
|
|
$(RM) -r ${builddir} $(BUILDLN) $(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 $@…"
|
|
|
|
$(MAKE) -C ${builddir} $@
|
|
|
|
$(and $(filter clean,$@),$(RM) $(BUILDLN) $(TARGETS))
|
|
|
|
|
2015-07-11 22:50:11 +02:00
|
|
|
.PHONY: cmake-build cmake install distclean $(BUILDLN) tags
|