summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authornigel <nigel@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-02 01:19:26 +0000
committernigel <nigel@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-02 01:19:26 +0000
commita74211e4121d810a1e479009dd8cbe070b265cbe (patch)
tree673fb657db5edfd46483de63c8b6564e8a272eba /Makefile
parent05a9306316cff769d6f1c36a5e7dd21f033fc592 (diff)
downloadmarex-dev-a74211e4121d810a1e479009dd8cbe070b265cbe.tar.gz
marex-dev-a74211e4121d810a1e479009dd8cbe070b265cbe.tar.bz2
Component: Trunk Makefile
- Fix build target - Add uninstall target (reverse make install) - Ensure Make doesn't automatically delete any cookies. Fixes #733 git-svn-id: file:///beryl/trunk@962 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile41
1 files changed, 27 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 6ef7fcc..3812589 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,7 @@
# usrlocalcheck: Check for binaries in /usr/local.
# debs: Build Debian packages, installing with sudo along the way.
# install: Install modules from source.
+# uninstall: Remove modules previously installed from source.
# clean: Cleanup.
# distclean: Cleanup thoroughly.
# all: Build and install everything from source.
@@ -28,6 +29,7 @@
# $NAME.build Build but don't install a single package.
# $NAME.rebuild (Re)build a package.
# $NAME.install Rebuild and install a single package from source.
+# $NAME.uninstall Remove a package previously installed from source.
#
# The checked-out tree is copied to .$NAME.build for building, so any
# mistakes in cleaning up etc won't accidentally delete your precious files.
@@ -41,7 +43,7 @@ SVNVER:=$(shell svn info | head -5 | tail -1 | awk -F ': ' '{ print $$2 }')
TRUNKDIR:=$(shell pwd)
COOKIEDIR=cookies
-.PRECIOUS: $(COOKIEDIR)/%.built
+.PRECIOUS: $(COOKIEDIR)/%.cfg $(COOKIEDIR)/%.built $(COOKIEDIR)/%.deb $(COOKIEDIR)/%.deb-installed $(COOKIEDIR)/%.installed
ifeq ($(QUIET),1)
REDIRECT=>>$(TRUNKDIR)/$*.log 2>&1
@@ -62,6 +64,7 @@ modules:=\
cfgmodules:=$(patsubst %,$(COOKIEDIR)/%.cfg,$(modules))
buildmodules:=$(patsubst %,$(COOKIEDIR)/%.built,$(modules))
installmodules:=$(patsubst %,$(COOKIEDIR)/%.installed,$(modules))
+uninstallmodules:=$(patsubst %,$(COOKIEDIR)/%.uninstall,$(modules))
cleanmodules:=$(patsubst %,$(COOKIEDIR)/%.clean,$(modules))
debmodules:=$(patsubst %,$(COOKIEDIR)/%.deb,$(modules))
debinstalls:=$(patsubst %,$(COOKIEDIR)/%.deb-installed,$(modules))
@@ -70,13 +73,11 @@ all: update $(buildmodules)
all-debs: update debs
-$(COOKIEDIR)/beryl-plugins.deb $(COOKIEDIR)/emerald.deb: $(COOKIEDIR)/beryl-settings.deb-installed
+$(COOKIEDIR)/beryl-plugins.deb $(COOKIEDIR)/emerald.deb: $(COOKIEDIR)/beryl-core.deb-installed
-$(COOKIEDIR)/beryl-settings.deb: $(COOKIEDIR)/beryl-core.deb-installed
+$(COOKIEDIR)/beryl-settings.deb: $(COOKIEDIR)/beryl-plugins.deb-installed
-$(COOKIEDIR)/beryl-plugins.cfg $(COOKIEDIR)/emerald.cfg: $(COOKIEDIR)/beryl-settings.cfg
-
-$(COOKIEDIR)/beryl-settings.installed: $(COOKIEDIR)/beryl-core.installed
+$(COOKIEDIR)/beryl-plugins.built $(COOKIEDIR)/emerald.built: $(COOKIEDIR)/beryl-core.installed
beryl: update distclean $(COOKIEDIR)/beryl-core.build $(COOKIEDIR)/beryl-plugins.build
@@ -102,14 +103,14 @@ $(COOKIEDIR)/%.clean:
@rm -rf .$*.build || /bin/true
@mkdir -p $(COOKIEDIR) || /bin/true
@rm -f $(COOKIEDIR)/$**
+ @touch $@
$(COOKIEDIR)/%.cfg: $(COOKIEDIR)/%.clean
@echo "==> Configuring $* build."
@cp -ar $* .$*.build $(REDIRECT)
@sh -c 'cd .$*.build;./autogen.sh --prefix=$(PREFIX) CFLAGS="$(CFLAGS)"' $(REDIRECT)
@mkdir -p $(COOKIEDIR) || /bin/true
- @rm -f $(COOKIEDIR)/$*.built
- @rm -f $(COOKIEDIR)/$*.installed
+ @rm -f $(COOKIEDIR)/$*.clean
@touch $@
$(COOKIEDIR)/%.deb: $(COOKIEDIR)/%.cfg
@@ -124,25 +125,32 @@ $(COOKIEDIR)/%.deb: $(COOKIEDIR)/%.cfg
@sed "1 s/-svn[0-9]*)/)/" -i .$*.build/debian/changelog
$(COOKIEDIR)/%.deb-installed: $(COOKIEDIR)/%.deb
+ @echo "==> Installing $* debian packages."
@$(SUCMD) dpkg -i *.deb $(REDIRECT)
@mkdir -p output/${SVNVER}
@mv -f *.deb *.changes *.tar.gz *.dsc *.log output/${SVNVER}
@touch $@
+ @touch $(COOKIEDIR)/$*.installed
$(COOKIEDIR)/%.newdeb: $(COOKIEDIR)/%.clean
@make $(COOKIEDIR)/$*.deb-installed
@/bin/true
$(COOKIEDIR)/%.built: $(COOKIEDIR)/%.cfg
- @rm -rf $(COOKIEDIR)/$*.installed $(COOKIEDIR)/$*.deb .$*.build
- @cp -ar $* .$*.build
- @make -C .$*.build
+ @echo "==> Building $*."
+ @make -C .$*.build $(REDIRECT)
@touch $@
-$(COOKIEDIR)/%.installed: $(COOKIEDIR)/.%.built
- @$(SUCMD) make -C .$*.build installed
+$(COOKIEDIR)/%.installed: $(COOKIEDIR)/%.built
+ @echo "==> Installing $*."
+ @$(SUCMD) make -C .$*.build install $(REDIRECT)
@touch $@
+$(COOKIEDIR)/%.uninstall: $(COOKIEDIR)/%.cfg
+ @echo "==> Uninstalling $*."
+ @$(SUCMD) make -C .$*.build uninstall $(REDIRECT)
+ @rm -f $(COOKIEDIR)/$*.installed
+
%.clean: $(COOKIEDIR)/%.clean
@/bin/true
@@ -155,6 +163,9 @@ $(COOKIEDIR)/%.installed: $(COOKIEDIR)/.%.built
%.install: $(COOKIEDIR)/%.build
@make $(COOKIEDIR)/$*.installed
+%.uninstall: $(COOKIEDIR)/*.build
+ @make $(COOKIEDIR)/$*
+
%.deb: $(COOKIEDIR)/%.clean $(COOKIEDIR)/%.deb-installed
@/bin/true
@@ -167,8 +178,10 @@ configure-beryl: beryl-core.cfg beryl-plugins.cfg
install: $(installmodules)
+uninstall: $(uninstallmodules)
+
clean: $(cleanmodules)
- @rm -rf $(COOKIEDIR)
+ @/bin/true
build: $(buildmodules)