[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [torbrowser/master] Use -j for make where possible
commit 2db2b6b051c79a92164b230bebc74578688f288c
Author: Sebastian Hahn <sebastian@xxxxxxxxxxxxxx>
Date: Fri Feb 3 16:17:14 2012 +0100
Use -j for make where possible
---
build-scripts/linux.mk | 14 +++++++++-----
build-scripts/osx.mk | 15 ++++++++++-----
build-scripts/windows.mk | 12 ++++++++----
3 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/build-scripts/linux.mk b/build-scripts/linux.mk
index 51d6af7..2131276 100644
--- a/build-scripts/linux.mk
+++ b/build-scripts/linux.mk
@@ -39,6 +39,10 @@ ARCH_TYPE=$(shell uname -m)
BUILD_NUM=7.2
PLATFORM=Linux
+## Build machine specific settings
+# 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 prefix/destdir/compiles/etc
@@ -52,7 +56,7 @@ ZLIB_DIR=$(FETCH_DIR)/zlib-$(ZLIB_VER)
ZLIB_OPTS=--shared --prefix=$(BUILT_DIR)
build-zlib:
cd $(ZLIB_DIR) && ./configure $(ZLIB_OPTS)
- cd $(ZLIB_DIR) && make
+ cd $(ZLIB_DIR) && make -j $(NUM_CORES)
cd $(ZLIB_DIR) && make install
OPENSSL_DIR=$(FETCH_DIR)/openssl-$(OPENSSL_VER)
@@ -68,21 +72,21 @@ QT_BUILD_PREFS=-system-zlib -confirm-license -opensource -openssl-linked -no-qt3
QT_OPTS=$(QT_BUILD_PREFS) -prefix $(BUILT_DIR) -I $(BUILT_DIR)/include -I $(BUILT_DIR)/include/openssl/ -L$(BUILT_DIR)/lib
build-qt:
cd $(QT_DIR) && ./configure $(QT_OPTS)
- cd $(QT_DIR) && make
+ cd $(QT_DIR) && make -j $(NUM_CORES)
cd $(QT_DIR) && make install
VIDALIA_DIR=$(FETCH_DIR)/vidalia-$(VIDALIA_VER)
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:
-mkdir $(VIDALIA_DIR)/build
- cd $(VIDALIA_DIR)/build && cmake $(VIDALIA_OPTS) && make
+ cd $(VIDALIA_DIR)/build && cmake $(VIDALIA_OPTS) && make -j $(NUM_CORES)
cd $(VIDALIA_DIR)/build && DESTDIR=$(BUILT_DIR) make install
LIBEVENT_DIR=$(FETCH_DIR)/libevent-$(LIBEVENT_VER)
LIBEVENT_OPTS=--prefix=$(BUILT_DIR)
build-libevent:
cd $(LIBEVENT_DIR) && ./configure $(LIBEVENT_OPTS)
- cd $(LIBEVENT_DIR) && make -j2
+ cd $(LIBEVENT_DIR) && make -j $(NUM_CORES)
cd $(LIBEVENT_DIR) && make install
LIBPNG_DIR=$(FETCH_DIR)/libpng-$(LIBPNG_VER)
@@ -96,7 +100,7 @@ TOR_DIR=$(FETCH_DIR)/tor-$(TOR_VER)
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:
cd $(TOR_DIR) && ./configure $(TOR_OPTS)
- cd $(TOR_DIR) && make -j2
+ cd $(TOR_DIR) && make -j $(NUM_CORES)
cd $(TOR_DIR) && make install
## Polipo doesn't use autoconf, so we just have to hack their Makefile
diff --git a/build-scripts/osx.mk b/build-scripts/osx.mk
index 20ea849..e77d85e 100644
--- a/build-scripts/osx.mk
+++ b/build-scripts/osx.mk
@@ -50,6 +50,10 @@ CF_MIN_VERSION=-isysroot $(SDK_PATH)
LD_MIN_VERSION=-Wl,-syslibroot,$(SDK_PATH)
BACKWARDS_COMPAT=$(MIN_VERSION) $(CF_MIN_VERSION) $(LD_MIN_VERSION)
+## Build machine specific settings
+# 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 prefix/destdir/compiles/etc
@@ -64,7 +68,7 @@ ZLIB_OPTS=--prefix=$(BUILT_DIR)
ZLIB_CFLAGS="-arch $(ARCH_TYPE)"
build-zlib:
cd $(ZLIB_DIR) && CFLAGS=$(ZLIB_CFLAGS) ./configure $(ZLIB_OPTS)
- cd $(ZLIB_DIR) && make
+ cd $(ZLIB_DIR) && make -j $(NUM_CORES)
cd $(ZLIB_DIR) && make install
OPENSSL_DIR=$(FETCH_DIR)/openssl-$(OPENSSL_VER)
@@ -79,6 +83,7 @@ else
cd $(OPENSSL_DIR) && ./Configure darwin-i386-cc $(OPENSSL_OPTS)
endif
cd $(OPENSSL_DIR) && make depend
+# Do not use -j for the following make call, random build errors might happen.
cd $(OPENSSL_DIR) && make
cd $(OPENSSL_DIR) && make install
@@ -88,7 +93,7 @@ QT_BUILD_PREFS=-system-zlib -confirm-license -opensource -openssl-linked -no-qt3
QT_OPTS=$(QT_BUILD_PREFS) -prefix $(BUILT_DIR) -I $(BUILT_DIR)/include -I $(BUILT_DIR)/include/openssl/ -L $(BUILT_DIR)/lib
build-qt:
cd $(QT_DIR) && ./configure $(QT_OPTS)
- cd $(QT_DIR) && make -j2
+ cd $(QT_DIR) && make -j $(NUM_CORES)
cd $(QT_DIR) && make install
VIDALIA_DIR=$(FETCH_DIR)/vidalia-$(VIDALIA_VER)
@@ -98,7 +103,7 @@ build-vidalia:
export MACOSX_DEPLOYMENT_TARGET=$(OSX_VERSION)
-mkdir $(VIDALIA_DIR)/build
cd $(VIDALIA_DIR)/build && cmake $(VIDALIA_OPTS) \
- && make && make dist-osx-libraries
+ && make -j $(NUM_CORES) && make dist-osx-libraries
cd $(VIDALIA_DIR)/build && DESTDIR=$(BUILT_DIR) make install
LIBEVENT_DIR=$(FETCH_DIR)/libevent-$(LIBEVENT_VER)
@@ -107,7 +112,7 @@ LIBEVENT_LDFLAGS="-L$(BUILT_DIR)/lib $(LD_MIN_VERSION)"
LIBEVENT_OPTS=--prefix=$(BUILT_DIR) --enable-static --disable-shared --disable-dependency-tracking $(CC)
build-libevent:
cd $(LIBEVENT_DIR) && CFLAGS=$(LIBEVENT_CFLAGS) LDFLAGS=$(LIBEVENT_LDFLAGS) ./configure $(LIBEVENT_OPTS)
- cd $(LIBEVENT_DIR) && make -j2
+ cd $(LIBEVENT_DIR) && make -j $(NUM_CORES)
cd $(LIBEVENT_DIR) && make install
TOR_DIR=$(FETCH_DIR)/tor-$(TOR_VER)
@@ -116,7 +121,7 @@ TOR_LDFLAGS="-L$(BUILT_DIR)/lib $(LD_MIN_VERSION)"
TOR_OPTS=--enable-static-openssl --enable-static-libevent --with-openssl-dir=$(BUILT_DIR)/lib --with-libevent-dir=$(BUILT_DIR)/lib --prefix=$(BUILT_DIR) --disable-dependency-tracking $(CC)
build-tor:
cd $(TOR_DIR) && CFLAGS=$(TOR_CFLAGS) LDFLAGS=$(TOR_LDFLAGS) ./configure $(TOR_OPTS)
- cd $(TOR_DIR) && make
+ cd $(TOR_DIR) && make -j $(NUM_CORES)
cd $(TOR_DIR) && make install
FIREFOX_DIR=$(FETCH_DIR)/mozilla-release
diff --git a/build-scripts/windows.mk b/build-scripts/windows.mk
index 8feb6f9..52d93ed 100644
--- a/build-scripts/windows.mk
+++ b/build-scripts/windows.mk
@@ -60,6 +60,10 @@ MSVC_VER=9
FIREFOX_DIR=/c/build/mozilla-build/mozilla-release
MOZ_BUILD=/c/build/mozilla-build
+## Build machine specific settings
+# Number of cpu cores used to build in parallel
+NUM_CORES=2
+
## Location of directory for source unpacking
FETCH_DIR=$(PWD)/build-alpha-windows
## Location of directory for prefix/destdir/compiles/etc
@@ -72,7 +76,7 @@ source-dance: fetch-source unpack-source
ZLIB_DIR=$(FETCH_DIR)/zlib-$(ZLIB_VER)
build-zlib:
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
+ 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
OPENSSL_DIR=$(FETCH_DIR)/openssl-$(OPENSSL_VER)
@@ -88,7 +92,7 @@ VIDALIA_OPTS=-DCMAKE_EXE_LINKER_FLAGS="-static-libstdc++ -Wl,--nxcompat -Wl,--dy
build-vidalia:
-mkdir $(VIDALIA_DIR)/build
cd $(VIDALIA_DIR)/build && cmake -G "MSYS Makefiles" $(VIDALIA_OPTS) ..
- cd $(VIDALIA_DIR)/build && make
+ cd $(VIDALIA_DIR)/build && make -j $(NUM_CORES)
LIBEVENT_DIR=$(FETCH_DIR)/libevent-$(LIBEVENT_VER)
LIBEVENT_CFLAGS="-I$(BUILT_DIR)/include -O -g"
@@ -96,7 +100,7 @@ LIBEVENT_LDFLAGS="-L$(BUILT_DIR)/lib -L$(BUILT_DIR)/bin -Wl,--nxcompat -Wl,--dyn
LIBEVENT_OPTS=--prefix=$(BUILT_DIR) --enable-static --disable-shared --disable-dependency-tracking
build-libevent:
cd $(LIBEVENT_DIR) && CFLAGS=$(LIBEVENT_CFLAGS) LDFLAGS=$(LIBEVENT_LDFLAGS) ./configure $(LIBEVENT_OPTS)
- cd $(LIBEVENT_DIR) && make -j2
+ cd $(LIBEVENT_DIR) && make -j $(NUM_CORES)
cd $(LIBEVENT_DIR) && make install
TOR_DIR=$(FETCH_DIR)/tor-$(TOR_VER)
@@ -106,7 +110,7 @@ TOR_OPTS=--enable-static-libevent --with-libevent-dir=$(BUILT_DIR)/lib --prefix=
build-tor:PATH+=:$(BUILT_DIR)/bin
build-tor:
cd $(TOR_DIR) && CFLAGS=$(TOR_CFLAGS) LDFLAGS=$(TOR_LDFLAGS) ./configure $(TOR_OPTS)
- cd $(TOR_DIR) && make
+ cd $(TOR_DIR) && make -j $(NUM_CORES)
cd $(TOR_DIR) && make install
patch-mozbuild:
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits