From 5fe6301a6ddac6b3b74e5d9aae9e28f6f264e799 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 4 Feb 2014 17:24:33 +0900 Subject: 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 --- spl/Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'spl/Makefile') diff --git a/spl/Makefile b/spl/Makefile index 13612d3f8a..25f99212f3 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -50,6 +50,22 @@ endif include $(TOPDIR)/config.mk +# FIX ME +c_flags := $(KBUILD_CFLAGS) $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) $(NOSTDINC_FLAGS) + +# Auto-generate the spl-autoconf.mk file (which is included by all makefiles for SPL) +quiet_cmd_autoconf = GEN $@ + cmd_autoconf = \ + $(CPP) $(c_flags) -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \ + sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \ + rm $@.tmp + +include/tpl-autoconf.mk: include/config.h + $(call cmd,autoconf) + +include/spl-autoconf.mk: include/config.h + $(call cmd,autoconf) + HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(SRCTREE)/board/$(VENDOR)/common/Makefile),y,n) ifdef CONFIG_SPL_START_S_PATH -- cgit v1.2.1