awesome/Makefile
Pierre Habouzit 91656b0b29 Revamp the toplevel Makefile.
This fixes among things:
* cmake has a clean target that doesn't redo cmake, use it, implement
  distclean for what clean did.
* cmake is aware that it has to reconfigure, let id be clever about that
  instead of being half clever ourselves.
* Don't have a *build* symlink and a *build* target, this is confusing.
* Forward things we don't know about to cmake.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-01 22:02:24 +02:00

44 lines
915 B
Makefile

builddir=.build-$(shell hostname)-$(shell gcc -dumpmachine)-$(shell gcc -dumpversion)
ifeq (,$(VERBOSE))
MAKEFLAGS:=$(MAKEFLAGS)s
ECHO=echo
else
ECHO=@:
endif
TARGETS=awesome awesome-client
BUILDLN=build
all: $(TARGETS) $(BUILDLN) ;
$(TARGETS): cmake-build
ln -s -f ${builddir}/$@ $@
$(BUILDLN):
ln -s -f ${builddir} $(BUILDLN)
cmake ${builddir}/CMakeCache.txt:
mkdir -p ${builddir}
$(ECHO) "Running cmake…"
cd ${builddir} && cmake "$(@D)" ..
cmake-build: ${builddir}/CMakeCache.txt
$(ECHO) "Building…"
$(MAKE) -C ${builddir}
install: cmake-build
$(ECHO) "Installing…"
$(MAKE) -C ${builddir} install
distclean:
$(ECHO) -n "Cleaning up build directory…"
$(RM) -r ${builddir} $(BUILDLN) $(TARGETS)
$(ECHO) " done"
%:
$(ECHO) "Running make $@"
$(MAKE) -C ${builddir} $@
$(and $(filter clean,$@),$(RM) $(BUILDLN) $(TARGETS))
.PHONY: cmake-build cmake install $(BUILDLN)