Commit 18495a2b authored by Sam Ravnborg's avatar Sam Ravnborg

Merge mars.ravnborg.org:/home/sam/src/linux/kernel/bk/linux-2.5

into mars.ravnborg.org:/home/sam/src/linux/kernel/bk/kbuild
parents 4949833a 11acea02
...@@ -90,25 +90,23 @@ KBUILD_MODULES := ...@@ -90,25 +90,23 @@ KBUILD_MODULES :=
KBUILD_BUILTIN := 1 KBUILD_BUILTIN := 1
# If we have only "make modules", don't compile built-in objects. # If we have only "make modules", don't compile built-in objects.
# When we're building modules with modversions, we need to consider
# the built-in objects during the descend as well, in order to
# make sure the checksums are uptodate before we record them.
ifeq ($(MAKECMDGOALS),modules) ifeq ($(MAKECMDGOALS),modules)
KBUILD_BUILTIN := KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1)
endif endif
# If we have "make <whatever> modules", compile modules # If we have "make <whatever> modules", compile modules
# in addition to whatever we do anyway. # in addition to whatever we do anyway.
ifneq ($(filter modules,$(MAKECMDGOALS)),)
KBUILD_MODULES := 1
endif
# Just "make" or "make all" shall build modules as well # Just "make" or "make all" shall build modules as well
ifeq ($(MAKECMDGOALS),) ifneq ($(filter all modules,$(MAKECMDGOALS)),)
KBUILD_MODULES := 1 KBUILD_MODULES := 1
endif endif
ifneq ($(filter all,$(MAKECMDGOALS)),) ifeq ($(MAKECMDGOALS),)
KBUILD_MODULES := 1 KBUILD_MODULES := 1
endif endif
...@@ -310,18 +308,6 @@ ifndef CONFIG_FRAME_POINTER ...@@ -310,18 +308,6 @@ ifndef CONFIG_FRAME_POINTER
CFLAGS += -fomit-frame-pointer CFLAGS += -fomit-frame-pointer
endif endif
# When we're building modules with modversions, we need to consider
# the built-in objects during the descend as well, in order to
# make sure the checksums are uptodate before we record them.
ifdef CONFIG_MODVERSIONS
ifeq ($(KBUILD_MODULES),1)
ifneq ($(KBUILD_BUILTIN),1)
KBUILD_BUILTIN := 1
endif
endif
endif
# #
# INSTALL_PATH specifies where to place the updated kernel and system map # INSTALL_PATH specifies where to place the updated kernel and system map
# images. Uncomment if you want to place them anywhere other than root. # images. Uncomment if you want to place them anywhere other than root.
...@@ -380,7 +366,7 @@ define rule_vmlinux__ ...@@ -380,7 +366,7 @@ define rule_vmlinux__
endef endef
define rule_vmlinux define rule_vmlinux
$(rule_vmlinux__) $(rule_vmlinux__); \
$(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map $(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
endef endef
...@@ -446,9 +432,8 @@ else ...@@ -446,9 +432,8 @@ else
@echo '*** Warning: Overriding SUBDIRS on the command line can cause' @echo '*** Warning: Overriding SUBDIRS on the command line can cause'
@echo '*** inconsistencies' @echo '*** inconsistencies'
endif endif
$(Q)mkdir -p $(MODVERDIR)
endif endif
@echo ' Starting the build. KBUILD_BUILTIN=$(KBUILD_BUILTIN) KBUILD_MODULES=$(KBUILD_MODULES)' $(if $(CONFIG_MODULES),$(Q)mkdir -p $(MODVERDIR))
# This can be used by arch/$ARCH/Makefile to preprocess # This can be used by arch/$ARCH/Makefile to preprocess
# their vmlinux.lds.S file # their vmlinux.lds.S file
...@@ -470,9 +455,7 @@ targets += arch/$(ARCH)/vmlinux.lds.s ...@@ -470,9 +455,7 @@ targets += arch/$(ARCH)/vmlinux.lds.s
%.o: %.c scripts FORCE %.o: %.c scripts FORCE
$(Q)$(MAKE) $(build)=$(@D) $@ $(Q)$(MAKE) $(build)=$(@D) $@
%/: scripts prepare FORCE %/: scripts prepare FORCE
$(Q)$(MAKE) $(build)=$(@D) $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) $(build)=$(@D)
%.ko: scripts FORCE
$(Q)$(MAKE) $(build)=$(@D) $@
%.lst: %.c scripts FORCE %.lst: %.c scripts FORCE
$(Q)$(MAKE) $(build)=$(@D) $@ $(Q)$(MAKE) $(build)=$(@D) $@
%.s: %.S scripts FORCE %.s: %.S scripts FORCE
...@@ -514,7 +497,7 @@ define filechk_version.h ...@@ -514,7 +497,7 @@ define filechk_version.h
if expr length "$(KERNELRELEASE)" \> $(uts_len) >/dev/null ; then \ if expr length "$(KERNELRELEASE)" \> $(uts_len) >/dev/null ; then \
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
exit 1; \ exit 1; \
fi; fi; \
(echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \ (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \
echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \ echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \ echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \
...@@ -825,6 +808,7 @@ help: ...@@ -825,6 +808,7 @@ help:
@echo '* vmlinux - Build the bare kernel' @echo '* vmlinux - Build the bare kernel'
@echo '* modules - Build all modules' @echo '* modules - Build all modules'
@echo ' modules_install - Install all modules' @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.[ois] - Build specified target only'
@echo ' rpm - Build a kernel as an RPM package' @echo ' rpm - Build a kernel as an RPM package'
@echo ' tags/TAGS - Generate tags file for editors' @echo ' tags/TAGS - Generate tags file for editors'
......
...@@ -38,14 +38,22 @@ obj-$(CONFIG_SCx200) += scx200.o ...@@ -38,14 +38,22 @@ obj-$(CONFIG_SCx200) += scx200.o
# vsyscall.o contains the vsyscall DSO images as __initdata. # vsyscall.o contains the vsyscall DSO images as __initdata.
# We must build both images before we can assemble it. # We must build both images before we can assemble it.
# Note: kbuild does not track this dependency due to usage of .incbin
$(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so $(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so
extra-y += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so) targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so)
# The DSO images are built using a special linker script. # The DSO images are built using a special linker script.
quiet_cmd_syscall = SYSCALL $@
cmd_syscall = $(CC) -nostdlib $(SYSCFLAGS_$(@F)) \
-Wl,-T,$(filter-out FORCE,$^) -o $@
vsyscall-flags = -shared -s -Wl,-soname=linux-vsyscall.so.1
SYSCFLAGS_vsyscall-sysenter.so = $(vsyscall-flags)
SYSCFLAGS_vsyscall-int80.so = $(vsyscall-flags)
$(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so: \ $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so: \
$(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
$(CC) -nostdlib -shared -s -Wl,-soname=linux-vsyscall.so.1 \ $(call if_changed,syscall)
-o $@ -Wl,-T,$^
# We also create a special relocatable object that should mirror the symbol # We also create a special relocatable object that should mirror the symbol
# table and layout of the linked DSO. With ld -R we can then refer to # table and layout of the linked DSO. With ld -R we can then refer to
...@@ -53,5 +61,7 @@ $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o ...@@ -53,5 +61,7 @@ $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o
extra-y += vsyscall-syms.o extra-y += vsyscall-syms.o
$(obj)/built-in.o: $(obj)/vsyscall-syms.o $(obj)/built-in.o: $(obj)/vsyscall-syms.o
$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o $(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o
$(obj)/vsyscall-syms.o: $(src)/vsyscall.lds $(obj)/vsyscall-sysenter.o
$(CC) -nostdlib -r -o $@ -Wl,-T,$^ SYSCFLAGS_vsyscall-syms.o = -r
$(obj)/vsyscall-syms.o: $(src)/vsyscall.lds $(obj)/vsyscall-sysenter.o FORCE
$(call if_changed,syscall)
...@@ -82,8 +82,11 @@ obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o ...@@ -82,8 +82,11 @@ obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o
# Files generated that shall be removed upon make clean # Files generated that shall be removed upon make clean
clean-files := consolemap_deftbl.c defkeymap.c qtronixmap.c clean-files := consolemap_deftbl.c defkeymap.c qtronixmap.c
quiet_cmd_conmk = CONMK $@
cmd_conmk = scripts/conmakehash $< > $@
$(obj)/consolemap_deftbl.c: $(src)/$(FONTMAPFILE) $(obj)/consolemap_deftbl.c: $(src)/$(FONTMAPFILE)
$(call do_cmd,CONMK $@,$(objtree)/scripts/conmakehash $< > $@) $(call cmd,conmk)
$(obj)/defkeymap.o: $(obj)/defkeymap.c $(obj)/defkeymap.o: $(obj)/defkeymap.c
......
...@@ -42,16 +42,17 @@ endif ...@@ -42,16 +42,17 @@ endif
host-progs := gen-devlist host-progs := gen-devlist
# Files generated that shall be removed upon make clean
clean-files := devlist.h classlist.h
# Dependencies on generated files need to be listed explicitly # Dependencies on generated files need to be listed explicitly
$(obj)/names.o: $(obj)/devlist.h $(obj)/classlist.h $(obj)/names.o: $(obj)/devlist.h $(obj)/classlist.h
$(obj)/classlist.h: $(obj)/devlist.h
# And that's how to generate them # And that's how to generate them
quiet_cmd_devlist = DEVLIST $@
cmd_devlist = ( cd $(obj); ./gen-devlist ) < $<
$(obj)/devlist.h: $(src)/pci.ids $(obj)/gen-devlist $(obj)/devlist.h: $(src)/pci.ids $(obj)/gen-devlist
( cd $(obj); ./gen-devlist ) < $< $(call cmd,devlist)
# Files generated that shall be removed upon make clean
clean-files := devlist.h classlist.h
$(obj)/classlist.h: $(obj)/devlist.h
# #
# Makefile for some libs needed in the kernel. # Makefile for some libs needed in the kernel.
# #
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
lib-y := errno.o ctype.o string.o vsprintf.o cmdline.o \ lib-y := errno.o ctype.o string.o vsprintf.o cmdline.o \
...@@ -24,15 +20,18 @@ obj-$(CONFIG_CRC32) += crc32.o ...@@ -24,15 +20,18 @@ obj-$(CONFIG_CRC32) += crc32.o
obj-$(CONFIG_ZLIB_INFLATE) += zlib_inflate/ obj-$(CONFIG_ZLIB_INFLATE) += zlib_inflate/
obj-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate/ obj-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate/
include $(TOPDIR)/drivers/net/Makefile.lib include drivers/net/Makefile.lib
include $(TOPDIR)/drivers/usb/Makefile.lib include drivers/usb/Makefile.lib
include $(TOPDIR)/fs/Makefile.lib include fs/Makefile.lib
include $(TOPDIR)/net/bluetooth/bnep/Makefile.lib include net/bluetooth/bnep/Makefile.lib
host-progs := gen_crc32table host-progs := gen_crc32table
clean-files := crc32table.h clean-files := crc32table.h
$(obj)/crc32.o: $(obj)/crc32table.h $(obj)/crc32.o: $(obj)/crc32table.h
quiet_cmd_crc32 = GEN $@
cmd_crc32 = $< > $@
$(obj)/crc32table.h: $(obj)/gen_crc32table $(obj)/crc32table.h: $(obj)/gen_crc32table
./$< > $@ $(call cmd,crc32)
...@@ -227,24 +227,6 @@ if_changed_rule = $(if $(strip $? \ ...@@ -227,24 +227,6 @@ if_changed_rule = $(if $(strip $? \
cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
# do_cmd is a shorthand used to support both compressed, verbose
# and silent output in a single line.
# Compared to cmd described avobe, do_cmd does no rely on any variables
# previously assigned a value.
#
# Usage $(call do_cmd,CMD $@,cmd_to_execute bla bla)
# Example:
# $(call do_cmd,CP $@,cp -b $< $@)
# make -s => nothing will be printed
# make KBUILD_VERBOSE=1 => cp -b path/to/src.file path/to/dest.file
# make KBUILD_VERBOSE=0 => CP path/to/dest.file
define do_cmd
@$(if $(filter quiet_,$(quiet)), echo ' $(1)' &&,
$(if $(filter silent_,$(quiet)),,
echo "$(2)" &&)) \
$(2)
endef
# $(call descend,<dir>,<target>) # $(call descend,<dir>,<target>)
# Recursively call a sub-make in <dir> with target <target> # Recursively call a sub-make in <dir> with target <target>
# Usage is deprecated, because make do not see this as an invocation of make. # Usage is deprecated, because make do not see this as an invocation of make.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment