From patchwork Fri Jan 10 06:44:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 309143 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 6CBC12C00AC for ; Fri, 10 Jan 2014 17:51:08 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BA55D4AED6; Fri, 10 Jan 2014 07:50:41 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id swq7JOjW5PBZ; Fri, 10 Jan 2014 07:50:41 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C51A74AEC2; Fri, 10 Jan 2014 07:46:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DEF424ACD6 for ; Fri, 10 Jan 2014 07:45:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9FYAwU7tl1lh for ; Fri, 10 Jan 2014 07:45:37 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by theia.denx.de (Postfix) with ESMTP id 1C3B84AC53 for ; Fri, 10 Jan 2014 07:44:47 +0100 (CET) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile13) with ESMTP id s0A6iiiH011727; Fri, 10 Jan 2014 15:44:44 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili14) with ESMTP id s0A6iiL28798; Fri, 10 Jan 2014 15:44:44 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi17) id s0A6iiLx002440; Fri, 10 Jan 2014 15:44:44 +0900 Received: from poodle by lomi17.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id s0A6iixn002393; Fri, 10 Jan 2014 15:44:44 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 388002740043; Fri, 10 Jan 2014 15:44:44 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Fri, 10 Jan 2014 15:44:21 +0900 Message-Id: <1389336274-7234-25-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1389336274-7234-1-git-send-email-yamada.m@jp.panasonic.com> References: <1389336274-7234-1-git-send-email-yamada.m@jp.panasonic.com> Cc: Tom Rini Subject: [U-Boot] [PATCH v4 24/37] kbuild: convert some make rules to Kbuild style X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de We can get Kbuild-ish log style like this: GEN include/autoconf.mk GEN include/autoconf.mk.dep We do not need XECHO any more. And also change checkstack target like Linux Kernel. Signed-off-by: Masahiro Yamada --- Changes in v4: - Change checkstack target Changes in v3: None Changes in v2: None Makefile | 77 ++++++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 43 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index 0bd85dc..393aa0b 100644 --- a/Makefile +++ b/Makefile @@ -201,12 +201,6 @@ export HOSTARCH HOSTOS VENDOR= ######################################################################### -# Allow for silent builds -ifeq (,$(findstring s,$(MAKEFLAGS))) -XECHO = echo -else -XECHO = : -endif # The "tools" are needed early, so put this first # Don't include stuff already done in $(LIBS) @@ -881,10 +875,11 @@ TAG_SUBDIRS += include FIND := find FINDFLAGS := -L +PHONY += checkstack + checkstack: - $(CROSS_COMPILE)objdump -d u-boot \ - `$(FIND) . -name u-boot-spl -print` | \ - perl $(src)/scripts/checkstack.pl $(ARCH) + $(OBJDUMP) -d u-boot $$(find . -name u-boot-spl) | \ + $(PERL) $(src)/scripts/checkstack.pl $(ARCH) tags ctags: ctags -w -o ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \ @@ -934,52 +929,63 @@ checkdtc: # This target actually generates 2 files; autoconf.mk and autoconf.mk.dep. # the dep file is only include in this top level makefile to determine when # to regenerate the autoconf.mk file. + +quiet_cmd_autoconf_dep = GEN $@ + cmd_autoconf_dep = $(CC) -x c -DDO_DEPS_ONLY -M $(c_flags) \ + -MQ include/autoconf.mk $(srctree)/include/common.h > $@ || rm $@ + include/autoconf.mk.dep: include/config.h include/common.h - @$(XECHO) Generating $@ ; \ - : Generate the dependancies ; \ - $(CC) -x c -DDO_DEPS_ONLY -M $(c_flags) \ - -MQ include/autoconf.mk $(srctree)/include/common.h > $@ || \ - rm $@ + $(call cmd,autoconf_dep) -include/autoconf.mk: include/config.h - @$(XECHO) Generating $@ ; \ - : Extract the config macros ; \ +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 > $@; \ + sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \ rm $@.tmp +include/autoconf.mk: include/config.h + $(call cmd,autoconf) + # Auto-generate the spl-autoconf.mk file (which is included by all makefiles for SPL) -include/tpl-autoconf.mk: include/config.h - @$(XECHO) Generating $@ ; \ - : Extract the config macros ; \ +quiet_cmd_tpl-autoconf = GEN $@ + cmd_tpl-autoconf = \ $(CPP) $(c_flags) -DCONFIG_TPL_BUILD -DCONFIG_SPL_BUILD\ -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \ sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \ rm $@.tmp -include/spl-autoconf.mk: include/config.h - @$(XECHO) Generating $@ ; \ - : Extract the config macros ; \ +include/tpl-autoconf.mk: include/config.h + $(call cmd,tpl-autoconf) + +quiet_cmd_spl-autoconf = GEN $@ + cmd_spl-autoconf = \ $(CPP) $(c_flags) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \ sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \ rm $@.tmp +include/spl-autoconf.mk: include/config.h + $(call cmd,spl-autoconf) + +quiet_cmd_offsets = GEN $@ + cmd_offsets = $(srctree)/tools/scripts/make-asm-offsets $< $@ + include/generated/generic-asm-offsets.h: lib/asm-offsets.s - @$(XECHO) Generating $@ - $(srctree)/tools/scripts/make-asm-offsets lib/asm-offsets.s $@ + $(call cmd,offsets) -lib/asm-offsets.s: include/config.h $(srctree)/lib/asm-offsets.c - @mkdir -p lib - $(CC) -DDO_DEPS_ONLY \ +quiet_cmd_asm-offsets.s = CC $@ + cmd_asm-offsets.s = mkdir -p lib; \ + $(CC) -DDO_DEPS_ONLY \ $(c_flags) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \ - -o $@ $(srctree)/lib/asm-offsets.c -c -S + -o $@ $< -c -S + +lib/asm-offsets.s: $(srctree)/lib/asm-offsets.c include/config.h + $(call cmd,asm-offsets.s) include/generated/asm-offsets.h: $(CPUDIR)/$(SOC)/asm-offsets.s - @$(XECHO) Generating $@ - $(srctree)/tools/scripts/make-asm-offsets $(CPUDIR)/$(SOC)/asm-offsets.s $@ + $(call cmd,offsets) -$(CPUDIR)/$(SOC)/asm-offsets.s: include/config.h - @mkdir -p $(CPUDIR)/$(SOC) +quiet_cmd_soc_asm-offsets.s = CC $@ + cmd_soc_asm-offsets.s = mkdir -p $(CPUDIR)/$(SOC); \ if [ -f $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c ];then \ $(CC) -DDO_DEPS_ONLY \ $(c_flags) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \ @@ -988,6 +994,9 @@ $(CPUDIR)/$(SOC)/asm-offsets.s: include/config.h touch $@; \ fi +$(CPUDIR)/$(SOC)/asm-offsets.s: include/config.h + $(call cmd,soc_asm-offsets.s) + ######################################################################### else # !config.mk all u-boot.hex u-boot.srec u-boot.bin \