summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley2005-07-28 19:38:52 +0000
committerRob Landley2005-07-28 19:38:52 +0000
commit088ee4134b7e912ec79d927c6cf157b2bccedf98 (patch)
tree3840ac77ae5abb717763426cbce8a212095c3bf3
parentef8f423e908c74e5de49b8dbe02730815f275bfa (diff)
downloadbusybox-088ee4134b7e912ec79d927c6cf157b2bccedf98.zip
busybox-088ee4134b7e912ec79d927c6cf157b2bccedf98.tar.gz
From Rich Paul:
I've noticed that when I compile busybox on my laptop, it compiles more slowly than one would expect, and although it's a (more-or-less) multiprocessor system and I use -j5, make never seems to run more than one job at a time. I believe I have found the culprit:  each time a file is compiled, gcc runs about 5 times.  This is because the $(check_gcc) macros and the TARGET_ARCH macros are late binding. The attached patch cuts the compilation time by 66%, from 1.5 minutes to 30 seconds.  Your mileage may very.  These statements have not been evaluated by the FDA.
-rw-r--r--Rules.mak5
1 files changed, 2 insertions, 3 deletions
diff --git a/Rules.mak b/Rules.mak
index 6a2e17a..ec03ce0 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -86,7 +86,7 @@ ARFLAGS=cru
#--------------------------------------------------------
export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP
ifeq ($(strip $(TARGET_ARCH)),)
-TARGET_ARCH=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \
+TARGET_ARCH:=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \
-e 's/i.86/i386/' \
-e 's/sparc.*/sparc/' \
-e 's/arm.*/arm/g' \
@@ -115,8 +115,7 @@ check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1;
# for OPTIMIZATION...
# use '-Os' optimization if available, else use -O2
-OPTIMIZATION=
-OPTIMIZATION=${call check_gcc,-Os,-O2}
+OPTIMIZATION:=${call check_gcc,-Os,-O2}
# Some nice architecture specific optimizations
ifeq ($(strip $(TARGET_ARCH)),arm)