[tor-commits] [torbrowser/maint-2.3] Source files don't depend on arch, give them their own dir

erinn at torproject.org erinn at torproject.org
Thu Mar 8 20:43:01 UTC 2012


commit eccdc690cf76fada62b5bb9ee316c5acfdecb90d
Author: Sebastian Hahn <sebastian at torproject.org>
Date:   Thu Feb 16 04:28:50 2012 +0100

    Source files don't depend on arch, give them their own dir
---
 build-scripts/linux.mk    |   16 ++++++----
 build-scripts/osx.mk      |   14 +++++----
 build-scripts/versions.mk |   68 +++++++++++++++++++++++----------------------
 build-scripts/windows.mk  |   13 +++++---
 4 files changed, 60 insertions(+), 51 deletions(-)

diff --git a/build-scripts/linux.mk b/build-scripts/linux.mk
index 9a11164..a66ae77 100644
--- a/build-scripts/linux.mk
+++ b/build-scripts/linux.mk
@@ -22,10 +22,12 @@ PLATFORM=Linux
 # Number of cpu cores used to build in parallel
 NUM_CORES=2
 
-## Location of directory for source unpacking
-FETCH_DIR=/srv/build-trees/build-alpha-$(ARCH_TYPE)
+## Location of directory for source downloading
+FETCH_DIR=/srv/build-trees/build-alpha
+## Location of directory for source unpacking/building
+BUILD_DIR=$(FETCH_DIR)/$(ARCH_TYPE)
 ## Location of directory for prefix/destdir/compiles/etc
-BUILT_DIR=$(FETCH_DIR)/built
+BUILT_DIR=$(BUILD_DIR)/built
 TBB_FINAL=$(BUILT_DIR)/TBBL
 
 ## Include versions (must happen after variable definitions above
@@ -94,11 +96,11 @@ build-firefox: config/dot_mozconfig $(FIREFOX_DIR)
 	touch $(STAMP_DIR)/build-firefox
 
 copy-firefox:
-	-rm -rf $(FETCH_DIR)/Firefox
+	-rm -rf $(BUILD_DIR)/Firefox
 	## This is so ugly. Update it to use cool tar --transform soon.
 	cd $(FIREFOX_DIR) && make -C obj-$(ARCH_TYPE)-*/ package
-	cp $(FIREFOX_DIR)/obj-$(ARCH_TYPE)-*/dist/*bz2 $(FETCH_DIR)
-	cd $(FETCH_DIR) && tar -xvjf firefox-$(FIREFOX_VER).en-US.linux-$(ARCH_TYPE).tar.bz2 && mv firefox Firefox
+	cp $(FIREFOX_DIR)/obj-$(ARCH_TYPE)-*/dist/*bz2 $(BUILD_DIR)
+	cd $(BUILD_DIR) && tar -xvjf firefox-$(FIREFOX_VER).en-US.linux-$(ARCH_TYPE).tar.bz2 && mv firefox Firefox
 
 # source-dance unpack-source
 build-all-binaries: source-dance build-zlib build-openssl build-libpng build-qt build-vidalia build-libevent build-tor build-firefox
@@ -120,7 +122,7 @@ ZLIB=$(COMPILED_LIBS)
 TOR=$(COMPILED_BINS)/tor
 VIDALIA=$(BUILT_DIR)/usr/local/bin/vidalia
 ## Someday, this will be our custom Firefox
-FIREFOX=$(FETCH_DIR)/Firefox
+FIREFOX=$(BUILD_DIR)/Firefox
 PIDGIN=$(COMPILED_BINS)/pidgin
 
 ## Location of utility applications
diff --git a/build-scripts/osx.mk b/build-scripts/osx.mk
index 2310826..160c9dd 100644
--- a/build-scripts/osx.mk
+++ b/build-scripts/osx.mk
@@ -33,10 +33,12 @@ BACKWARDS_COMPAT=$(MIN_VERSION) $(CF_MIN_VERSION) $(LD_MIN_VERSION)
 # Number of cpu cores used to build in parallel
 NUM_CORES=2
 
-## Location of directory for source unpacking
-FETCH_DIR=$(PWD)/build-$(ARCH_TYPE)
+## Location of directory for source fetching
+FETCH_DIR=$(PWD)/build
+## Location of directory for source unpacking/building
+BUILD_DIR=$(FETCH_DIR)/$(ARCH_TYPE)
 ## Location of directory for prefix/destdir/compiles/etc
-BUILT_DIR=$(FETCH_DIR)/built
+BUILT_DIR=$(BUILD_DIR)/built
 TBB_FINAL=$(BUILT_DIR)/tbbosx-dist
 
 ## Include versions (must happen after variable definitions above
@@ -113,8 +115,8 @@ build-firefox: $(FIREFOX_DIR) config/mozconfig-osx-$(ARCH_TYPE)
 	touch $(STAMP_DIR)/build-firefox
 
 copy-firefox:
-	-rm -rf $(FETCH_DIR)/Firefox.app
-	cp -r $(FIREFOX_DIR)/obj*/dist/*.app $(FETCH_DIR)/Firefox.app
+	-rm -rf $(BUILD_DIR)/Firefox.app
+	cp -r $(FIREFOX_DIR)/obj*/dist/*.app $(BUILD_DIR)/Firefox.app
 
 build-all-binaries: build-zlib build-openssl build-vidalia build-libevent build-tor build-firefox
 	echo "If we're here, we've done something right."
@@ -134,7 +136,7 @@ LIBEVENT=$(COMPILED_LIBS)
 VIDALIA=$(BUILT_DIR)/usr/local/bin/Vidalia.app/
 TOR=$(COMPILED_BINS)/tor
 ## Someday, this will be our custom Firefox
-FIREFOX=$(FETCH_DIR)/Firefox.app
+FIREFOX=$(BUILD_DIR)/Firefox.app
 PIDGIN=$(COMPILED_BINS)/pidgin
 
 ## Location of utility applications
diff --git a/build-scripts/versions.mk b/build-scripts/versions.mk
index 92f7acf..984cf58 100644
--- a/build-scripts/versions.mk
+++ b/build-scripts/versions.mk
@@ -70,18 +70,18 @@ mozbuild=MOZBUILD
 pymake=PYMAKE
 
 # The locations of the unpacked tarballs
-ZLIB_DIR=$(FETCH_DIR)/zlib-$(ZLIB_VER)
-LIBPNG_DIR=$(FETCH_DIR)/libpng-$(LIBPNG_VER)
-QT_DIR=$(FETCH_DIR)/qt-$(QT_VER)
-OPENSSL_DIR=$(FETCH_DIR)/openssl-$(OPENSSL_VER)
-VIDALIA_DIR=$(FETCH_DIR)/vidalia-$(VIDALIA_VER)
-LIBEVENT_DIR=$(FETCH_DIR)/libevent-$(LIBEVENT_VER)
-TOR_DIR=$(FETCH_DIR)/tor-$(TOR_VER)
-FIREFOX_DIR=$(FETCH_DIR)/firefox-$(FIREFOX_VER)
-MOZBUILD_DIR=$(FETCH_DIR)/mozilla-build
-PYMAKE_DIR=$(FETCH_DIR)/pymake-$(PYMAKE_VER)
-
-# Empty targets are written in arch-dependent $(FETCH_DIR). Usual
+ZLIB_DIR=$(BUILD_DIR)/zlib-$(ZLIB_VER)
+LIBPNG_DIR=$(BUILD_DIR)/libpng-$(LIBPNG_VER)
+QT_DIR=$(BUILD_DIR)/qt-$(QT_VER)
+OPENSSL_DIR=$(BUILD_DIR)/openssl-$(OPENSSL_VER)
+VIDALIA_DIR=$(BUILD_DIR)/vidalia-$(VIDALIA_VER)
+LIBEVENT_DIR=$(BUILD_DIR)/libevent-$(LIBEVENT_VER)
+TOR_DIR=$(BUILD_DIR)/tor-$(TOR_VER)
+FIREFOX_DIR=$(BUILD_DIR)/firefox-$(FIREFOX_VER)
+MOZBUILD_DIR=$(BUILD_DIR)/mozilla-build
+PYMAKE_DIR=$(BUILD_DIR)/pymake-$(PYMAKE_VER)
+
+# Empty targets are written in arch-dependent $(BUILD_DIR). Usual
 # VPATH issues documented below should be avoided as the paths of
 # these targes are never used in dependents recipes. We only make use
 # of targets existence.
@@ -98,6 +98,9 @@ fetch-source: $(FETCH_DIR)/$(ZLIB_PACKAGE) $(FETCH_DIR)/$(LIBPNG_PACKAGE) $(FETC
 $(FETCH_DIR):
 	mkdir -p $(FETCH_DIR)
 
+$(BUILD_DIR):
+	mkdir -p $(BUILD_DIR)
+
 # XXX
 # If we can, we should definitely add some stuff here to check signatures -
 # at least for those packages that support it.
@@ -152,45 +155,44 @@ langpack_en-US.xpi:
 unpack-source: $(ZLIB_DIR) $(OPENSSL_DIR) $(LIBPNG_DIR $(QT_DIR) $(VIDALIA_DIR) $(LIBEVENT_DIR) $(TOR_DIR) $(FIREFOX_DIR)
 
 
-$(ZLIB_DIR): $(FETCH_DIR)/$(ZLIB_PACKAGE)
+$(ZLIB_DIR): $(FETCH_DIR)/$(ZLIB_PACKAGE) | $(BUILD_DIR)
 	rm -rf $(ZLIB_DIR)
-	cd $(FETCH_DIR) && tar -xmf $(ZLIB_PACKAGE)
+	cd $(FETCH_DIR) && tar -xmf $(ZLIB_PACKAGE) -C $(BUILD_DIR)/
 
 $(LIBPNG_DIR): $(FETCH_DIR)/$(LIBPNG_PACKAGE)
 	rm -rf $(LIBPNG_DIR)
-	cd $(FETCH_DIR) && tar -xmf $(LIBPNG_PACKAGE)
-
+	cd $(FETCH_DIR) && tar -xmf $(LIBPNG_PACKAGE) -C $(BUILD_DIR)/
 
-$(QT_DIR): $(FETCH_DIR)/$(QT_PACKAGE)
+$(QT_DIR): $(FETCH_DIR)/$(QT_PACKAGE) | $(BUILD_DIR)
 	rm -rf $(QT_DIR) $(FETCH_DIR)/qt-everywhere-opensource-src-$(QT_VER)
-	cd $(FETCH_DIR) && tar -xmf $(QT_PACKAGE)
-	mv $(FETCH_DIR)/qt-everywhere-opensource-src-$(QT_VER) $(QT_DIR)
+	cd $(FETCH_DIR) && tar -xmf $(QT_PACKAGE) -C $(BUILD_DIR)/
+	mv $(BUILD_DIR)/qt-everywhere-opensource-src-$(QT_VER) $(QT_DIR)
 
-$(OPENSSL_DIR): $(FETCH_DIR)/$(OPENSSL_PACKAGE)
+$(OPENSSL_DIR): $(FETCH_DIR)/$(OPENSSL_PACKAGE) | $(BUILD_DIR)
 	rm -rf $(OPENSSL_DIR)
-	cd $(FETCH_DIR) && tar -xmf $(OPENSSL_PACKAGE)
+	cd $(FETCH_DIR) && tar -xmf $(OPENSSL_PACKAGE) -C $(BUILD_DIR)/
 
-$(VIDALIA_DIR): $(FETCH_DIR)/$(VIDALIA_PACKAGE)
+$(VIDALIA_DIR): $(FETCH_DIR)/$(VIDALIA_PACKAGE) | $(BUILD_DIR)
 	rm -rf $(VIDALIA_DIR)
-	cd $(FETCH_DIR) && tar -xmf $(VIDALIA_PACKAGE)
+	cd $(FETCH_DIR) && tar -xmf $(VIDALIA_PACKAGE) -C $(BUILD_DIR)/
 
-$(LIBEVENT_DIR): $(FETCH_DIR)/$(LIBEVENT_PACKAGE)
+$(LIBEVENT_DIR): $(FETCH_DIR)/$(LIBEVENT_PACKAGE) | $(BUILD_DIR)
 	rm -rf $(LIBEVENT_DIR)
-	cd $(FETCH_DIR) && tar -xmf $(LIBEVENT_PACKAGE)
+	cd $(FETCH_DIR) && tar -xmf $(LIBEVENT_PACKAGE) -C $(BUILD_DIR)/
 
-$(TOR_DIR): $(FETCH_DIR)/$(TOR_PACKAGE)
+$(TOR_DIR): $(FETCH_DIR)/$(TOR_PACKAGE) | $(BUILD_DIR)
 	rm -rf $(TOR_DIR)
-	cd $(FETCH_DIR) && tar -xmf $(TOR_PACKAGE)
+	cd $(FETCH_DIR) && tar -xmf $(TOR_PACKAGE) -C $(BUILD_DIR)/
 
-$(FIREFOX_DIR): $(FETCH_DIR)/$(FIREFOX_PACKAGE) ../src/current-patches/firefox/*
+$(FIREFOX_DIR): $(FETCH_DIR)/$(FIREFOX_PACKAGE) ../src/current-patches/firefox/* | $(BUILD_DIR)
 	rm -rf $(FIREFOX_DIR) $(FETCH_DIR)/mozilla-release
-	cd $(FETCH_DIR) && tar -xmf $(FIREFOX_PACKAGE)
-	mv $(FETCH_DIR)/mozilla-release $(FIREFOX_DIR)
+	cd $(FETCH_DIR) && tar -xmf $(FIREFOX_PACKAGE) -C $(BUILD_DIR)/
+	mv $(BUILD_DIR)/mozilla-release $(FIREFOX_DIR)
 	cp ../src/current-patches/firefox/* $(FIREFOX_DIR)
 	cp patch-any-src.sh $(FIREFOX_DIR)
 	cd $(FIREFOX_DIR) && ./patch-any-src.sh
 
-$(MOZBUILD_DIR): $(FETCH_DIR)/$(MOZBUILD_PACKAGE) ../src/current-patches/mozilla-build/start-msvc.patch ../src/current-patches/mozilla-build/guess-msvc-x64.bat patch-mozilla-build.sh
+$(MOZBUILD_DIR): $(FETCH_DIR)/$(MOZBUILD_PACKAGE) ../src/current-patches/mozilla-build/start-msvc.patch ../src/current-patches/mozilla-build/guess-msvc-x64.bat patch-mozilla-build.sh | $(BUILD_DIR)
 	rm -rf $(MOZBUILD_DIR) /c/mozilla-build
 # We could try passing a /D argument here, but then we'd need to convert
 # mingw paths into windows paths. We'll just go with the default here.
@@ -202,9 +204,9 @@ $(MOZBUILD_DIR): $(FETCH_DIR)/$(MOZBUILD_PACKAGE) ../src/current-patches/mozilla
 	cp patch-mozilla-build.sh $(MOZBUILD_DIR)
 	cd $(MOZBUILD_DIR) && ./patch-mozilla-build.sh $(MSVC_VER)
 
-$(PYMAKE_DIR): $(FETCH_DIR)/$(PYMAKE_PACKAGE)
+$(PYMAKE_DIR): $(FETCH_DIR)/$(PYMAKE_PACKAGE) | $(BUILD_DIR)
 	rm -rf $(PYMAKE_DIR)
-	cd $(FETCH_DIR) && tar -xmf $(PYMAKE_PACKAGE)
+	cd $(FETCH_DIR) && tar -xmf $(PYMAKE_PACKAGE) -C $(BUILD_DIR)/
 
 
 clean-fetch-%:
diff --git a/build-scripts/windows.mk b/build-scripts/windows.mk
index 8eddc2a..b1b511a 100644
--- a/build-scripts/windows.mk
+++ b/build-scripts/windows.mk
@@ -23,10 +23,10 @@ OPENSSL_LIB=$(COMPILED_BINS)
 WIX_LIB="/c/Program Files (x86)/Windows Installer XML v3.5/bin"
 
 ## Location of bundle components
-VIDALIA=$(FETCH_DIR)/vidalia-$(VIDALIA_VER)
-TOR=$(FETCH_DIR)/tor-$(TOR_VER)
-FIREFOX=$(FETCH_DIR)/FirefoxPortable-$(FIREFOX_VER)
-PIDGIN=$(FETCH_DIR)/PidginPortable-$(PIDGIN_VER)
+VIDALIA=$(BUILD_DIR)/vidalia-$(VIDALIA_VER)
+TOR=$(BUILD_DIR)/tor-$(TOR_VER)
+FIREFOX=$(BUILD_DIR)/FirefoxPortable-$(FIREFOX_VER)
+PIDGIN=$(BUILD_DIR)/PidginPortable-$(PIDGIN_VER)
 
 ## Location of utility applications
 PWD:=$(shell pwd)
@@ -46,8 +46,11 @@ NUM_CORES=2
 
 ## Location of directory for source unpacking
 FETCH_DIR=$(PWD)/build-alpha-windows
+## Location of directory for source unpacking/building
+## This must be different from FETCH_DIR
+BUILD_DIR=$(FETCH_DIR)/build
 ## Location of directory for prefix/destdir/compiles/etc
-BUILT_DIR=$(FETCH_DIR)/built
+BUILT_DIR=$(BUILD_DIR)/built
 TBB_FINAL=$(BUILT_DIR)/tbbwin-alpha-dist
 
 ## Include versions (must happen after variable definitions above





More information about the tor-commits mailing list