Commit 47f1571115d92164afe309383ae7989e7076394c
Committed by
Tom Rini
1 parent
5f30f3be73
Exists in
master
and in
49 other branches
kbuild: convert some make rules to Kbuild style
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 <yamada.m@jp.panasonic.com>
Showing 1 changed file with 43 additions and 34 deletions Side-by-side Diff
Makefile
... | ... | @@ -202,12 +202,6 @@ |
202 | 202 | VENDOR= |
203 | 203 | |
204 | 204 | ######################################################################### |
205 | -# Allow for silent builds | |
206 | -ifeq (,$(findstring s,$(MAKEFLAGS))) | |
207 | -XECHO = echo | |
208 | -else | |
209 | -XECHO = : | |
210 | -endif | |
211 | 205 | |
212 | 206 | # The "tools" are needed early, so put this first |
213 | 207 | # Don't include stuff already done in $(LIBS) |
214 | 208 | |
... | ... | @@ -909,10 +903,11 @@ |
909 | 903 | FIND := find |
910 | 904 | FINDFLAGS := -L |
911 | 905 | |
906 | +PHONY += checkstack | |
907 | + | |
912 | 908 | checkstack: |
913 | - $(CROSS_COMPILE)objdump -d u-boot \ | |
914 | - `$(FIND) . -name u-boot-spl -print` | \ | |
915 | - perl $(src)/scripts/checkstack.pl $(ARCH) | |
909 | + $(OBJDUMP) -d u-boot $$(find . -name u-boot-spl) | \ | |
910 | + $(PERL) $(src)/scripts/checkstack.pl $(ARCH) | |
916 | 911 | |
917 | 912 | tags ctags: |
918 | 913 | ctags -w -o ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \ |
919 | 914 | |
920 | 915 | |
921 | 916 | |
922 | 917 | |
923 | 918 | |
924 | 919 | |
925 | 920 | |
926 | 921 | |
927 | 922 | |
928 | 923 | |
929 | 924 | |
930 | 925 | |
931 | 926 | |
... | ... | @@ -962,52 +957,63 @@ |
962 | 957 | # This target actually generates 2 files; autoconf.mk and autoconf.mk.dep. |
963 | 958 | # the dep file is only include in this top level makefile to determine when |
964 | 959 | # to regenerate the autoconf.mk file. |
960 | + | |
961 | +quiet_cmd_autoconf_dep = GEN $@ | |
962 | + cmd_autoconf_dep = $(CC) -x c -DDO_DEPS_ONLY -M $(c_flags) \ | |
963 | + -MQ include/autoconf.mk $(srctree)/include/common.h > $@ || rm $@ | |
964 | + | |
965 | 965 | include/autoconf.mk.dep: include/config.h include/common.h |
966 | - @$(XECHO) Generating $@ ; \ | |
967 | - : Generate the dependancies ; \ | |
968 | - $(CC) -x c -DDO_DEPS_ONLY -M $(c_flags) \ | |
969 | - -MQ include/autoconf.mk $(srctree)/include/common.h > $@ || \ | |
970 | - rm $@ | |
966 | + $(call cmd,autoconf_dep) | |
971 | 967 | |
972 | -include/autoconf.mk: include/config.h | |
973 | - @$(XECHO) Generating $@ ; \ | |
974 | - : Extract the config macros ; \ | |
968 | +quiet_cmd_autoconf = GEN $@ | |
969 | + cmd_autoconf = \ | |
975 | 970 | $(CPP) $(c_flags) -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \ |
976 | - sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \ | |
971 | + sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \ | |
977 | 972 | rm $@.tmp |
978 | 973 | |
974 | +include/autoconf.mk: include/config.h | |
975 | + $(call cmd,autoconf) | |
976 | + | |
979 | 977 | # Auto-generate the spl-autoconf.mk file (which is included by all makefiles for SPL) |
980 | -include/tpl-autoconf.mk: include/config.h | |
981 | - @$(XECHO) Generating $@ ; \ | |
982 | - : Extract the config macros ; \ | |
978 | +quiet_cmd_tpl-autoconf = GEN $@ | |
979 | + cmd_tpl-autoconf = \ | |
983 | 980 | $(CPP) $(c_flags) -DCONFIG_TPL_BUILD -DCONFIG_SPL_BUILD\ |
984 | 981 | -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \ |
985 | 982 | sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \ |
986 | 983 | rm $@.tmp |
987 | 984 | |
988 | -include/spl-autoconf.mk: include/config.h | |
989 | - @$(XECHO) Generating $@ ; \ | |
990 | - : Extract the config macros ; \ | |
985 | +include/tpl-autoconf.mk: include/config.h | |
986 | + $(call cmd,tpl-autoconf) | |
987 | + | |
988 | +quiet_cmd_spl-autoconf = GEN $@ | |
989 | + cmd_spl-autoconf = \ | |
991 | 990 | $(CPP) $(c_flags) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && \ |
992 | 991 | sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp > $@; \ |
993 | 992 | rm $@.tmp |
994 | 993 | |
994 | +include/spl-autoconf.mk: include/config.h | |
995 | + $(call cmd,spl-autoconf) | |
996 | + | |
997 | +quiet_cmd_offsets = GEN $@ | |
998 | + cmd_offsets = $(srctree)/tools/scripts/make-asm-offsets $< $@ | |
999 | + | |
995 | 1000 | include/generated/generic-asm-offsets.h: lib/asm-offsets.s |
996 | - @$(XECHO) Generating $@ | |
997 | - $(srctree)/tools/scripts/make-asm-offsets lib/asm-offsets.s $@ | |
1001 | + $(call cmd,offsets) | |
998 | 1002 | |
999 | -lib/asm-offsets.s: include/config.h $(srctree)/lib/asm-offsets.c | |
1000 | - @mkdir -p lib | |
1001 | - $(CC) -DDO_DEPS_ONLY \ | |
1003 | +quiet_cmd_asm-offsets.s = CC $@ | |
1004 | + cmd_asm-offsets.s = mkdir -p lib; \ | |
1005 | + $(CC) -DDO_DEPS_ONLY \ | |
1002 | 1006 | $(c_flags) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \ |
1003 | - -o $@ $(srctree)/lib/asm-offsets.c -c -S | |
1007 | + -o $@ $< -c -S | |
1004 | 1008 | |
1009 | +lib/asm-offsets.s: $(srctree)/lib/asm-offsets.c include/config.h | |
1010 | + $(call cmd,asm-offsets.s) | |
1011 | + | |
1005 | 1012 | include/generated/asm-offsets.h: $(CPUDIR)/$(SOC)/asm-offsets.s |
1006 | - @$(XECHO) Generating $@ | |
1007 | - $(srctree)/tools/scripts/make-asm-offsets $(CPUDIR)/$(SOC)/asm-offsets.s $@ | |
1013 | + $(call cmd,offsets) | |
1008 | 1014 | |
1009 | -$(CPUDIR)/$(SOC)/asm-offsets.s: include/config.h | |
1010 | - @mkdir -p $(CPUDIR)/$(SOC) | |
1015 | +quiet_cmd_soc_asm-offsets.s = CC $@ | |
1016 | + cmd_soc_asm-offsets.s = mkdir -p $(CPUDIR)/$(SOC); \ | |
1011 | 1017 | if [ -f $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c ];then \ |
1012 | 1018 | $(CC) -DDO_DEPS_ONLY \ |
1013 | 1019 | $(c_flags) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \ |
... | ... | @@ -1015,6 +1021,9 @@ |
1015 | 1021 | else \ |
1016 | 1022 | touch $@; \ |
1017 | 1023 | fi |
1024 | + | |
1025 | +$(CPUDIR)/$(SOC)/asm-offsets.s: include/config.h | |
1026 | + $(call cmd,soc_asm-offsets.s) | |
1018 | 1027 | |
1019 | 1028 | ######################################################################### |
1020 | 1029 | else # !config.mk |