X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=d01b004a2a0e74613aa8876523f80b51da942e6f;hb=66d609ec8a4464b5fbe7a0723e3958b98c95991a;hp=c11a317ea910df5c8456de992ae8f932a102b12b;hpb=14d8ce70d5c2634982ca564039466bce70f4ff18;p=pandora-kernel.git diff --git a/Makefile b/Makefile index c11a317ea910..d01b004a2a0e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 -SUBLEVEL = 12 -EXTRAVERSION =-rc5 +SUBLEVEL = 13 +EXTRAVERSION =-rc2 NAME=Woozy Numbat # *DOCUMENTATION* @@ -109,10 +109,9 @@ $(if $(KBUILD_OUTPUT),, \ .PHONY: $(MAKECMDGOALS) $(filter-out _all,$(MAKECMDGOALS)) _all: - $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ - KBUILD_SRC=$(CURDIR) KBUILD_VERBOSE=$(KBUILD_VERBOSE) \ - KBUILD_CHECK=$(KBUILD_CHECK) KBUILD_EXTMOD="$(KBUILD_EXTMOD)" \ - -f $(CURDIR)/Makefile $@ + $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ + KBUILD_SRC=$(CURDIR) \ + KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $@ # Leave processing to above invocation of make skip-makefile := 1 @@ -233,7 +232,7 @@ ifeq ($(MAKECMDGOALS),) KBUILD_MODULES := 1 endif -export KBUILD_MODULES KBUILD_BUILTIN KBUILD_VERBOSE +export KBUILD_MODULES KBUILD_BUILTIN export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD # Beautify output @@ -281,7 +280,7 @@ export quiet Q KBUILD_VERBOSE # See documentation in Documentation/kbuild/makefiles.txt # cc-option -# Usage: cflags-y += $(call gcc-option, -march=winchip-c6, -march=i586) +# Usage: cflags-y += $(call cc-option, -march=winchip-c6, -march=i586) cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) @@ -309,6 +308,9 @@ cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \ # Look for make include files relative to root of kernel src MAKEFLAGS += --include-dir=$(srctree) +# We need some generic definitions +include $(srctree)/scripts/Kbuild.include + # For maximum performance (+ possibly random breakage, uncomment # the following) @@ -348,7 +350,7 @@ LINUXINCLUDE := -Iinclude \ CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) -CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \ +CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common \ -ffreestanding AFLAGS := -D__ASSEMBLY__ @@ -367,11 +369,6 @@ export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE # even be read-only. export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions -# The temporary file to save gcc -MD generated dependencies must not -# contain a comma -comma := , -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 -o -name .pc \) -prune -o @@ -518,7 +515,7 @@ CFLAGS += $(call add-align,CONFIG_CC_ALIGN_LOOPS,-loops) CFLAGS += $(call add-align,CONFIG_CC_ALIGN_JUMPS,-jumps) ifdef CONFIG_FRAME_POINTER -CFLAGS += -fno-omit-frame-pointer +CFLAGS += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,) else CFLAGS += -fomit-frame-pointer endif @@ -691,8 +688,10 @@ endef # Update vmlinux version before link # Use + in front of this rule to silent warning about make -j1 +# First command is ':' to allow us to use + in front of this rule cmd_ksym_ld = $(cmd_vmlinux__) define rule_ksym_ld + : +$(call cmd,vmlinux_version) $(call cmd,vmlinux__) $(Q)echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd @@ -722,6 +721,16 @@ quiet_cmd_kallsyms = KSYM $@ # Needs to visit scripts/ before $(KALLSYMS) can be used. $(KALLSYMS): scripts ; +# Generate some data for debugging strange kallsyms problems +debug_kallsyms: .tmp_map$(last_kallsyms) + +.tmp_map%: .tmp_vmlinux% FORCE + ($(OBJDUMP) -h $< | $(AWK) '/^ +[0-9]/{print $$4 " 0 " $$2}'; $(NM) $<) | sort > $@ + +.tmp_map3: .tmp_map2 + +.tmp_map2: .tmp_map1 + endif # ifdef CONFIG_KALLSYMS # vmlinux image - including updated kernel symbols @@ -757,7 +766,7 @@ $(vmlinux-dirs): prepare-all scripts prepare2: ifneq ($(KBUILD_SRC),) @echo ' Using $(srctree) as source for kernel' - $(Q)if [ -h $(srctree)/include/asm -o -f $(srctree)/.config ]; then \ + $(Q)if [ -f $(srctree)/.config ]; then \ echo " $(srctree) is not clean, please run 'make mrproper'";\ echo " in the '$(srctree)' directory.";\ /bin/false; \ @@ -769,7 +778,8 @@ endif # prepare1 creates a makefile if using a separate output directory prepare1: prepare2 outputmakefile -prepare0: prepare1 include/linux/version.h include/asm include/config/MARKER +prepare0: prepare1 include/linux/version.h include/asm \ + include/config/MARKER ifneq ($(KBUILD_MODULES),) $(Q)rm -rf $(MODVERDIR) $(Q)mkdir -p $(MODVERDIR) @@ -792,6 +802,9 @@ export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH) $(Q)$(MAKE) $(build)=$(@D) $@ %.o: %.c scripts FORCE $(Q)$(MAKE) $(build)=$(@D) $@ +%.ko: scripts FORCE + $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) $(build)=$(@D) $(@:.ko=.o) + $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost %/: scripts prepare FORCE $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) $(build)=$(@D) %.lst: %.c scripts FORCE @@ -872,7 +885,7 @@ modules_install: _modinst_ _modinst_post .PHONY: _modinst_ _modinst_: - @if [ -z "`$(DEPMOD) -V | grep module-init-tools`" ]; then \ + @if [ -z "`$(DEPMOD) -V 2>/dev/null | grep module-init-tools`" ]; then \ echo "Warning: you may need to install module-init-tools"; \ echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\ sleep 1; \ @@ -1033,6 +1046,7 @@ help: @echo ' modules_install - Install all modules' @echo ' dir/ - Build all files in dir and below' @echo ' dir/file.[ois] - Build specified target only' + @echo ' dir/file.ko - Build module including final link' @echo ' rpm - Build a kernel as an RPM package' @echo ' tags/TAGS - Generate tags file for editors' @echo ' cscope - Generate cscope index' @@ -1149,43 +1163,55 @@ endif # KBUILD_EXTMOD #(which is the most common case IMHO) to avoid unneeded clutter in the big tags file. #Adding $(srctree) adds about 20M on i386 to the size of the output file! -ifeq ($(KBUILD_OUTPUT),) +ifeq ($(src),$(obj)) __srctree = else __srctree = $(srctree)/ endif +ALLSOURCE_ARCHS := $(ARCH) + define all-sources ( find $(__srctree) $(RCS_FIND_IGNORE) \ \( -name include -o -name arch \) -prune -o \ -name '*.[chS]' -print; \ - find $(__srctree)arch/$(ARCH) $(RCS_FIND_IGNORE) \ - -name '*.[chS]' -print; \ + for ARCH in $(ALLSOURCE_ARCHS) ; do \ + find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \ + -name '*.[chS]' -print; \ + done ; \ find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \ -name '*.[chS]' -print; \ find $(__srctree)include $(RCS_FIND_IGNORE) \ \( -name config -o -name 'asm-*' \) -prune \ -o -name '*.[chS]' -print; \ - find $(__srctree)include/asm-$(ARCH) $(RCS_FIND_IGNORE) \ - -name '*.[chS]' -print; \ + for ARCH in $(ALLSOURCE_ARCHS) ; do \ + find $(__srctree)include/asm-$${ARCH} $(RCS_FIND_IGNORE) \ + -name '*.[chS]' -print; \ + done ; \ find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \ -name '*.[chS]' -print ) endef quiet_cmd_cscope-file = FILELST cscope.files - cmd_cscope-file = $(all-sources) > cscope.files + cmd_cscope-file = (echo \-k; echo \-q; $(all-sources)) > cscope.files quiet_cmd_cscope = MAKE cscope.out - cmd_cscope = cscope -k -b -q + cmd_cscope = cscope -b cscope: FORCE $(call cmd,cscope-file) $(call cmd,cscope) quiet_cmd_TAGS = MAKE $@ -cmd_TAGS = $(all-sources) | etags - +define cmd_TAGS + rm -f $@; \ + ETAGSF=`etags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f"`; \ + $(all-sources) | xargs etags $$ETAGSF -a +endef + +TAGS: FORCE + $(call cmd,TAGS) -# Exuberant ctags works better with -I quiet_cmd_tags = MAKE $@ define cmd_tags @@ -1194,9 +1220,6 @@ define cmd_tags $(all-sources) | xargs ctags $$CTAGSF -a endef -TAGS: FORCE - $(call cmd,TAGS) - tags: FORCE $(call cmd,tags) @@ -1264,82 +1287,11 @@ ifneq ($(cmd_files),) include $(cmd_files) endif -# Execute command and generate cmd file -if_changed = $(if $(strip $? \ - $(filter-out $(cmd_$(1)),$(cmd_$@))\ - $(filter-out $(cmd_$@),$(cmd_$(1)))),\ - @set -e; \ - $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \ - $(cmd_$(1)); \ - echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd) - - -# execute the command and also postprocess generated .d dependencies -# file -if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ - $(filter-out $(cmd_$(1)),$(cmd_$@))\ - $(filter-out $(cmd_$@),$(cmd_$(1)))),\ - $(Q)set -e; \ - $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \ - $(cmd_$(1)); \ - scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \ - rm -f $(depfile); \ - mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd) - -# Usage: $(call if_changed_rule,foo) -# will check if $(cmd_foo) changed, or any of the prequisites changed, -# and if so will execute $(rule_foo) - -if_changed_rule = $(if $(strip $? \ - $(filter-out $(cmd_$(1)),$(cmd_$(@F)))\ - $(filter-out $(cmd_$(@F)),$(cmd_$(1)))),\ - $(Q)$(rule_$(1))) - -# If quiet is set, only print short version of command - -cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) - -# filechk is used to check if the content of a generated file is updated. -# Sample usage: -# define filechk_sample -# echo $KERNELRELEASE -# endef -# version.h : Makefile -# $(call filechk,sample) -# The rule defined shall write to stdout the content of the new file. -# The existing file will be compared with the new one. -# - If no file exist it is created -# - If the content differ the new file is used -# - If they are equal no change, and no timestamp update - -define filechk - @set -e; \ - echo ' CHK $@'; \ - mkdir -p $(dir $@); \ - $(filechk_$(1)) < $< > $@.tmp; \ - if [ -r $@ ] && cmp -s $@ $@.tmp; then \ - rm -f $@.tmp; \ - else \ - echo ' UPD $@'; \ - mv -f $@.tmp $@; \ - fi -endef - -# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=dir -# Usage: -# $(Q)$(MAKE) $(build)=dir -build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj - # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir # Usage: # $(Q)$(MAKE) $(clean)=dir clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj -# $(call descend,,) -# Recursively call a sub-make in with target -# Usage is deprecated, because make does not see this as an invocation of make. -descend =$(Q)$(MAKE) -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj=$(1) $(2) - endif # skip-makefile FORCE: