diff options
author | nigel <nigel@d7aaf104-2d23-0410-ae22-9d23157bf5a3> | 2006-10-30 10:43:49 +0000 |
---|---|---|
committer | nigel <nigel@d7aaf104-2d23-0410-ae22-9d23157bf5a3> | 2006-10-30 10:43:49 +0000 |
commit | f9eb9ab48f6363ba1d8d121077de63bb34c1c1cf (patch) | |
tree | 6bc601846e05a74170e3a1039d2165904598b678 /Makefile | |
parent | 0d83967287362d6a55cb2f5096f4d8609888f7a8 (diff) | |
download | marex-dev-f9eb9ab48f6363ba1d8d121077de63bb34c1c1cf.tar.gz marex-dev-f9eb9ab48f6363ba1d8d121077de63bb34c1c1cf.tar.bz2 |
Updates to Makefile:
- Rename $NAME.new-deb to $NAME.newdeb (easier to type).
- Put cookies in cookies/ to make managment easier.
- Correct redirection to create one big log rather then restart with each step.
- Some of the targets advertised in the header weren't implemented. Address this.
git-svn-id: file:///beryl/trunk@889 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 118 |
1 files changed, 71 insertions, 47 deletions
@@ -24,7 +24,7 @@ # (Replace $NAME with one of the names from modules below). # # $NAME.clean Clean a single package. -# $NAME.new-deb (Re)build a deb. +# $NAME.newdeb (Re)build a 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. @@ -38,11 +38,15 @@ SUCMD?=sudo CFLAGS?=-O2 -Wall -ggdb3 -gstabs+ EXTRA_PACKAGE_ARGS=-us -uc SVNVER:=$(shell svn info | head -5 | tail -1 | awk -F ': ' '{ print $$2 }') +TRUNKDIR:=$(shell pwd) +COOKIEDIR=cookies + +.PRECIOUS: $(COOKIEDIR)/%.built ifeq ($(QUIET),1) -REDIRECT=>$*.log 2>&1 +REDIRECT=>>$(TRUNKDIR)/$*.log 2>&1 else -REDIRECT=2>&1 | tee $*.log +REDIRECT=2>&1 | tee -a $(TRUNKDIR)/$*.log endif modules:=\ @@ -55,21 +59,26 @@ modules:=\ # beryl-dbus \ -cfgmodules:=$(patsubst %,.%.cfg,$(modules)) -buildmodules:=$(patsubst %,.%.build,$(modules)) -installmodules:=$(patsubst %,.%.inst,$(modules)) -cleanmodules:=$(patsubst %,.%.clean,$(modules)) -debmodules:=$(patsubst %,.%.deb,$(modules)) +cfgmodules:=$(patsubst %,$(COOKIEDIR)/%.cfg,$(modules)) +buildmodules:=$(patsubst %,$(COOKIEDIR)/%.build,$(modules)) +installmodules:=$(patsubst %,$(COOKIEDIR)/%.installed,$(modules)) +cleanmodules:=$(patsubst %,$(COOKIEDIR)/%.clean,$(modules)) +debmodules:=$(patsubst %,$(COOKIEDIR)/%.deb,$(modules)) +debinstalls:=$(patsubst %,$(COOKIEDIR)/%.deb-installed,$(modules)) + +all: update $(buildmodules) + +all-debs: update debs -all: update rebuild $(buildmodules) +$(COOKIEDIR)/beryl-plugins.deb $(COOKIEDIR)/emerald.deb: $(COOKIEDIR)/beryl-settings.deb-installed -all-debs: update clean debs +$(COOKIEDIR)/beryl-settings.deb: $(COOKIEDIR)/beryl-core.deb-installed -beryl-plugins.deb beryl-settings.deb emerald.deb: beryl-core.deb +$(COOKIEDIR)/beryl-plugins.cfg $(COOKIEDIR)/emerald.cfg: $(COOKIEDIR)/beryl-settings.cfg -beryl-plugins.cfg beryl-settings.cfg emerald.cfg: beryl-core.installed +$(COOKIEDIR)/beryl-settings.installed: $(COOKIEDIR)/beryl-core.installed -beryl: update rebuild beryl-core.build beryl-plugins.build +beryl: update distclean $(COOKIEDIR)/beryl-core.build $(COOKIEDIR)/beryl-plugins.build usrlocalcheck: for i in beryl beryl-xgl beryl-settings beryl-manager \ @@ -81,77 +90,92 @@ usrlocalcheck: fi; \ done; +cookies: + mkdir cookies + update: @svn up + @make distclean + +$(COOKIEDIR)/%.clean: + @echo "==> Cleaning $* build." + @rm -rf .$*.build || /bin/true + @mkdir -p $(COOKIEDIR) || /bin/true + @rm -f $(COOKIEDIR)/$** -debs: $(debmodules) +$(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 + @touch $@ -.%.deb: .%.cfg +$(COOKIEDIR)/%.deb: $(COOKIEDIR)/%.cfg @echo "==> Building $* debian package." - if [ -d distro-specific-build-files/$*/debian ]; then \ + @if [ -d distro-specific-build-files/$*/debian ]; then \ cp -ar distro-specific-build-files/$*/debian .$*.build $(REDIRECT); \ fi @sed "1 s/)/-svn${SVNVER})/" -i .$*.build/debian/changelog - @sh -c 'cd .$*.build; dpkg-buildpackage -rfakeroot $(EXTRA_PACKAGE_ARGS)' $(REDIRECT) - @rm -rf .$*.build + @rm -f $(COOKIEDIR)/$*.debdone || /bin/true + @sh -c 'cd .$*.build; dpkg-buildpackage -rfakeroot $(EXTRA_PACKAGE_ARGS) && touch ../$(COOKIEDIR)/$*.deb' $(REDIRECT); + +$(COOKIEDIR)/%.deb-installed: $(COOKIEDIR)/%.deb @$(SUCMD) dpkg -i *.deb $(REDIRECT) @mkdir -p output/${SVNVER} @mv -f *.deb *.changes *.tar.gz *.dsc *.log output/${SVNVER} @touch $@ -%.new-deb: %.clean - @make .$*.deb +$(COOKIEDIR)/%.newdeb: $(COOKIEDIR)/%.clean + @make $(COOKIEDIR)/$*.deb-installed @/bin/true -%.clean: - @echo "==> Cleaning $* build." - @rm -rf $*.build || /bin/true - @rm -f $*.cfg $*.built $*.installed $*.deb - -.%.build: .%.cfg - @rm -f .$*.installed .$*.deb +$(COOKIEDIR)/%.built: $(COOKIEDIR)/%.cfg + @rm -rf $(COOKIEDIR)/$*.installed $(COOKIEDIR)/$*.deb .$*.build @cp -ar $* .$*.build @make -C .$*.build @touch $@ -.%.inst: .%.build - @$(SUCMD) make -C .$*.build install +$(COOKIEDIR)/%.installed: $(COOKIEDIR)/.%.built + @$(SUCMD) make -C .$*.build installed @touch $@ -.%.cfg: - @echo "==> Configuring $* build." - @cp -ar $* .$*.build $(REDIRECT) - @sh -c 'cd .$*.build;./autogen.sh --prefix=$(PREFIX) CFLAGS="$(CFLAGS)"' $(REDIRECT) - @rm -f .$*.built - @rm -f .$*.installed - @touch $@ +%.clean: $(COOKIEDIR)/%.clean + @/bin/true -%.build: .%.build +%.build: $(COOKIEDIR)/%.built @/bin/true %.rebuild: %.clean - make $*.build + make $(COOKIEDIR)/$*.built + +%.install: $(COOKIEDIR)/%.build + @make $(COOKIEDIR)/$*.installed + +%.deb: $(COOKIEDIR)/%.clean $(COOKIEDIR)/%.deb-installed @/bin/true -%.install: %.built - @make .$*.installed +%.newdeb: $(COOKIEDIR)/%.newdeb + @/bin/true configure: $(cfgmodules) -configure-beryl: .beryl-core.cfg .beryl-plugins.cfg - -rebuild: - @rm -f .*.built - @make build +configure-beryl: beryl-core.cfg beryl-plugins.cfg install: $(installmodules) clean: $(cleanmodules) + @rm -rf $(COOKIEDIR) build: $(buildmodules) +debs: $(debinstalls) + +newdebs: distclean debs + distclean: clean - rm -f *.changes *.deb *.tar.gz *.dsc + @rm -f *.changes *.deb *.tar.gz *.dsc cfg-clean: - rm -f .*.cfg + @rm -f $(COOKIEDIR)/*.cfg |