[tor-commits] [torbrowser/maint-2.2] Put empty targets in an arch-dependent location
erinn at torproject.org
erinn at torproject.org
Thu Mar 8 20:43:01 UTC 2012
commit ad1322dcc7ff17d3cb5f8b4d2a54dfaf4ae4eb6e
Author: Patrick Mézard <patrick at mezard.eu>
Date: Wed Feb 15 00:11:51 2012 +0100
Put empty targets in an arch-dependent location
Otherwise make is confused when ARCH_TYPE is changed with existing empty
targets. STAMP_DIR is added for clarity but no target is added as it would
probably create a cycle with FETCH_DIR. It could easily be added afterwards.
vpath directives are picked over VPATH because there are many build products
and it is better to risk rebuilding than selecting targets by mistake.
---
build-scripts/linux.mk | 20 ++++++++++----------
build-scripts/osx.mk | 18 +++++++++---------
build-scripts/versions.mk | 11 +++++++++++
build-scripts/windows.mk | 18 +++++++++---------
4 files changed, 39 insertions(+), 28 deletions(-)
diff --git a/build-scripts/linux.mk b/build-scripts/linux.mk
index 8d2febd..338a8c0 100644
--- a/build-scripts/linux.mk
+++ b/build-scripts/linux.mk
@@ -57,14 +57,14 @@ build-zlib: $(ZLIB_DIR)
cd $(ZLIB_DIR) && ./configure $(ZLIB_OPTS)
cd $(ZLIB_DIR) && make -j $(NUM_CORES)
cd $(ZLIB_DIR) && make install
- touch build-zlib
+ touch $(STAMP_DIR)/build-zlib
LIBPNG_OPTS=--prefix=$(BUILT_DIR)
build-libpng: $(LIBPNG_DIR)
cd $(LIBPNG_DIR) && ./configure $(LIBPNG_OPTS)
cd $(LIBPNG_DIR) && make
cd $(LIBPNG_DIR) && make install
- touch build-libpng
+ touch $(STAMP_DIR)/build-libpng
OPENSSL_OPTS=-no-idea -no-rc5 -no-md2 shared zlib --prefix=$(BUILT_DIR) --openssldir=$(BUILT_DIR) -I$(BUILT_DIR)/include -L$(BUILT_DIR)/lib
build-openssl: build-zlib $(OPENSSL_DIR)
@@ -72,7 +72,7 @@ build-openssl: build-zlib $(OPENSSL_DIR)
cd $(OPENSSL_DIR) && make depend
cd $(OPENSSL_DIR) && make
cd $(OPENSSL_DIR) && make install_sw
- touch build-openssl
+ touch $(STAMP_DIR)/build-openssl
QT_BUILD_PREFS=-system-zlib -confirm-license -opensource -openssl-linked -no-qt3support -fast -release -nomake demos -nomake examples
QT_OPTS=$(QT_BUILD_PREFS) -prefix $(BUILT_DIR) -I $(BUILT_DIR)/include -I $(BUILT_DIR)/include/openssl/ -L$(BUILT_DIR)/lib
@@ -80,28 +80,28 @@ build-qt: build-zlib build-openssl $(QT_DIR)
cd $(QT_DIR) && ./configure $(QT_OPTS)
cd $(QT_DIR) && make -j $(NUM_CORES)
cd $(QT_DIR) && make install
- touch build-qt
+ touch $(STAMP_DIR)/build-qt
VIDALIA_OPTS=-DOPENSSL_LIBCRYPTO=$(BUILT_DIR)/lib/libcrypto.so.1.0.0 -DOPENSSL_LIBSSL=$(BUILT_DIR)/lib/libssl.so.1.0.0 -DCMAKE_BUILD_TYPE=debug -DQT_QMAKE_EXECUTABLE=$(BUILT_DIR)/bin/qmake ..
build-vidalia: build-openssl build-qt $(VIDALIA_DIR)
-mkdir $(VIDALIA_DIR)/build
cd $(VIDALIA_DIR)/build && cmake $(VIDALIA_OPTS) && make -j $(NUM_CORES)
cd $(VIDALIA_DIR)/build && DESTDIR=$(BUILT_DIR) make install
- touch build-vidalia
+ touch $(STAMP_DIR)/build-vidalia
LIBEVENT_OPTS=--prefix=$(BUILT_DIR)
build-libevent: build-zlib build-openssl $(LIBEVENT_DIR)
cd $(LIBEVENT_DIR) && ./configure $(LIBEVENT_OPTS)
cd $(LIBEVENT_DIR) && make -j $(NUM_CORES)
cd $(LIBEVENT_DIR) && make install
- touch build-libevent
+ touch $(STAMP_DIR)/build-libevent
TOR_OPTS=--enable-gcc-warnings --with-openssl-dir=$(BUILT_DIR) --with-zlib-dir=$(BUILT_DIR) --with-libevent-dir=$(BUILT_DIR)/lib --prefix=$(BUILT_DIR)
build-tor: build-zlib build-openssl build-libevent $(TOR_DIR)
cd $(TOR_DIR) && ./configure $(TOR_OPTS)
cd $(TOR_DIR) && make -j $(NUM_CORES)
cd $(TOR_DIR) && make install
- touch build-tor
+ touch $(STAMP_DIR)/build-tor
build-pidgin:
echo "We're not building pidgin yet!"
@@ -109,7 +109,7 @@ build-pidgin:
build-firefox: config/dot_mozconfig $(FIREFOX_DIR)
cp config/dot_mozconfig $(FIREFOX_DIR)/mozconfig
cd $(FIREFOX_DIR) && make -f client.mk build
- touch build-firefox
+ touch $(STAMP_DIR)/build-firefox
copy-firefox:
-rm -rf $(FETCH_DIR)/Firefox
@@ -242,7 +242,7 @@ generic-bundle: directory-structure \
launcher \
strip-it-stripper \
remove-bundle-shared-lib-symlinks
- touch generic-bundle.stamp
+ touch $(STAMP_DIR)/generic-bundle.stamp
APPDIR=$(DEST)/App
LIBSDIR=$(DEST)/Lib
@@ -363,7 +363,7 @@ compressed-bundle_%:
bundle-localized_%.stamp:
make -f linux.mk copy-files_$* install-extensions install-lang-extensions patch-vidalia-language patch-firefox-language \
patch-pidgin-language update-extension-pref write-tbb-version
- touch bundle-localized_$*.stamp
+ touch $(STAMP_DIR)/bundle-localized_$*.stamp
bundle-localized: bundle-localized_$(LANGCODE).stamp
diff --git a/build-scripts/osx.mk b/build-scripts/osx.mk
index 6e5ae1d..62abe18 100644
--- a/build-scripts/osx.mk
+++ b/build-scripts/osx.mk
@@ -70,7 +70,7 @@ build-zlib: $(ZLIB_DIR)
cd $(ZLIB_DIR) && CFLAGS=$(ZLIB_CFLAGS) ./configure $(ZLIB_OPTS)
cd $(ZLIB_DIR) && make -j $(NUM_CORES)
cd $(ZLIB_DIR) && make install
- touch build-zlib
+ touch $(STAMP_DIR)/build-zlib
OPENSSL_OPTS=-no-rc5 -no-md2 -no-man shared zlib $(BACKWARDS_COMPAT) --prefix=$(BUILT_DIR) --openssldir=$(BUILT_DIR) -L$(BUILT_DIR)/lib -I$(BUILT_DIR)/include
build-openssl: build-zlib $(OPENSSL_DIR)
@@ -86,7 +86,7 @@ endif
# Do not use -j for the following make call, random build errors might happen.
cd $(OPENSSL_DIR) && make
cd $(OPENSSL_DIR) && make install_sw
- touch build-openssl
+ touch $(STAMP_DIR)/build-openssl
QT_BUILD_PREFS=-system-zlib -confirm-license -opensource -openssl-linked -no-qt3support \
@@ -96,7 +96,7 @@ build-qt: build-zlib build-openssl $(QT_DIR)
cd $(QT_DIR) && ./configure $(QT_OPTS)
cd $(QT_DIR) && make -j $(NUM_CORES)
cd $(QT_DIR) && make install
- touch build-qt
+ touch $(STAMP_DIR)/build-qt
VIDALIA_OPTS=-DCMAKE_OSX_ARCHITECTURES=$(ARCH_TYPE) -DQT_QMAKE_EXECUTABLE=$(BUILT_DIR)/bin/qmake \
-DCMAKE_BUILD_TYPE=debug ..
@@ -106,7 +106,7 @@ build-vidalia: build-openssl build-qt $(VIDALIA_DIR)
cd $(VIDALIA_DIR)/build && cmake $(VIDALIA_OPTS) \
&& make -j $(NUM_CORES) && make dist-osx-libraries
cd $(VIDALIA_DIR)/build && DESTDIR=$(BUILT_DIR) make install
- touch build-vidalia
+ touch $(STAMP_DIR)/build-vidalia
LIBEVENT_CFLAGS="-O -g -arch $(ARCH_TYPE) $(MIN_VERSION) $(CF_MIN_VERSION) -arch $(ARCH_TYPE)"
LIBEVENT_LDFLAGS="-L$(BUILT_DIR)/lib $(LD_MIN_VERSION)"
@@ -115,7 +115,7 @@ build-libevent: build-zlib build-openssl $(LIBEVENT_DIR)
cd $(LIBEVENT_DIR) && CFLAGS=$(LIBEVENT_CFLAGS) LDFLAGS=$(LIBEVENT_LDFLAGS) ./configure $(LIBEVENT_OPTS)
cd $(LIBEVENT_DIR) && make -j $(NUM_CORES)
cd $(LIBEVENT_DIR) && make install
- touch build-libevent
+ touch $(STAMP_DIR)/build-libevent
TOR_CFLAGS="-O -g -arch $(ARCH_TYPE) -I$(BUILT_DIR)/include $(MIN_VERSION) $(CF_MIN_VERSION)"
TOR_LDFLAGS="-L$(BUILT_DIR)/lib $(LD_MIN_VERSION)"
@@ -124,12 +124,12 @@ build-tor: build-zlib build-openssl build-libevent $(TOR_DIR)
cd $(TOR_DIR) && CFLAGS=$(TOR_CFLAGS) LDFLAGS=$(TOR_LDFLAGS) ./configure $(TOR_OPTS)
cd $(TOR_DIR) && make -j $(NUM_CORES)
cd $(TOR_DIR) && make install
- touch build-tor
+ touch $(STAMP_DIR)/build-tor
build-firefox: $(FIREFOX_DIR) config/mozconfig-osx-$(ARCH_TYPE)
cp config/mozconfig-osx-$(ARCH_TYPE) $(FIREFOX_DIR)/mozconfig
cd $(FIREFOX_DIR) && make -f client.mk build
- touch build-firefox
+ touch $(STAMP_DIR)/build-firefox
copy-firefox:
-rm -rf $(FETCH_DIR)/Firefox.app
@@ -251,7 +251,7 @@ clean:
generic-bundle.stamp:
make -f osx.mk generic-bundle
generic-bundle: directory-structure install-binaries install-docs install-firefox configure-apps launcher strip-it-stripper
- touch generic-bundle.stamp
+ touch $(STAMP_DIR)/generic-bundle.stamp
APPDIR=$(DEST)/Contents/MacOS
DOCSDIR=$(DEST)/Contents/Resources/Docs
@@ -338,7 +338,7 @@ compressed-bundle_%:
LANGCODE=$* make -f osx.mk compressed-bundle-localized
bundle-localized_%.stamp:
make -f osx.mk copy-files_$* install-extensions install-httpseverywhere install-noscript install-lang-extensions patch-vidalia-language patch-firefox-language patch-pidgin-language update-extension-pref write-tbb-version final
- touch bundle-localized_$*.stamp
+ touch $(STAMP_DIR)/bundle-localized_$*.stamp
bundle-localized: bundle-localized_$(LANGCODE).stamp
diff --git a/build-scripts/versions.mk b/build-scripts/versions.mk
index 58d2df7..92f7acf 100644
--- a/build-scripts/versions.mk
+++ b/build-scripts/versions.mk
@@ -81,6 +81,17 @@ 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
+# 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.
+#
+# http://mad-scientist.net/make/vpath.html
+#
+STAMP_DIR=$(FETCH_DIR)
+vpath build-% $(STAMP_DIR)
+vpath patch-% $(STAMP_DIR)
+vpath %.stamp $(STAMP_DIR)
fetch-source: $(FETCH_DIR)/$(ZLIB_PACKAGE) $(FETCH_DIR)/$(LIBPNG_PACKAGE) $(FETCH_DIR)/$(QT_PACKAGE) $(FETCH_DIR)/$(OPENSSL_PACKAGE) $(FETCH_DIR)/$(VIDALIA_PACKAGE) $(FETCH_DIR)/$(LIBEVENT_PACKAGE) $(FETCH_DIR)/$(TOR_PACKAGE) $(FETCH_DIR)/$(FIREFOX_PACKAGE) | $(FETCH_DIR) ;
diff --git a/build-scripts/windows.mk b/build-scripts/windows.mk
index 524bb66..90282fd 100644
--- a/build-scripts/windows.mk
+++ b/build-scripts/windows.mk
@@ -76,7 +76,7 @@ build-zlib: $(ZLIB_DIR)
cd $(ZLIB_DIR) && sed -i -e "s%prefix = /usr/local%prefix = ${BUILT_DIR}%" win32/Makefile.gcc
cd $(ZLIB_DIR) && LDFLAGS="-Wl,--nxcompat -Wl,--dynamicbase" make -f win32/Makefile.gcc -j $(NUM_CORES)
cd $(ZLIB_DIR) && BINARY_PATH="$(BUILT_DIR)/bin" INCLUDE_PATH="$(BUILT_DIR)/include" LIBRARY_PATH="$(BUILT_DIR)/lib" make -f win32/Makefile.gcc install
- touch build-zlib
+ touch $(STAMP_DIR)/build-zlib
OPENSSL_OPTS=-no-idea -no-rc5 -no-md2 shared zlib --prefix=$(BUILT_DIR) --openssldir=$(BUILT_DIR) -L$(BUILT_DIR)/lib -Wl,--nxcompat -Wl,--dynamicbase -I$(BUILT_DIR)/include
build-openssl: build-zlib $(OPENSSL_DIR)
@@ -84,7 +84,7 @@ build-openssl: build-zlib $(OPENSSL_DIR)
cd $(OPENSSL_DIR) && make depend
cd $(OPENSSL_DIR) && make
cd $(OPENSSL_DIR) && make install_sw
- touch build-openssl
+ touch $(STAMP_DIR)/build-openssl
QT_BUILD_PREFS=-system-zlib -confirm-license -opensource -openssl-linked -no-qt3support -fast -release -nomake demos -nomake examples
QT_OPTS=$(QT_BUILD_PREFS) -prefix $(BUILT_DIR) -I $(BUILT_DIR)/include -I $(BUILT_DIR)/include/openssl/ -L$(BUILT_DIR)/lib
@@ -92,7 +92,7 @@ build-qt: build-zlib build-openssl $(QT_DIR)
cd $(QT_DIR) && ./configure $(QT_OPTS)
cd $(QT_DIR) && make -j $(NUM_CORES)
cd $(QT_DIR) && make install
- touch build-qt
+ touch $(STAMP_DIR)/build-qt
VIDALIA_OPTS=-DCMAKE_EXE_LINKER_FLAGS="-static-libstdc++ -Wl,--nxcompat -Wl,--dynamicbase" -DWIN2K=1 -DQT_MAKE_EXECUTABLE=/c/Qt/$(QT_VER)/bin/qmake -DCMAKE_BUILD_TYPE=minsizerel -DMINGW_BINARY_DIR=$(MING) -DOPENSSL_BINARY_DIR=$(OPENSSL) -DWIX_BINARY_DIR=$(WIX_LIB)
# XXX Once we build qt on windows, we'll want to add build-qt here
@@ -100,7 +100,7 @@ build-vidalia: build-openssl $(VIDALIA_DIR)
-mkdir $(VIDALIA_DIR)/build
cd $(VIDALIA_DIR)/build && cmake -G "MSYS Makefiles" $(VIDALIA_OPTS) ..
cd $(VIDALIA_DIR)/build && make -j $(NUM_CORES)
- touch build-vidalia
+ touch $(STAMP_DIR)/build-vidalia
LIBEVENT_CFLAGS="-I$(BUILT_DIR)/include -O -g"
LIBEVENT_LDFLAGS="-L$(BUILT_DIR)/lib -L$(BUILT_DIR)/bin -Wl,--nxcompat -Wl,--dynamicbase"
@@ -109,7 +109,7 @@ build-libevent: build-zlib build-openssl $(LIBEVENT_DIR)
cd $(LIBEVENT_DIR) && CFLAGS=$(LIBEVENT_CFLAGS) LDFLAGS=$(LIBEVENT_LDFLAGS) ./configure $(LIBEVENT_OPTS)
cd $(LIBEVENT_DIR) && make -j $(NUM_CORES)
cd $(LIBEVENT_DIR) && make install
- touch build-libevent
+ touch $(STAMP_DIR)/build-libevent
TOR_CFLAGS="-O -g -I$(BUILT_DIR)/include"
TOR_LDFLAGS="-L$(BUILT_DIR)/lib -L$(BUILT_DIR)/bin"
@@ -119,12 +119,12 @@ build-tor: build-zlib build-openssl build-libevent $(TOR_DIR)
cd $(TOR_DIR) && CFLAGS=$(TOR_CFLAGS) LDFLAGS=$(TOR_LDFLAGS) ./configure $(TOR_OPTS)
cd $(TOR_DIR) && make -j $(NUM_CORES)
cd $(TOR_DIR) && make install
- touch build-tor
+ touch $(STAMP_DIR)/build-tor
build-firefox: $(FIREFOX_DIR) config/dot_mozconfig $(MOZBUILD_DIR) $(MOZBUILD_DIR)/start-msvc$(MSVC_VER).bat | $(PYTHON) $(PYMAKE_DIR)
cp config/dot_mozconfig $(FIREFOX_DIR)/mozconfig
cd $(MOZBUILD_DIR) && cmd.exe /c "start-msvc$(MSVC_VER).bat $(FIREFOX_DIR) $(PYTHON) $(PYMAKE)"
- touch build-firefox
+ touch $(STAMP_DIR)/build-firefox
copy-firefox:
-rm -rf $(FIREFOX)
@@ -266,7 +266,7 @@ virus-scan: | $(PYTHON)
generic-bundle.stamp:
make -f windows.mk generic-bundle
generic-bundle: directory-structure install-binaries install-docs install-firefoxportable install-pidginportable configure-apps launcher
- touch generic-bundle.stamp
+ touch $(STAMP_DIR)/generic-bundle.stamp
APPDIR=$(DEST)/App
DOCSDIR=$(DEST)/Docs
@@ -364,7 +364,7 @@ split-bundle_%:
bundle-localized_%.stamp:
make -f windows.mk copy-files_$* install-extensions install-torbutton install-httpseverywhere install-noscript \
patch-vidalia-language patch-firefox-language patch-pidgin-language write-tbb-version
- touch bundle-localized_$*.stamp
+ touch $(STAMP_DIR)/bundle-localized_$*.stamp
bundle-localized: bundle-localized_$(LANGCODE).stamp
More information about the tor-commits
mailing list