diff cross-compiler.sh @ 182:fc827ab6166f

Autodetect number of processors and feed appropriate -j to make.
author Rob Landley <rob@landley.net>
date Tue, 26 Jun 2007 17:51:14 -0400
parents 6fd189c18c1c
children d2a27709d3b6
line wrap: on
line diff
--- a/cross-compiler.sh	Tue Jun 26 09:44:23 2007 -0400
+++ b/cross-compiler.sh	Tue Jun 26 17:51:14 2007 -0400
@@ -21,7 +21,7 @@
 	--disable-shared --disable-multilib --program-prefix="${ARCH}-" \
 	$BINUTILS_FLAGS &&
 make configure-host &&
-make &&
+make -j $CPUS &&
 make install &&
 cd .. &&
 mkdir -p "${CROSS}/include" &&
@@ -37,7 +37,7 @@
 	--prefix="${CROSS}" --host=${CROSS_HOST} --target=${CROSS_TARGET} \
 	--enable-languages=c --disable-threads --disable-multilib \
 	--disable-nls --disable-shared --program-prefix="${ARCH}-" &&
-make all-gcc &&
+make -j CPUS all-gcc &&
 make install-gcc &&
 cd .. &&
 
@@ -72,7 +72,7 @@
 
 setupfor linux
 # Install Linux kernel headers (for use by uClibc).
-make headers_install ARCH="${KARCH}" INSTALL_HDR_PATH="${CROSS}" &&
+make -j $CPUS headers_install ARCH="${KARCH}" INSTALL_HDR_PATH="${CROSS}" &&
 cd .. &&
 $CLEANUP linux-*
 
@@ -83,7 +83,8 @@
 setupfor uClibc
 make CROSS= allnoconfig KCONFIG_ALLCONFIG="${WORK}"/miniconfig-uClibc &&
 make CROSS="${ARCH}-" KERNEL_HEADERS="${CROSS}/include" PREFIX="${CROSS}/" \
-	RUNTIME_PREFIX=/ DEVEL_PREFIX=/ all install_runtime install_dev &&
+	RUNTIME_PREFIX=/ DEVEL_PREFIX=/ -j $CPUS all install_runtime \
+	install_dev &&
 # "make utils" in uClibc is broken for cross compiling.  Either it creates a
 # target binary (which you can't run on the host), or it tries to link the
 # host binary against the target library, and use the target compiler flags