diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-07-28 19:38:52 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-07-28 19:38:52 +0000 |
commit | c7444d704193ba89f522d4e0ce8e5933beec793d (patch) | |
tree | 3840ac77ae5abb717763426cbce8a212095c3bf3 | |
parent | dbcb8958266ccf757d5c29db0cade9c702f944de (diff) | |
download | busybox-w32-c7444d704193ba89f522d4e0ce8e5933beec793d.tar.gz busybox-w32-c7444d704193ba89f522d4e0ce8e5933beec793d.tar.bz2 busybox-w32-c7444d704193ba89f522d4e0ce8e5933beec793d.zip |
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.
git-svn-id: svn://busybox.net/trunk/busybox@10945 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | Rules.mak | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -86,7 +86,7 @@ ARFLAGS=cru | |||
86 | #-------------------------------------------------------- | 86 | #-------------------------------------------------------- |
87 | export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP | 87 | export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP |
88 | ifeq ($(strip $(TARGET_ARCH)),) | 88 | ifeq ($(strip $(TARGET_ARCH)),) |
89 | TARGET_ARCH=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \ | 89 | TARGET_ARCH:=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \ |
90 | -e 's/i.86/i386/' \ | 90 | -e 's/i.86/i386/' \ |
91 | -e 's/sparc.*/sparc/' \ | 91 | -e 's/sparc.*/sparc/' \ |
92 | -e 's/arm.*/arm/g' \ | 92 | -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; | |||
115 | # for OPTIMIZATION... | 115 | # for OPTIMIZATION... |
116 | 116 | ||
117 | # use '-Os' optimization if available, else use -O2 | 117 | # use '-Os' optimization if available, else use -O2 |
118 | OPTIMIZATION= | 118 | OPTIMIZATION:=${call check_gcc,-Os,-O2} |
119 | OPTIMIZATION=${call check_gcc,-Os,-O2} | ||
120 | 119 | ||
121 | # Some nice architecture specific optimizations | 120 | # Some nice architecture specific optimizations |
122 | ifeq ($(strip $(TARGET_ARCH)),arm) | 121 | ifeq ($(strip $(TARGET_ARCH)),arm) |