Commit 5fe6301a6ddac6b3b74e5d9aae9e28f6f264e799

Authored by Masahiro Yamada
Committed by Tom Rini
1 parent 01072b44db

kbuild: generate {spl, tpl}-autoconf.mk only when it is necessary

Before this commit, {spl,tpl}-autoconf.mk was always generated
at the top Makefile even if SPL(TPL) build was not selected.

This commit moves the build rule of {spl,tpl}-autoconf.mk
from the top Makefile to spl/Makefile.
It prevents unnecessary {spl,tpl}-autoconf.mk from being
generated.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

Showing 2 changed files with 16 additions and 23 deletions Side-by-side Diff

... ... @@ -890,9 +890,6 @@
890 890 # Explicitly make _depend in subdirs containing multiple targets to prevent
891 891 # parallel sub-makes creating .depend files simultaneously.
892 892 depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) \
893   - include/spl-autoconf.mk \
894   - include/tpl-autoconf.mk \
895   - include/autoconf.mk \
896 893 include/generated/generic-asm-offsets.h \
897 894 include/generated/asm-offsets.h
898 895  
... ... @@ -973,26 +970,6 @@
973 970  
974 971 include/autoconf.mk: include/config.h
975 972 $(call cmd,autoconf)
976   -
977   -# Auto-generate the spl-autoconf.mk file (which is included by all makefiles for SPL)
978   -quiet_cmd_tpl-autoconf = GEN $@
979   - cmd_tpl-autoconf = \
980   - $(CPP) $(c_flags) -DCONFIG_TPL_BUILD -DCONFIG_SPL_BUILD\
981   - -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \
982   - sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \
983   - rm $@.tmp
984   -
985   -include/tpl-autoconf.mk: include/config.h
986   - $(call cmd,tpl-autoconf)
987   -
988   -quiet_cmd_spl-autoconf = GEN $@
989   - cmd_spl-autoconf = \
990   - $(CPP) $(c_flags) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \
991   - sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \
992   - rm $@.tmp
993   -
994   -include/spl-autoconf.mk: include/config.h
995   - $(call cmd,spl-autoconf)
996 973  
997 974 quiet_cmd_offsets = GEN $@
998 975 cmd_offsets = $(srctree)/tools/scripts/make-asm-offsets $< $@
... ... @@ -50,6 +50,22 @@
50 50  
51 51 include $(TOPDIR)/config.mk
52 52  
  53 +# FIX ME
  54 +c_flags := $(KBUILD_CFLAGS) $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) $(NOSTDINC_FLAGS)
  55 +
  56 +# Auto-generate the spl-autoconf.mk file (which is included by all makefiles for SPL)
  57 +quiet_cmd_autoconf = GEN $@
  58 + cmd_autoconf = \
  59 + $(CPP) $(c_flags) -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \
  60 + sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \
  61 + rm $@.tmp
  62 +
  63 +include/tpl-autoconf.mk: include/config.h
  64 + $(call cmd,autoconf)
  65 +
  66 +include/spl-autoconf.mk: include/config.h
  67 + $(call cmd,autoconf)
  68 +
53 69 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(SRCTREE)/board/$(VENDOR)/common/Makefile),y,n)
54 70  
55 71 ifdef CONFIG_SPL_START_S_PATH