summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabien Tassin <fta@sofaraway.org>2007-09-18 21:01:46 +0000
committerFabien Tassin <fta@sofaraway.org>2007-09-18 21:01:46 +0000
commitc49ab1288de9df519e831930d7fa55749a85cba4 (patch)
treef26c23622f389a6ab7568ca03b357846441ee730
parent848c47e88db03b4b1ba7915231a5ef2b6e0a53b2 (diff)
* Rewrite all rules to avoid recursively expanded variables sometimes
producing unexpected results * Add a .PHONY target
-rw-r--r--Makefile132
1 files changed, 76 insertions, 56 deletions
diff --git a/Makefile b/Makefile
index b083b09..7b30d5d 100644
--- a/Makefile
+++ b/Makefile
@@ -6,44 +6,35 @@ CVS_LOC = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
STAMP ?= stamped
ifdef DEBIAN_DATE
-DEBIAN_FF3_DATE = $(DEBIAN_DATE)
-DEBIAN_XUL_DATE = $(DEBIAN_DATE)
-DEBIAN_NSS_DATE = $(DEBIAN_DATE)
-DEBIAN_NSPR_DATE = $(DEBIAN_DATE)
DEBIAN_CO_DATE = $(shell echo "-D \"$(DEBIAN_DATE)\"" | sed -e 's/[rt]/ /')
endif
############################################################################
-DEBIAN_FF3_TARGET = firefox-orig
-DEBIAN_FF3_APPNAME = firefox-trunk
-DEBIAN_FF3_FILE = mozilla/browser/config/version.txt
-DEBIAN_FF3_DATE ?= $(shell wget -O - -q --read-timeout=10 --user-agent="" --tries=3 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyBrowser&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot' 2> /dev/null | grep "a href='http://webtools.mozilla.org/registry/who.cgi" | head -1 | tr '<>' '@' | cut -d@ -f5 | tr -d ':-' | sed -e 's/&nbsp;/t/')
-DEBIAN_FF3_CO_DATE = $(shell echo $(DEBIAN_FF3_DATE) | sed -e 's/[rt]/ /')
-DEBIAN_FF3_VERSION = $(shell cat $(DEBIAN_FF3_FILE) | sed -e 's/a\([0-9]*\)pre/~a\1/')~cvs$(DEBIAN_FF3_DATE)
-
-DEBIAN_XUL_TARGET = xulrunner-orig
-DEBIAN_XUL_APPNAME = xulrunner-1.9
-DEBIAN_XUL_FILE = mozilla/config/milestone.txt
-DEBIAN_XUL_DATE ?= $(shell wget -O - -q --read-timeout=10 --user-agent="" --tries=3 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyBrowser&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot' 2> /dev/null | grep "a href='http://webtools.mozilla.org/registry/who.cgi" | head -1 | tr '<>' '@' | cut -d@ -f5 | tr -d ':-' | sed -e 's/&nbsp;/t/')
-DEBIAN_XUL_CO_DATE = $(shell echo $(DEBIAN_XUL_DATE) | sed -e 's/[rt]/ /')
-DEBIAN_XUL_VERSION = $(shell tail -1 $(DEBIAN_XUL_FILE) | sed -e 's/\(a[0-9]*\)pre/~\1/')~cvs$(DEBIAN_XUL_DATE)
-
-DEBIAN_NSS_TARGET = nss-orig
-DEBIAN_NSS_APPNAME = nss-trunk
-DEBIAN_NSS_FILE = mozilla/security/nss/lib/nss/nss.h
-DEBIAN_NSS_DATE ?= $(shell wget -O - -q --read-timeout=10 --user-agent="" --tries=3 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=NSS&module=all&branch=HEAD&branchtype=match&dir=mozilla%2Fdbm+mozilla%2Fsecurity%2Fnss+mozilla%2Fsecurity%2Fcoreconf+mozilla%2Fsecurity%2Fdbm&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=month&mindate=&maxdate=&cvsroot=%2Fcvsroot' 2> /dev/null | grep "a href='http://webtools.mozilla.org/registry/who.cgi" | head -1 | tr '<>' '@' | cut -d@ -f5 | tr -d ':-' | sed -e 's/&nbsp;/t/')
-DEBIAN_NSS_CO_DATE = $(shell echo $(DEBIAN_NSS_DATE) | sed -e 's/[rt]/ /')
-DEBIAN_NSS_VERSION = $(shell grep -E '^\#define NSS_V(MAJOR|MINOR|PATCH)' $(DEBIAN_NSS_FILE) | awk '{print $$3}' | tr '\n' '.' | sed -e 's,\.$$,,')~cvs$(DEBIAN_NSS_DATE)
-
-DEBIAN_NSPR_TARGET = nspr-orig
-DEBIAN_NSPR_APPNAME = nspr-trunk
-DEBIAN_NSPR_FILE = mozilla/nsprpub/configure.in
-DEBIAN_NSPR_DATE ?= $(shell wget -O - -q --read-timeout=10 --user-agent="" --tries=3 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=mozilla%2Fnsprpub&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=1177522884&maxdate=1588258884&cvsroot=%2Fcvsroot' 2> /dev/null | grep "a href='http://webtools.mozilla.org/registry/who.cgi" | head -1 | tr '<>' '@' | cut -d@ -f5 | tr -d ':-' | sed -e 's/&nbsp;/t/')
-DEBIAN_NSPR_CO_DATE = $(shell echo $(DEBIAN_NSPR_DATE) | sed -e 's/[rt]/ /')
-DEBIAN_NSPR_VERSION = $(shell grep -E '^MOD_(MAJOR|MINOR|PATCH)_VERSION' $(DEBIAN_NSPR_FILE) | cut -d= -f2 | tr '\n' '.' | sed -e 's,\.$$,,')~cvs$(DEBIAN_NSPR_DATE)
+DEBIAN_FF3_TARGET := firefox-orig
+DEBIAN_FF3_APPNAME := firefox-trunk
+DEBIAN_FF3_FILE := mozilla/browser/config/version.txt
+DEBIAN_FF3_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyBrowser&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot'
+
+DEBIAN_XUL_TARGET := xulrunner-orig
+DEBIAN_XUL_APPNAME := xulrunner-1.9
+DEBIAN_XUL_FILE := mozilla/config/milestone.txt
+DEBIAN_XUL_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyBrowser&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=week&mindate=&maxdate=&cvsroot=%2Fcvsroot'
+
+DEBIAN_NSS_TARGET := nss-orig
+DEBIAN_NSS_APPNAME := nss-trunk
+DEBIAN_NSS_FILE := mozilla/security/nss/lib/nss/nss.h
+DEBIAN_NSS_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=NSS&module=all&branch=HEAD&branchtype=match&dir=mozilla%2Fdbm+mozilla%2Fsecurity%2Fnss+mozilla%2Fsecurity%2Fcoreconf+mozilla%2Fsecurity%2Fdbm&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=month&mindate=&maxdate=&cvsroot=%2Fcvsroot'
+
+DEBIAN_NSPR_TARGET := nspr-orig
+DEBIAN_NSPR_APPNAME := nspr-trunk
+DEBIAN_NSPR_FILE := mozilla/nsprpub/configure.in
+DEBIAN_NSPR_URL := 'http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=mozilla%2Fnsprpub&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=1177522884&maxdate=1588258884&cvsroot=%2Fcvsroot'
############################################################################
+EXCLUDE := --exclude=CVS --exclude=.cvsignore
+GET := wget -O - -q --read-timeout=10 --user-agent='' --tries=3 $$URL 2> /dev/null | grep "href='http://webtools" | head -1 | tr '<>' '@' | cut -d@ -f5 | tr -d ':-' | sed -e 's/&nbsp;/t/'
+
help:
@echo "Usage:"
@echo " make client Fetch and patch mozilla client"
@@ -90,35 +81,64 @@ unpatch:
clean: unpatch
rm -rf cvsco.log* $(MOZ_CLIENT) mozilla
+all: $(DEBIAN_FF3_TARGET) $(DEBIAN_XUL_TARGET) $(DEBIAN_NSS_TARGET)
+
$(DEBIAN_FF3_TARGET): $(MOZ_CLIENT) $(STAMP) $(DEBIAN_FF3_FILE)
- make -f $(MOZ_CLIENT) checkout MOZ_CO_PROJECT=xulbrowser MOZ_CO_DATE="$(DEBIAN_FF3_CO_DATE)"
- rm -rf $(DEBIAN_FF3_APPNAME)-$(DEBIAN_FF3_VERSION) $(DEBIAN_FF3_APPNAME)_$(DEBIAN_FF3_VERSION).orig.tar.gz
- mkdir $(DEBIAN_FF3_APPNAME)-$(DEBIAN_FF3_VERSION)
- tar jcf $(DEBIAN_FF3_APPNAME)-$(DEBIAN_FF3_VERSION)/browser-snapshot-$(DEBIAN_FF3_DATE).tar.bz2 --exclude=CVS --exclude=.cvsignore mozilla
- rm -f $(DEBIAN_FF3_APPNAME)_$(DEBIAN_FF3_VERSION).orig.tar.gz
- tar zcf $(DEBIAN_FF3_APPNAME)_$(DEBIAN_FF3_VERSION).orig.tar.gz $(DEBIAN_FF3_APPNAME)-$(DEBIAN_FF3_VERSION)
- rm -rf mozilla cvsco.log* $(STAMP) .pc $(DEBIAN_FF3_APPNAME)-$(DEBIAN_FF3_VERSION)
+ URL=$(DEBIAN_FF3_URL) ; \
+ if [ "$(DEBIAN_DATE)" != "" ] ; then DEBIAN_FF3_DATE=$(DEBIAN_DATE) ; else DEBIAN_FF3_DATE=`$(GET)` ; fi ; \
+ DEBIAN_FF3_CO_DATE="`echo $$DEBIAN_FF3_DATE | sed -e 's/[rt]/ /'`" ; \
+ DEBIAN_FF3_VERSION="`cat $(DEBIAN_FF3_FILE) | sed -e 's/a\([0-9]*\)pre/~a\1/'`~cvs$$DEBIAN_FF3_DATE" ; \
+ make -f $(MOZ_CLIENT) checkout MOZ_CO_PROJECT=xulbrowser MOZ_CO_DATE="$$DEBIAN_FF3_CO_DATE" && \
+ rm -rf $(DEBIAN_FF3_APPNAME)-$$DEBIAN_FF3_VERSION $(DEBIAN_FF3_APPNAME)_$$DEBIAN_FF3_VERSION.orig.tar.gz && \
+ mkdir $(DEBIAN_FF3_APPNAME)-$$DEBIAN_FF3_VERSION && \
+ echo "Creating $(DEBIAN_FF3_APPNAME)-$$DEBIAN_FF3_VERSION/browser-snapshot-$$DEBIAN_FF3_DATE.tar.bz2 ..." && \
+ tar jcf $(DEBIAN_FF3_APPNAME)-$$DEBIAN_FF3_VERSION/browser-snapshot-$$DEBIAN_FF3_DATE.tar.bz2 $(EXCLUDE) mozilla && \
+ rm -f $(DEBIAN_FF3_APPNAME)_$$DEBIAN_FF3_VERSION.orig.tar.gz && \
+ echo "Creating $(DEBIAN_FF3_APPNAME)_$$DEBIAN_FF3_VERSION.orig.tar.gz ..." && \
+ tar zcf $(DEBIAN_FF3_APPNAME)_$$DEBIAN_FF3_VERSION.orig.tar.gz $(DEBIAN_FF3_APPNAME)-$$DEBIAN_FF3_VERSION && \
+ rm -rf mozilla cvsco.log* $(STAMP) .pc $(DEBIAN_FF3_APPNAME)-$$DEBIAN_FF3_VERSION ; \
+ ls -l $(DEBIAN_FF3_APPNAME)_$$DEBIAN_FF3_VERSION.orig.tar.gz
$(DEBIAN_XUL_TARGET): $(MOZ_CLIENT) $(STAMP) $(DEBIAN_XUL_FILE)
- make -f $(MOZ_CLIENT) checkout MOZ_CO_PROJECT=xulrunner MOZ_CO_DATE="$(DEBIAN_XUL_CO_DATE)"
- mkdir $(DEBIAN_XUL_APPNAME)-$(DEBIAN_XUL_VERSION)
- mv mozilla $(DEBIAN_XUL_APPNAME)-$(DEBIAN_XUL_VERSION)
- rm -f $(DEBIAN_XUL_APPNAME)_$(DEBIAN_XUL_VERSION).orig.tar.gz
- tar zcf $(DEBIAN_XUL_APPNAME)_$(DEBIAN_XUL_VERSION).orig.tar.gz --exclude=CVS --exclude=.cvsignore $(DEBIAN_XUL_APPNAME)-$(DEBIAN_XUL_VERSION)
- rm -rf cvsco.log* $(STAMP) .pc $(DEBIAN_XUL_APPNAME)-$(DEBIAN_XUL_VERSION)
+ URL=$(DEBIAN_XUL_URL) ; \
+ if [ "$(DEBIAN_DATE)" != "" ] ; then DEBIAN_XUL_DATE=$(DEBIAN_DATE) ; else DEBIAN_XUL_DATE=`$(GET)` ; fi ; \
+ DEBIAN_XUL_CO_DATE="`echo $$DEBIAN_XUL_DATE | sed -e 's/[rt]/ /'`" ; \
+ DEBIAN_XUL_VERSION="`tail -1 $(DEBIAN_XUL_FILE) | sed -e 's/\(a[0-9]*\)pre/~\1/'`~cvs$$DEBIAN_XUL_DATE" ; \
+ make -f $(MOZ_CLIENT) checkout MOZ_CO_PROJECT=xulrunner MOZ_CO_DATE="$$DEBIAN_XUL_CO_DATE" && \
+ mkdir $(DEBIAN_XUL_APPNAME)-$$DEBIAN_XUL_VERSION && \
+ mv mozilla $(DEBIAN_XUL_APPNAME)-$$DEBIAN_XUL_VERSION && \
+ rm -f $(DEBIAN_XUL_APPNAME)_$$DEBIAN_XUL_VERSION.orig.tar.gz && \
+ echo "Creating $(DEBIAN_XUL_APPNAME)_$$DEBIAN_XUL_VERSION.orig.tar.gz ..." && \
+ tar zcf $(DEBIAN_XUL_APPNAME)_$$DEBIAN_XUL_VERSION.orig.tar.gz $(EXCLUDE) $(DEBIAN_XUL_APPNAME)-$$DEBIAN_XUL_VERSION && \
+ rm -rf cvsco.log* $(STAMP) .pc $(DEBIAN_XUL_APPNAME)-$$DEBIAN_XUL_VERSION ; \
+ ls -l $(DEBIAN_XUL_APPNAME)_$$DEBIAN_XUL_VERSION.orig.tar.gz
$(DEBIAN_NSS_TARGET): $(MOZ_CLIENT) $(STAMP) $(DEBIAN_NSS_FILE)
- make -f $(MOZ_CLIENT) checkout MOZ_CO_PROJECT=nss MOZ_CO_DATE="$(DEBIAN_NSS_CO_DATE)"
- mkdir $(DEBIAN_NSS_APPNAME)-$(DEBIAN_NSS_VERSION)
- mv mozilla $(DEBIAN_NSS_APPNAME)-$(DEBIAN_NSS_VERSION)
- rm -f $(DEBIAN_NSS_APPNAME)_$(DEBIAN_NSS_VERSION).orig.tar.gz
- tar zcf $(DEBIAN_NSS_APPNAME)_$(DEBIAN_NSS_VERSION).orig.tar.gz --exclude=CVS --exclude=.cvsignore $(DEBIAN_NSS_APPNAME)-$(DEBIAN_NSS_VERSION)
- rm -rf cvsco.log* $(STAMP) .pc $(DEBIAN_NSS_APPNAME)-$(DEBIAN_NSS_VERSION)
+ URL=$(DEBIAN_NSS_URL) ; \
+ if [ "$(DEBIAN_DATE)" != "" ] ; then DEBIAN_NSS_DATE=$(DEBIAN_DATE) ; else DEBIAN_NSS_DATE=`$(GET)` ; fi ; \
+ DEBIAN_NSS_CO_DATE="`echo $$DEBIAN_NSS_DATE | sed -e 's/[rt]/ /'`" ; \
+ DEBIAN_NSS_VERSION="`grep -E '^\#define NSS_V(MAJOR|MINOR|PATCH)' $(DEBIAN_NSS_FILE) | awk '{print $$3}' | tr '\n' '.' | sed -e 's,\.$$,,'`'~cvs$$DEBIAN_NSS_DATE" ; \
+ make -f $(MOZ_CLIENT) checkout MOZ_CO_PROJECT=nss MOZ_CO_DATE="$$DEBIAN_NSS_CO_DATE" && \
+ mkdir $(DEBIAN_NSS_APPNAME)-$$DEBIAN_NSS_VERSION && \
+ mv mozilla $(DEBIAN_NSS_APPNAME)-$$DEBIAN_NSS_VERSION && \
+ rm -f $(DEBIAN_NSS_APPNAME)_$$DEBIAN_NSS_VERSION.orig.tar.gz && \
+ echo "Creating $(DEBIAN_NSS_APPNAME)_$$DEBIAN_NSS_VERSION.orig.tar.gz ..." && \
+ tar zcf $(DEBIAN_NSS_APPNAME)_$$DEBIAN_NSS_VERSION.orig.tar.gz $(EXCLUDE) $(DEBIAN_NSS_APPNAME)-$$DEBIAN_NSS_VERSION && \
+ rm -rf cvsco.log* $(STAMP) .pc $(DEBIAN_NSS_APPNAME)-$$DEBIAN_NSS_VERSION ; \
+ ls -l $(DEBIAN_NSS_APPNAME)_$$DEBIAN_NSS_VERSION.orig.tar.gz
$(DEBIAN_NSPR_TARGET): $(MOZ_CLIENT) $(STAMP) $(DEBIAN_NSPR_FILE)
- make -f $(MOZ_CLIENT) checkout MOZ_CO_PROJECT=nspr MOZ_CO_DATE="$(DEBIAN_NSPR_CO_DATE)"
- mkdir $(DEBIAN_NSPR_APPNAME)-$(DEBIAN_NSPR_VERSION)
- mv mozilla $(DEBIAN_NSPR_APPNAME)-$(DEBIAN_NSPR_VERSION)
- rm -f $(DEBIAN_NSPR_APPNAME)_$(DEBIAN_NSPR_VERSION).orig.tar.gz
- tar zcf $(DEBIAN_NSPR_APPNAME)_$(DEBIAN_NSPR_VERSION).orig.tar.gz --exclude=CVS --exclude=.cvsignore $(DEBIAN_NSPR_APPNAME)-$(DEBIAN_NSPR_VERSION)
- rm -rf cvsco.log* $(STAMP) .pc $(DEBIAN_NSPR_APPNAME)-$(DEBIAN_NSPR_VERSION)
+ URL=$(DEBIAN_NSPR_URL) ; \
+ if [ "$(DEBIAN_DATE)" != "" ] ; then DEBIAN_NSPR_DATE=$(DEBIAN_DATE) ; else DEBIAN_NSPR_DATE=`$(GET)` ; fi ; \
+ DEBIAN_NSPR_CO_DATE="`echo $$DEBIAN_NSPR_DATE | sed -e 's/[rt]/ /'`" ; \
+ DEBIAN_NSPR_VERSION="`grep -E '^MOD_(MAJOR|MINOR|PATCH)_VERSION' $(DEBIAN_NSPR_FILE) | cut -d= -f2 | tr '\n' '.' | sed -e 's,\.$$,,'`~cvs$$DEBIAN_NSPR_DATE" ; \
+ make -f $(MOZ_CLIENT) checkout MOZ_CO_PROJECT=nspr MOZ_CO_DATE="$$DEBIAN_NSPR_CO_DATE" && \
+ mkdir $(DEBIAN_NSPR_APPNAME)-$$DEBIAN_NSPR_VERSION && \
+ mv mozilla $(DEBIAN_NSPR_APPNAME)-$$DEBIAN_NSPR_VERSION && \
+ rm -f $(DEBIAN_NSPR_APPNAME)_$$DEBIAN_NSPR_VERSION.orig.tar.gz && \
+ echo "Creating $(DEBIAN_NSPR_APPNAME)_$$DEBIAN_NSPR_VERSION.orig.tar.gz ..." && \
+ tar zcf $(DEBIAN_NSPR_APPNAME)_$$DEBIAN_NSPR_VERSION.orig.tar.gz $(EXCLUDE) $(DEBIAN_NSPR_APPNAME)-$$DEBIAN_NSPR_VERSION && \
+ rm -rf cvsco.log* $(STAMP) .pc $(DEBIAN_NSPR_APPNAME)-$$DEBIAN_NSPR_VERSION ; \
+ ls -l $(DEBIAN_NSPR_APPNAME)_$$DEBIAN_NSPR_VERSION.orig.tar.gz
+
+.PHONY : all clean help deps client unpatch