From 6d12884259ac65f74538b7819f5fadf4ebb0d569 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 7 Sep 2005 12:08:23 -0700 Subject: [PATCH] kbuild: add kernelrelease to 'make help' Dunno if there was a conscious decision to leave it out, but if you're happy with adding some help text for it here's a patch against 2.6.13-mm1.. Signed-off-by: Sam Ravnborg diff --git a/Makefile b/Makefile index 2402430..0d0576a 100644 --- a/Makefile +++ b/Makefile @@ -1053,6 +1053,7 @@ help: @echo ' rpm - Build a kernel as an RPM package' @echo ' tags/TAGS - Generate tags file for editors' @echo ' cscope - Generate cscope index' + @echo ' kernelrelease - Output the release version string' @echo '' @echo 'Static analysers' @echo ' buildcheck - List dangling references to vmlinux discarded sections' -- cgit v0.10.2 From 7b49bb9aff8b14d15da58111d8908c877c0a525e Mon Sep 17 00:00:00 2001 From: "viro@ZenIV.linux.org.uk" Date: Fri, 9 Sep 2005 21:14:35 +0100 Subject: [PATCH] kbuild: CF= passes arguments to sparse Allows to add to sparse arguments without mutilating makefiles - just pass CF= and they will be added to CHECKFLAGS. Signed-off-by: Al Viro Signed-off-by: Sam Ravnborg diff --git a/Makefile b/Makefile index 0d0576a..6a40588 100644 --- a/Makefile +++ b/Makefile @@ -334,7 +334,7 @@ KALLSYMS = scripts/kallsyms PERL = perl CHECK = sparse -CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ +CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ $(CF) MODFLAGS = -DMODULE CFLAGS_MODULE = $(MODFLAGS) AFLAGS_MODULE = $(MODFLAGS) -- cgit v0.10.2 From 4e25d8bb9550fb5912165196fe8502cdb831a336 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 8 Sep 2005 17:07:35 +0200 Subject: [PATCH] kbuild: adjust .version updating In order to maintain a more correct build number, updates to the version number should only be commited after a successful link of vmlinux, not before (so that errors in the link process don't lead to pointless increments). Signed-off-by: Jan Beulich Signed-off-by: Sam Ravnborg diff --git a/Makefile b/Makefile index 6a40588..485a11a1 100644 --- a/Makefile +++ b/Makefile @@ -641,8 +641,13 @@ quiet_cmd_vmlinux__ ?= LD $@ # Generate new vmlinux version quiet_cmd_vmlinux_version = GEN .version cmd_vmlinux_version = set -e; \ - . $(srctree)/scripts/mkversion > .tmp_version; \ - mv -f .tmp_version .version; \ + if [ ! -r .version ]; then \ + rm -f .version; \ + echo 1 >.version; \ + else \ + mv .version .old_version; \ + expr 0$$(cat .old_version) + 1 >.version; \ + fi; \ $(MAKE) $(build)=init # Generate System.map @@ -756,6 +761,7 @@ endif # ifdef CONFIG_KALLSYMS # vmlinux image - including updated kernel symbols vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE $(call if_changed_rule,vmlinux__) + $(Q)rm -f .old_version # The actual objects are generated when descending, # make sure no implicit rule kicks in -- cgit v0.10.2 From cd05e6bdc6001ac6e8ab13720693b7e1302d9848 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 6 Sep 2005 11:47:04 +0200 Subject: [PATCH] kbuild: fix split-include dependency Splitting of autoconf.h requires that split-include was built before, and needs to be-re-done when split-include changes. This dependency was previously missing. Additionally, since autoconf.h is (suppoosed to be) generated as a side effect of executing config targets, include/linux should be created prior to running the respective sub-make. Signed-off-by: Jan Beulich Signed-off-by: Sam Ravnborg diff --git a/Makefile b/Makefile index 485a11a1..524fb48 100644 --- a/Makefile +++ b/Makefile @@ -382,6 +382,9 @@ RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CV scripts_basic: $(Q)$(MAKE) $(build)=scripts/basic +# To avoid any implicit rule to kick in, define an empty command. +scripts/basic/%: scripts_basic ; + .PHONY: outputmakefile # outputmakefile generate a Makefile to be placed in output directory, if # using a seperate output directory. This allows convinient use @@ -444,9 +447,8 @@ ifeq ($(config-targets),1) include $(srctree)/arch/$(ARCH)/Makefile export KBUILD_DEFCONFIG -config: scripts_basic outputmakefile FORCE - $(Q)$(MAKE) $(build)=scripts/kconfig $@ -%config: scripts_basic outputmakefile FORCE +config %config: scripts_basic outputmakefile FORCE + $(Q)mkdir -p include/linux $(Q)$(MAKE) $(build)=scripts/kconfig $@ else @@ -854,7 +856,7 @@ include/asm: # Split autoconf.h into include/linux/config/* -include/config/MARKER: include/linux/autoconf.h +include/config/MARKER: scripts/basic/split-include include/linux/autoconf.h @echo ' SPLIT include/linux/autoconf.h -> include/config/*' @scripts/basic/split-include include/linux/autoconf.h include/config @touch $@ -- cgit v0.10.2 From caba0233bc85ec311159a35f138d957d05cf2fe8 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 3 Sep 2005 13:57:15 -0700 Subject: [PATCH] kbuild: ignore all debugging info sections in scripts/reference_discarded.pl GCC 4 emits more DWARF debugging information than before and there is now a .debug_loc section as well. This causes "make buildcheck" to fail. Rather than just add that one to the special case list, I used a regexp to ignore any .debug_ANYTHING sections in case more show up in the future. Signed-off-by: Roland McGrath Signed-off-by: Andrew Morton Signed-off-by: Sam Ravnborg diff --git a/scripts/reference_discarded.pl b/scripts/reference_discarded.pl index f04f627..c2d5414 100644 --- a/scripts/reference_discarded.pl +++ b/scripts/reference_discarded.pl @@ -91,12 +91,7 @@ foreach $object (keys(%object)) { $from !~ /\.exit\.data$/ && $from !~ /\.altinstructions$/ && $from !~ /\.pdr$/ && - $from !~ /\.debug_info$/ && - $from !~ /\.debug_aranges$/ && - $from !~ /\.debug_ranges$/ && - $from !~ /\.debug_line$/ && - $from !~ /\.debug_frame$/ && - $from !~ /\.debug_loc$/ && + $from !~ /\.debug_.*$/ && $from !~ /\.exitcall\.exit$/ && $from !~ /\.eh_frame$/ && $from !~ /\.stab$/)) { -- cgit v0.10.2 From 0a504f259c90fb41d3495d490fc9dbe2530c8749 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sat, 10 Sep 2005 21:02:11 +0200 Subject: kbuild: add objectify Use foo := $(call objectify, $(foo)) to prefix $(foo) with $(obj)/ unless $(foo) is an absolute path. For now no in-tree users - soon to come. Signed-off-by: Sam Ravnborg diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 9087273..db3c708 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -49,6 +49,9 @@ build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj cmd = @$(if $($(quiet)cmd_$(1)),\ echo ' $(subst ','\'',$($(quiet)cmd_$(1)))' &&) $(cmd_$(1)) +# Add $(obj)/ for paths that is not absolute +objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o))) + ### # if_changed - execute command if any prerequisite is newer than # target, or command line has changed -- cgit v0.10.2 From 8d36a62364b6b04dc7b0e9fe09f6968f4e5a1f0a Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sat, 10 Sep 2005 21:05:36 +0200 Subject: kbuild: fix generic asm-offsets.h support iThis fixes a bug where the generated asm-offsets.h file was saved in the source tree even with make O=. Thanks to Stephen Rothwell for the report. Signed-off-by: Sam Ravnborg diff --git a/Kbuild b/Kbuild index 1880e6f..7900391 100644 --- a/Kbuild +++ b/Kbuild @@ -4,7 +4,7 @@ # 1) Generate asm-offsets.h ##### -# 1) Generate asm-offsets.h +# 1) Generate asm-offsets.h # offsets-file := include/asm-$(ARCH)/asm-offsets.h @@ -22,6 +22,7 @@ sed-$(CONFIG_MIPS) := "/^@@@/s///p" quiet_cmd_offsets = GEN $@ define cmd_offsets + mkdir -p $(dir $@); \ cat $< | \ (set -e; \ echo "#ifndef __ASM_OFFSETS_H__"; \ @@ -43,6 +44,6 @@ arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE $(Q)mkdir -p $(dir $@) $(call if_changed_dep,cc_s_c) -$(srctree)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild +$(obj)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild $(call cmd,offsets) diff --git a/Makefile b/Makefile index 524fb48..382298f 100644 --- a/Makefile +++ b/Makefile @@ -814,7 +814,7 @@ ifneq ($(KBUILD_MODULES),) endif prepare0: prepare prepare1 FORCE - $(Q)$(MAKE) $(build)=$(srctree) + $(Q)$(MAKE) $(build)=. # All the preparing.. prepare-all: prepare0 -- cgit v0.10.2