aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile63
1 files changed, 22 insertions, 41 deletions
diff --git a/Makefile b/Makefile
index 207303da3971..cf9e20dac86e 100644
--- a/Makefile
+++ b/Makefile
@@ -213,6 +213,10 @@ endif
213# Where to locate arch specific headers 213# Where to locate arch specific headers
214hdr-arch := $(SRCARCH) 214hdr-arch := $(SRCARCH)
215 215
216ifeq ($(ARCH),m68knommu)
217 hdr-arch := m68k
218endif
219
216KCONFIG_CONFIG ?= .config 220KCONFIG_CONFIG ?= .config
217 221
218# SHELL used by kbuild 222# SHELL used by kbuild
@@ -606,25 +610,20 @@ export INSTALL_PATH ?= /boot
606MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) 610MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
607export MODLIB 611export MODLIB
608 612
609strip-symbols := $(srctree)/scripts/strip-symbols \
610 $(wildcard $(srctree)/arch/$(ARCH)/scripts/strip-symbols)
611
612# 613#
613# INSTALL_MOD_STRIP, if defined, will cause modules to be stripped while 614# INSTALL_MOD_STRIP, if defined, will cause modules to be
614# they get installed. If INSTALL_MOD_STRIP is '1', then the default 615# stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
615# options (see below) will be used. Otherwise, INSTALL_MOD_STRIP will 616# the default option --strip-debug will be used. Otherwise,
616# be used as the option(s) to the objcopy command. 617# INSTALL_MOD_STRIP will used as the options to the strip command.
618
617ifdef INSTALL_MOD_STRIP 619ifdef INSTALL_MOD_STRIP
618ifeq ($(INSTALL_MOD_STRIP),1) 620ifeq ($(INSTALL_MOD_STRIP),1)
619mod_strip_cmd = $(OBJCOPY) --strip-debug 621mod_strip_cmd = $(STRIP) --strip-debug
620ifeq ($(CONFIG_KALLSYMS_ALL),$(CONFIG_KALLSYMS_STRIP_GENERATED))
621mod_strip_cmd += --wildcard $(addprefix --strip-symbols ,$(strip-symbols))
622endif
623else 622else
624mod_strip_cmd = $(OBJCOPY) $(INSTALL_MOD_STRIP) 623mod_strip_cmd = $(STRIP) $(INSTALL_MOD_STRIP)
625endif # INSTALL_MOD_STRIP=1 624endif # INSTALL_MOD_STRIP=1
626else 625else
627mod_strip_cmd = false 626mod_strip_cmd = true
628endif # INSTALL_MOD_STRIP 627endif # INSTALL_MOD_STRIP
629export mod_strip_cmd 628export mod_strip_cmd
630 629
@@ -754,7 +753,6 @@ last_kallsyms := 2
754endif 753endif
755 754
756kallsyms.o := .tmp_kallsyms$(last_kallsyms).o 755kallsyms.o := .tmp_kallsyms$(last_kallsyms).o
757kallsyms.h := $(wildcard include/config/kallsyms/*.h) $(wildcard include/config/kallsyms/*/*.h)
758 756
759define verify_kallsyms 757define verify_kallsyms
760 $(Q)$(if $($(quiet)cmd_sysmap), \ 758 $(Q)$(if $($(quiet)cmd_sysmap), \
@@ -779,41 +777,24 @@ endef
779 777
780# Generate .S file with all kernel symbols 778# Generate .S file with all kernel symbols
781quiet_cmd_kallsyms = KSYM $@ 779quiet_cmd_kallsyms = KSYM $@
782 cmd_kallsyms = { test $* -eq 0 || $(NM) -n $<; } \ 780 cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \
783 | $(KALLSYMS) $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) >$@ 781 $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) > $@
784 782
785quiet_cmd_kstrip = STRIP $@ 783.tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE
786 cmd_kstrip = $(OBJCOPY) --wildcard $(addprefix --strip$(if $(CONFIG_RELOCATABLE),-unneeded)-symbols ,$(filter %/scripts/strip-symbols,$^)) $< $@
787
788$(foreach n,0 1 2 3,.tmp_kallsyms$(n).o): KBUILD_AFLAGS += -Wa,--strip-local-absolute
789$(foreach n,0 1 2 3,.tmp_kallsyms$(n).o): %.o: %.S scripts FORCE
790 $(call if_changed_dep,as_o_S) 784 $(call if_changed_dep,as_o_S)
791 785
792ifeq ($(CONFIG_KALLSYMS_STRIP_GENERATED),y) 786.tmp_kallsyms%.S: .tmp_vmlinux% $(KALLSYMS)
793strip-ext := .stripped
794endif
795
796.tmp_kallsyms%.S: .tmp_vmlinux%$(strip-ext) $(KALLSYMS) $(kallsyms.h)
797 $(call cmd,kallsyms) 787 $(call cmd,kallsyms)
798 788
799# make -jN seems to have problems with intermediate files, see bug #3330.
800.SECONDARY: $(foreach n,1 2 3,.tmp_vmlinux$(n).stripped)
801.tmp_vmlinux%.stripped: .tmp_vmlinux% $(strip-symbols) $(kallsyms.h)
802 $(call cmd,kstrip)
803
804ifneq ($(CONFIG_DEBUG_INFO),y)
805.tmp_vmlinux%: LDFLAGS_vmlinux += -S
806endif
807# .tmp_vmlinux1 must be complete except kallsyms, so update vmlinux version 789# .tmp_vmlinux1 must be complete except kallsyms, so update vmlinux version
808.tmp_vmlinux%: $(vmlinux-lds) $(vmlinux-all) FORCE 790.tmp_vmlinux1: $(vmlinux-lds) $(vmlinux-all) FORCE
809 $(if $(filter 1,$*),$(call if_changed_rule,ksym_ld),$(call if_changed,vmlinux__)) 791 $(call if_changed_rule,ksym_ld)
810 792
811.tmp_vmlinux0$(strip-ext): 793.tmp_vmlinux2: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms1.o FORCE
812 $(Q)echo "placeholder" >$@ 794 $(call if_changed,vmlinux__)
813 795
814.tmp_vmlinux1: .tmp_kallsyms0.o 796.tmp_vmlinux3: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms2.o FORCE
815.tmp_vmlinux2: .tmp_kallsyms1.o 797 $(call if_changed,vmlinux__)
816.tmp_vmlinux3: .tmp_kallsyms2.o
817 798
818# Needs to visit scripts/ before $(KALLSYMS) can be used. 799# Needs to visit scripts/ before $(KALLSYMS) can be used.
819$(KALLSYMS): scripts ; 800$(KALLSYMS): scripts ;