aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile44
1 files changed, 35 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 39516bfad958..5cf825819533 100644
--- a/Makefile
+++ b/Makefile
@@ -507,6 +507,10 @@ else
507KBUILD_CFLAGS += -O2 507KBUILD_CFLAGS += -O2
508endif 508endif
509 509
510ifneq (CONFIG_FRAME_WARN,0)
511KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN})
512endif
513
510# Force gcc to behave correct even for buggy distributions 514# Force gcc to behave correct even for buggy distributions
511# Arch Makefiles may override this setting 515# Arch Makefiles may override this setting
512KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector) 516KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
@@ -790,7 +794,7 @@ endif # ifdef CONFIG_KALLSYMS
790quiet_cmd_vmlinux-modpost = LD $@ 794quiet_cmd_vmlinux-modpost = LD $@
791 cmd_vmlinux-modpost = $(LD) $(LDFLAGS) -r -o $@ \ 795 cmd_vmlinux-modpost = $(LD) $(LDFLAGS) -r -o $@ \
792 $(vmlinux-init) --start-group $(vmlinux-main) --end-group \ 796 $(vmlinux-init) --start-group $(vmlinux-main) --end-group \
793 $(filter-out $(vmlinux-init) $(vmlinux-main) $(vmlinux-lds) FORCE ,$^) 797 $(filter-out $(vmlinux-init) $(vmlinux-main) FORCE ,$^)
794define rule_vmlinux-modpost 798define rule_vmlinux-modpost
795 : 799 :
796 +$(call cmd,vmlinux-modpost) 800 +$(call cmd,vmlinux-modpost)
@@ -814,7 +818,9 @@ endif
814ifdef CONFIG_KALLSYMS 818ifdef CONFIG_KALLSYMS
815.tmp_vmlinux1: vmlinux.o 819.tmp_vmlinux1: vmlinux.o
816endif 820endif
817vmlinux.o: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) FORCE 821
822modpost-init := $(filter-out init/built-in.o, $(vmlinux-init))
823vmlinux.o: $(modpost-init) $(vmlinux-main) FORCE
818 $(call if_changed_rule,vmlinux-modpost) 824 $(call if_changed_rule,vmlinux-modpost)
819 825
820# The actual objects are generated when descending, 826# The actual objects are generated when descending,
@@ -1170,8 +1176,10 @@ rpm: include/config/kernel.release FORCE
1170# Brief documentation of the typical targets used 1176# Brief documentation of the typical targets used
1171# --------------------------------------------------------------------------- 1177# ---------------------------------------------------------------------------
1172 1178
1173boards := $(wildcard $(srctree)/arch/$(ARCH)/configs/*_defconfig) 1179boards := $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*_defconfig)
1174boards := $(notdir $(boards)) 1180boards := $(notdir $(boards))
1181board-dirs := $(dir $(wildcard $(srctree)/arch/$(SRCARCH)/configs/*/*_defconfig))
1182board-dirs := $(sort $(notdir $(board-dirs:/=)))
1175 1183
1176help: 1184help:
1177 @echo 'Cleaning targets:' 1185 @echo 'Cleaning targets:'
@@ -1217,14 +1225,19 @@ help:
1217 @echo 'Documentation targets:' 1225 @echo 'Documentation targets:'
1218 @$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp 1226 @$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp
1219 @echo '' 1227 @echo ''
1220 @echo 'Architecture specific targets ($(ARCH)):' 1228 @echo 'Architecture specific targets ($(SRCARCH)):'
1221 @$(if $(archhelp),$(archhelp),\ 1229 @$(if $(archhelp),$(archhelp),\
1222 echo ' No architecture specific help defined for $(ARCH)') 1230 echo ' No architecture specific help defined for $(SRCARCH)')
1223 @echo '' 1231 @echo ''
1224 @$(if $(boards), \ 1232 @$(if $(boards), \
1225 $(foreach b, $(boards), \ 1233 $(foreach b, $(boards), \
1226 printf " %-24s - Build for %s\\n" $(b) $(subst _defconfig,,$(b));) \ 1234 printf " %-24s - Build for %s\\n" $(b) $(subst _defconfig,,$(b));) \
1227 echo '') 1235 echo '')
1236 @$(if $(board-dirs), \
1237 $(foreach b, $(board-dirs), \
1238 printf " %-16s - Show %s-specific targets\\n" help-$(b) $(b);) \
1239 printf " %-16s - Show all of the above\\n" help-boards; \
1240 echo '')
1228 1241
1229 @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' 1242 @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
1230 @echo ' make V=2 [targets] 2 => give reason for rebuild of target' 1243 @echo ' make V=2 [targets] 2 => give reason for rebuild of target'
@@ -1236,6 +1249,20 @@ help:
1236 @echo 'For further info see the ./README file' 1249 @echo 'For further info see the ./README file'
1237 1250
1238 1251
1252help-board-dirs := $(addprefix help-,$(board-dirs))
1253
1254help-boards: $(help-board-dirs)
1255
1256boards-per-dir = $(notdir $(wildcard $(srctree)/arch/$(SRCARCH)/configs/$*/*_defconfig))
1257
1258$(help-board-dirs): help-%:
1259 @echo 'Architecture specific targets ($(SRCARCH) $*):'
1260 @$(if $(boards-per-dir), \
1261 $(foreach b, $(boards-per-dir), \
1262 printf " %-24s - Build for %s\\n" $*/$(b) $(subst _defconfig,,$(b));) \
1263 echo '')
1264
1265
1239# Documentation targets 1266# Documentation targets
1240# --------------------------------------------------------------------------- 1267# ---------------------------------------------------------------------------
1241%docs: scripts_basic FORCE 1268%docs: scripts_basic FORCE
@@ -1396,7 +1423,7 @@ define xtags
1396 $(all-kconfigs) | xargs $1 -a \ 1423 $(all-kconfigs) | xargs $1 -a \
1397 --langdef=kconfig \ 1424 --langdef=kconfig \
1398 --language-force=kconfig \ 1425 --language-force=kconfig \
1399 --regex-kconfig='/^[[:blank:]]*config[[:blank:]]+([[:alnum:]_]+)/\1/'; \ 1426 --regex-kconfig='/^[[:blank:]]*(menu|)config[[:blank:]]+([[:alnum:]_]+)/\2/'; \
1400 $(all-defconfigs) | xargs -r $1 -a \ 1427 $(all-defconfigs) | xargs -r $1 -a \
1401 --langdef=dotconfig \ 1428 --langdef=dotconfig \
1402 --language-force=dotconfig \ 1429 --language-force=dotconfig \
@@ -1404,7 +1431,7 @@ define xtags
1404 elif $1 --version 2>&1 | grep -iq emacs; then \ 1431 elif $1 --version 2>&1 | grep -iq emacs; then \
1405 $(all-sources) | xargs $1 -a; \ 1432 $(all-sources) | xargs $1 -a; \
1406 $(all-kconfigs) | xargs $1 -a \ 1433 $(all-kconfigs) | xargs $1 -a \
1407 --regex='/^[ \t]*config[ \t]+\([a-zA-Z0-9_]+\)/\1/'; \ 1434 --regex='/^[ \t]*(menu|)config[ \t]+\([a-zA-Z0-9_]+\)/\2/'; \
1408 $(all-defconfigs) | xargs -r $1 -a \ 1435 $(all-defconfigs) | xargs -r $1 -a \
1409 --regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \ 1436 --regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \
1410 else \ 1437 else \
@@ -1538,8 +1565,7 @@ quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs)))
1538quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))) 1565quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)))
1539 cmd_rmfiles = rm -f $(rm-files) 1566 cmd_rmfiles = rm -f $(rm-files)
1540 1567
1541# Run depmod only is we have System.map and depmod is executable 1568# Run depmod only if we have System.map and depmod is executable
1542# and we build for the host arch
1543quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) 1569quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
1544 cmd_depmod = \ 1570 cmd_depmod = \
1545 if [ -r System.map -a -x $(DEPMOD) ]; then \ 1571 if [ -r System.map -a -x $(DEPMOD) ]; then \