summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@coresystems.de>2010-04-21 06:36:20 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2010-04-21 06:36:20 +0000
commitcf036d1266d7ec307aac437105b094acbc9681ec (patch)
tree1a114368e8c1122e143dcc8cfaf3abf361b253a3
parentca3548e79fd9005d9e9a5694b438bedd87e70560 (diff)
Optimize distclean and configuration.
Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5470 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r--Makefile21
1 files changed, 16 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index cdbba2b4f9..f83804523b 100644
--- a/Makefile
+++ b/Makefile
@@ -69,8 +69,21 @@ LIBGCC_FILE_NAME := $(shell test -r `$(CC) -print-libgcc-file-name` && $(CC) -pr
DOXYGEN := doxygen
DOXYGEN_OUTPUT_DIR := doxygen
+# Three cases where we don't need fully populated $(obj) lists:
+# 1. when no .config exists
+# 2. when make config (in any flavour) is run
+# 3. when make distclean is run
+# Don't waste time on reading all Makefile.incs in these cases
ifeq ($(strip $(HAVE_DOTCONFIG)),)
+NOCOMPILE:=1
+endif
+ifneq ($(MAKECMDGOALS),)
+ifneq ($(filter %config distclean,$(MAKECMDGOALS)),)
+NOCOMPILE:=1
+endif
+endif
+ifeq ($(NOCOMPILE),1)
all: config
else
@@ -294,9 +307,7 @@ coreboot: prepare $(obj)/coreboot.rom
endif
prepare:
- mkdir -p $(obj)
- mkdir -p $(objutil)/kconfig/lxdialog $(objutil)/cbfstool $(objutil)/romcc $(objutil)/options
- test -n "$(alldirs)" && mkdir -p $(alldirs) || true
+ mkdir -p $(obj) $(objutil)/kconfig/lxdialog $(objutil)/cbfstool $(objutil)/romcc $(objutil)/options $(alldirs)
$(obj)/build.h: .xcompile
@printf " GEN build.h\n"
@@ -342,9 +353,9 @@ clean-for-update: doxygen-clean
clean: clean-for-update
rm -f $(obj)/coreboot* .ccwrap
-distclean: clean
+distclean:
rm -rf $(obj)
- rm -f .config .config.old ..config.tmp .kconfig.d .tmpconfig*
+ rm -f .config .config.old ..config.tmp .kconfig.d .tmpconfig* .ccwrap .xcompile
update:
dongle.py -c /dev/term/1 $(obj)/coreboot.rom EOF