From a899b909abe14e8e35a81997c828201d1beaff78 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 27 Nov 2011 00:15:07 -0500 Subject: buildsys: cache build flags in vars Running `make clean` atm takes like 20 seconds because every subdir re-evaluates all the toolchain flags. Add some helpers to automate the process of setting up variables to cache the result of tests, as well as the checking of an already set flag. Now `make clean` takes like 2 seconds on my system. Signed-off-by: Mike Frysinger --- Makerules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Makerules') diff --git a/Makerules b/Makerules index 110ba3968..6954b94cf 100644 --- a/Makerules +++ b/Makerules @@ -308,7 +308,7 @@ define link.so @$(disp_ld) $(Q)$(CC) $(LDFLAGS-$(notdir $@)) $(LDFLAGS-y-$(@F)) \ -Wl,-soname=$(notdir $@).$(2) \ - $(NOSTDLIB_CFLAGS) -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \ + $(CFLAG_-nostdlib) -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \ -Wl,--whole-archive $(firstword $^) -Wl,--no-whole-archive \ $(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@)) $(Q)$(LN) -sf $(1) $@.$(2) @@ -333,7 +333,7 @@ LINK_FLAT_CRTS := $(top_builddir)lib/Scrt1.o $(top_builddir)lib/crti.o \ define link-flat.so $(Q)$(RM) $(1) $@ @$(disp_ld) - $(Q)$(CC) $(LDFLAGS-$(notdir $@)) $(NOSTDLIB_CFLAGS) -o $(1) \ + $(Q)$(CC) $(LDFLAGS-$(notdir $@)) $(CFLAG_-nostdlib) -o $(1) \ -Wl,-elf2flt -Wl,-shared-lib-id,$(2) $(top_builddir)lib/Scrt1.o \ $(top_builddir)/lib/crti.o -Wl,--whole-archive $(firstword $^) \ $(LIBGCC) -Wl,--no-whole-archive $(LIBS-$(notdir $@)) $(LIBGCC) \ @@ -345,7 +345,7 @@ define linkm.so $(do_strip) @$(disp_ld) $(Q)$(CC) $(LDFLAGS-$(notdir $@)) -Wl,-soname=$(notdir $@).$(2) \ - $(NOSTDLIB_CFLAGS) -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \ + $(CFLAG_-nostdlib) -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \ $^ \ $(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@)) $(Q)$(LN) -sf $(1) $@.$(2) -- cgit v1.2.3