summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authornigel <nigel@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-10-27 12:43:40 +0000
committernigel <nigel@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-10-27 12:43:40 +0000
commit46f65fac45aec829b6917650130f8f1b2ba3c02b (patch)
tree34505f1f5e6b6e2f25e0554950320039688eb891 /Makefile
parent7e311d01f6b01de1fb4e38761abaa0ededa0af4a (diff)
downloadmarex-dev-46f65fac45aec829b6917650130f8f1b2ba3c02b.tar.gz
marex-dev-46f65fac45aec829b6917650130f8f1b2ba3c02b.tar.bz2
Improve Makefile to provide simple targets for building and rebuilding
debs and simple installations. See the top of the Makefile for more details. git-svn-id: file:///beryl/trunk@835 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile136
1 files changed, 90 insertions, 46 deletions
diff --git a/Makefile b/Makefile
index b7d2657..e8b68b6 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,34 @@
#
# Thanks to DBO for some good ideas.
#
+# Targets:
+#
+# update: Run svn update.
+# configure: Run autogen for each package.
+# build: Build each package, but don't install any of them
+# (won't work if you don't already have compatible versions
+# installed).
+# rebuild: Rerun building packages.
+# usrlocalcheck: Check for binaries in /usr/local.
+# debs: Build Debian packages, installing with sudo along the way.
+# install: Install modules from source.
+# clean: Cleanup.
+# distclean: Cleanup thoroughly.
+# all: Build and install everything from source.
+#
+# Per package targets:
+# (Replace $NAME with one of the names from modules below).
+#
+# $NAME.clean Clean a single package.
+# $NAME.deb Build and install a single deb.
+# $NAME.new-deb (Re)build a previously built deb.
+# $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.
+#
+# 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.
+#
PREFIX?=/usr
SUCMD?=sudo
@@ -20,20 +48,17 @@ modules:=\
emerald \
emerald-themes
-cfgmodules:=$(patsubst %,%.cfg-stamp,$(modules))
-buildmodules:=$(patsubst %,%.build-stamp,$(modules))
-installmodules:=$(patsubst %,%.inst-stamp,$(modules))
-cleanmodules:=$(patsubst %,%.clean-stamp,$(modules))
-debmodules:=$(patsubst %,%.deb-stamp,$(modules))
+cfgmodules:=$(patsubst %,.%.cfg,$(modules))
+buildmodules:=$(patsubst %,.%.build,$(modules))
+installmodules:=$(patsubst %,.%.inst,$(modules))
+cleanmodules:=$(patsubst %,.%.clean,$(modules))
+debmodules:=$(patsubst %,.%.deb,$(modules))
all: update rebuild $(buildmodules)
-beryl-plugins.cfg-stamp beryl-settings.cfg-stamp emerald.cfg-stamp: beryl-core.inst-stamp
+beryl-plugins.cfg beryl-settings.cfg emerald.cfg: beryl-core.inst
-beryl: update rebuild beryl-core.build-stamp beryl-plugins.build-stamp
-
-rebuild:
- rm -f *.build-stamp
+beryl: update rebuild beryl-core.build beryl-plugins.build
usrlocalcheck:
for i in beryl beryl-xgl beryl-settings beryl-manager \
@@ -50,57 +75,76 @@ update:
debs: $(debmodules)
-%.deb-stamp: %.cfg-stamp
- rm -rf $*.deb-build
- cp -ar $* $*.deb-build
- if [ -d $*.deb-build/debian ]; then \
- rm -rf $*.deb-build/debian; \
+%.deb: .%.cfg
+ if [ -d $*.build/debian ]; then \
+ rm -rf .$*.build/debian; \
fi
if [ -d distro-specific-build-files/$*/debian ]; then \
- cp -ar distro-specific-build-files/$*/debian $*.deb-build; \
+ cp -ar distro-specific-build-files/$*/debian .$*.build; \
fi
- sed "1 s/)/-svn${SVNVER})/" -i $*.deb-build/debian/changelog
- sh -c 'cd $*.deb-build; dpkg-buildpackage -rfakeroot $(EXTRA_PACKAGE_ARGS) 2>&1 | tee ../$*.log '
- rm -rf $*.deb-build
+ sed "1 s/)/-svn${SVNVER})/" -i .$*.build/debian/changelog
+ sh -c 'cd .$*.build; dpkg-buildpackage -rfakeroot $(EXTRA_PACKAGE_ARGS) 2>&1 | tee ../$*.log '
+ rm -rf .$*.build
$(SUCMD) dpkg -i *.deb
mkdir -p output/${SVNVER}
mv -f *.deb *.changes *.tar.gz *.dsc *.log output/${SVNVER}
- touch $@
- touch $*.inst-stamp
-
-%.clean-stamp:
- make -C $* clean || /bin/true
- rm -f $*.cfg-stamp
- rm -f $*.build-stamp
- rm -f $*.inst-stamp
- rm -f $*.package-stamp
- rm -f $*.deb-stamp
-
-%.build-stamp: %.cfg-stamp
- rm -f $*.inst-stamp
- make -C $*
- touch $@
-
-%.inst-stamp: %.build-stamp
- $(SUCMD) make -C $* install
- touch $@
-
-%.cfg-stamp:
- sh -c 'cd $*;./autogen.sh --prefix=$(PREFIX) CFLAGS="$(CFLAGS)"'
- rm -f $*.build-stamp
- rm -f $*.inst-stamp
- touch $@
+ @touch $@
+
+%.new-deb: %.clean
+ @make $*.deb
+ @/bin/true
+
+%.clean:
+ @rm -rf .$*.build || /bin/true
+ @rm -f .$*.cfg
+ @rm -f .$*.built
+ @rm -f .$*.installed
+ @rm -f $*.deb
+
+.%.build: .%.cfg
+ rm -f .$*.installed .$*.deb
+ cp -ar $* .$*.build
+ make -C .$*.build
+ @touch $@
+
+.%.inst: .%.build
+ $(SUCMD) make -C .$*.build install
+ @touch $@
+
+.%.cfg:
+ @rm -rf .$*.build
+ cp -ar $* .$*.build
+ sh -c 'cd .$*.build;./autogen.sh --prefix=$(PREFIX) CFLAGS="$(CFLAGS)"'
+ @rm -f .$*.built
+ @rm -f .$*.installed
+ @touch $@
+
+%.build: .%.build
+ @/bin/true
+
+%.rebuild: %.clean
+ make $*.build
+ @/bin/true
+
+%.install: %.built
+ @make .$*.installed
configure: $(cfgmodules)
-configure-beryl: beryl-core.cfg-stamp beryl-plugins.cfg-stamp
+configure-beryl: .beryl-core.cfg .beryl-plugins.cfg
+
+rebuild:
+ @rm -f .*.built
+ @make build
install: $(installmodules)
clean: $(cleanmodules)
+build: $(buildmodules)
+
distclean: clean
rm -f *.changes *.deb *.tar.gz *.dsc
cfg-clean:
- rm -f *.cfg-stamp
+ rm -f .*.cfg