mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-16 07:47:22 +01:00
a7b281294c
It could depend on $(shell git ls-files), but it's not worth the overhead to get this list then always.
47 lines
980 B
Makefile
47 lines
980 B
Makefile
builddir=.build-$(shell hostname)-$(shell gcc -dumpmachine)-$(shell gcc -dumpversion)
|
|
|
|
ifeq (,$(VERBOSE))
|
|
MAKEFLAGS:=$(MAKEFLAGS)s
|
|
ECHO=echo
|
|
else
|
|
ECHO=@:
|
|
endif
|
|
|
|
TARGETS=awesome
|
|
BUILDLN=build
|
|
|
|
all: $(TARGETS) $(BUILDLN) ;
|
|
|
|
$(TARGETS): cmake-build
|
|
ln -s -f ${builddir}/$@ $@
|
|
|
|
$(BUILDLN):
|
|
test -e $(BUILDLN) || ln -s -f ${builddir} $(BUILDLN)
|
|
|
|
cmake ${builddir}/CMakeCache.txt:
|
|
mkdir -p ${builddir}
|
|
$(ECHO) "Running cmake…"
|
|
cd ${builddir} && cmake $(CMAKE_ARGS) "$(@D)" ..
|
|
|
|
cmake-build: ${builddir}/CMakeCache.txt
|
|
$(ECHO) "Building…"
|
|
$(MAKE) -C ${builddir}
|
|
|
|
tags:
|
|
git ls-files | xargs ctags
|
|
|
|
install:
|
|
$(ECHO) "Installing…"
|
|
$(MAKE) -C ${builddir} install
|
|
|
|
distclean:
|
|
$(ECHO) -n "Cleaning up build directory…"
|
|
$(RM) -r ${builddir} $(BUILDLN) $(TARGETS)
|
|
$(ECHO) " done"
|
|
|
|
%: cmake
|
|
$(ECHO) "Running make $@…"
|
|
$(MAKE) -C ${builddir} $@
|
|
$(and $(filter clean,$@),$(RM) $(BUILDLN) $(TARGETS))
|
|
|
|
.PHONY: cmake-build cmake install distclean $(BUILDLN) tags
|