X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile;h=824a4db753adbb324e60bf55903bc058a2b9d0a3;hb=1fc06cc5c1b1596eaf5941494b9c09b95ec4c8ae;hp=f9cbd4df2d4314ec0738c5bc3befbcd5eb421a61;hpb=8fe849edaaabd915f060b3744165ff7f95a2b34e;p=linux-2.6.git diff --git a/Makefile b/Makefile index f9cbd4df2..824a4db75 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 -SUBLEVEL = 6 -EXTRAVERSION = -1.406-vs1.9.1 +SUBLEVEL = 7 +EXTRAVERSION = -1.494-ckrm.E15-vs1.9.1.12 NAME=Zonked Quokka # *DOCUMENTATION* @@ -290,8 +290,6 @@ STRIP = $(CROSS_COMPILE)strip OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump AWK = awk -RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ - else echo rpm; fi) GENKSYMS = scripts/genksyms/genksyms DEPMOD = /sbin/depmod KALLSYMS = scripts/kallsyms @@ -334,8 +332,8 @@ depfile = $(subst $(comma),_,$(@D)/.$(@F).d) # Files to ignore in find ... statements -RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \) -prune -o -RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS +RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS -o -name .pc \) -prune -o +RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS --exclude .pc # =========================================================================== # Rules shared between *config targets and build targets @@ -409,13 +407,6 @@ scripts: scripts_basic include/config/MARKER scripts_basic: include/linux/autoconf.h - -# That's our default target when none is given on the command line -# Note that 'modules' will be added as a prerequisite as well, -# in the CONFIG_MODULES part below - -all: vmlinux - # Objects we will link into vmlinux / subdirs we need to visit init-y := init/ drivers-y := drivers/ sound/ @@ -449,6 +440,19 @@ endif include $(srctree)/arch/$(ARCH)/Makefile +# Default kernel image to build when no specific target is given. +# KBUILD_IMAGE may be overruled on the commandline or +# set in the environment +# Also any assingments in arch/$(ARCH)/Makefiel take precedence over +# this default value +export KBUILD_IMAGE ?= vmlinux + +# The all: target is the default when no target is given on the +# command line. +# This allow a user to issue only 'make' to build a kernel including modules +# Defaults vmlinux but it is usually overriden in the arch makefile +all: vmlinux + ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE CFLAGS += -Os else @@ -544,10 +548,7 @@ define rule_vmlinux__ echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd endef -define rule_vmlinux - $(rule_vmlinux__); \ - $(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map -endef +do_system_map = $(NM) $(1) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > $(2) LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s @@ -561,30 +562,57 @@ LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s # but due to the added section, some addresses have shifted # From here, we generate a correct .tmp_kallsyms2.o # o The correct .tmp_kallsyms2.o is linked into the final vmlinux. +# o Verify that the System.map from vmlinux matches the map from +# .tmp_vmlinux2, just in case we did not generate kallsyms correctly. +# o If CONFIG_KALLSYMS_EXTRA_PASS is set, do an extra pass using +# .tmp_vmlinux3 and .tmp_kallsyms3.o. This is only meant as a +# temporary bypass to allow the kernel to be built while the +# maintainers work out what went wrong with kallsyms. ifdef CONFIG_KALLSYMS -kallsyms.o := .tmp_kallsyms2.o +ifdef CONFIG_KALLSYMS_EXTRA_PASS +last_kallsyms := 3 +else +last_kallsyms := 2 +endif + +kallsyms.o := .tmp_kallsyms$(last_kallsyms).o + +define rule_verify_kallsyms + @$(call do_system_map, .tmp_vmlinux$(last_kallsyms), .tmp_System.map) + @cmp -s System.map .tmp_System.map || \ + (echo Inconsistent kallsyms data, try setting CONFIG_KALLSYMS_EXTRA_PASS ; rm .tmp_kallsyms* ; false) +endef quiet_cmd_kallsyms = KSYM $@ cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) $(foreach x,$(CONFIG_KALLSYMS_ALL),--all-symbols) > $@ -.tmp_kallsyms1.o .tmp_kallsyms2.o: %.o: %.S scripts FORCE +.tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE $(call if_changed_dep,as_o_S) .tmp_kallsyms%.S: .tmp_vmlinux% $(call cmd,kallsyms) .tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE - +$(call if_changed_rule,vmlinux__) + $(call if_changed_rule,vmlinux__) .tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE $(call if_changed_rule,vmlinux__) +.tmp_vmlinux3: $(vmlinux-objs) .tmp_kallsyms2.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE + $(call if_changed_rule,vmlinux__) + endif # Finally the vmlinux rule +define rule_vmlinux + $(rule_vmlinux__); \ + $(call do_system_map, $@, System.map) + $(rule_verify_kallsyms) +endef + vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE $(call if_changed_rule,vmlinux) @@ -795,8 +823,8 @@ endef # Directories & files removed with 'make clean' CLEAN_DIRS += $(MODVERDIR) -CLEAN_FILES += vmlinux System.map kernel.spec \ - .tmp_kallsyms* .tmp_version .tmp_vmlinux* +CLEAN_FILES += vmlinux System.map \ + .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map # Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config include2 @@ -841,44 +869,26 @@ mrproper: clean archmrproper $(mrproper-dirs) .PHONY: distclean distclean: mrproper - @find . $(RCS_FIND_IGNORE) \ + @find $(srctree) $(RCS_FIND_IGNORE) \ \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ -o -name '.*.rej' -o -size 0 \ -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ -type f -print | xargs rm -f -# RPM target -# --------------------------------------------------------------------------- - -.PHONY: rpm - -# Remove hyphens since they have special meaning in RPM filenames -KERNELPATH=kernel-$(subst -,,$(KERNELRELEASE)) -# If you do a make spec before packing the tarball you can rpm -ta it - -spec: - $(CONFIG_SHELL) $(srctree)/scripts/mkspec > $(objtree)/kernel.spec - -# a) Build a tar ball -# b) generate an rpm from it -# c) and pack the result -# - Use /. to avoid tar packing just the symlink +# Packaging of the kernel to various formats +# --------------------------------------------------------------------------- +# rpm target kept for backward compatibility +package-dir := $(srctree)/scripts/package -rpm: clean spec - set -e; \ - cd .. ; \ - ln -sf $(srctree) $(KERNELPATH) ; \ - tar -cvz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \ - rm $(KERNELPATH) +.PHONY: %-pkg rpm - set -e; \ - $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version;\ - mv -f $(objtree)/.tmp_version $(objtree)/.version; +%pkg: FORCE + $(Q)$(MAKE) -f $(package-dir)/Makefile $@ +rpm: FORCE + $(Q)$(MAKE) -f $(package-dir)/Makefile $@ - $(RPM) --target $(UTS_MACHINE) -ta ../$(KERNELPATH).tar.gz - rm ../$(KERNELPATH).tar.gz # Brief documentation of the typical targets used # --------------------------------------------------------------------------- @@ -905,6 +915,8 @@ help: @echo ' tags/TAGS - Generate tags file for editors' @echo ' cscope - Generate cscope index' @echo ' checkstack - Generate a list of stack hogs' + @echo 'Kernel packaging:' + @$(MAKE) -f $(package-dir)/Makefile help @echo '' @echo 'Documentation targets:' @$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp @@ -1062,6 +1074,7 @@ versioncheck: buildcheck: $(PERL) scripts/reference_discarded.pl + $(PERL) scripts/reference_init.pl endif #ifeq ($(config-targets),1) endif #ifeq ($(mixed-targets),1) @@ -1069,7 +1082,7 @@ endif #ifeq ($(mixed-targets),1) .PHONY: checkstack checkstack: $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ - $(PERL) scripts/checkstack.pl $(ARCH) + $(PERL) $(src)/scripts/checkstack.pl $(ARCH) # FIXME Should go into a make.lib or something # ===========================================================================