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:
|
2008-07-01 21:19:09 +02:00
|
|
|
mkdir -p ${builddir}
|
2008-07-01 21:52:38 +02:00
|
|
|
$(ECHO) "Running cmake…"
|
|
|
|
cd ${builddir} && cmake "$(@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))
|
|
|
|
|
|
|
|
.PHONY: cmake-build cmake install $(BUILDLN)
|