Commit afed1386 authored by Kai Germaschewski's avatar Kai Germaschewski

Merge tp1.ruhr-uni-bochum.de:/home/kai/src/kernel/v2.5/linux-2.5

into tp1.ruhr-uni-bochum.de:/home/kai/src/kernel/v2.5/linux-2.5.make
parents 5fe41502 c23e6bf0
...@@ -38,6 +38,8 @@ ARCH := $(SUBARCH) ...@@ -38,6 +38,8 @@ ARCH := $(SUBARCH)
KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g") KERNELPATH=kernel-$(shell echo $(KERNELRELEASE) | sed -e "s/-//g")
UTS_MACHINE := $(ARCH)
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \ else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi) else echo sh; fi ; fi)
...@@ -106,11 +108,20 @@ endif ...@@ -106,11 +108,20 @@ endif
MAKEFLAGS += --no-print-directory MAKEFLAGS += --no-print-directory
# For maximum performance (+ possibly random breakage, uncomment
# the following)
#MAKEFLAGS += -rR
# If the user wants quiet mode, echo short versions of the commands # If the user wants quiet mode, echo short versions of the commands
# only # only
ifneq ($(KBUILD_VERBOSE),1) ifeq ($(KBUILD_VERBOSE),1)
quiet =
Q =
else
quiet=quiet_ quiet=quiet_
Q = @
endif endif
# If the user is running make -s (silent mode), suppress echoing of # If the user is running make -s (silent mode), suppress echoing of
...@@ -120,7 +131,7 @@ ifneq ($(findstring s,$(MAKEFLAGS)),) ...@@ -120,7 +131,7 @@ ifneq ($(findstring s,$(MAKEFLAGS)),)
quiet=silent_ quiet=silent_
endif endif
export quiet KBUILD_VERBOSE export quiet Q KBUILD_VERBOSE
# Paths to obj / src tree # Paths to obj / src tree
...@@ -142,7 +153,6 @@ NM = $(CROSS_COMPILE)nm ...@@ -142,7 +153,6 @@ NM = $(CROSS_COMPILE)nm
STRIP = $(CROSS_COMPILE)strip STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump OBJDUMP = $(CROSS_COMPILE)objdump
MAKEFILES = .config
GENKSYMS = /sbin/genksyms GENKSYMS = /sbin/genksyms
DEPMOD = /sbin/depmod DEPMOD = /sbin/depmod
KALLSYMS = /sbin/kallsyms KALLSYMS = /sbin/kallsyms
...@@ -161,7 +171,7 @@ AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS) ...@@ -161,7 +171,7 @@ AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \ export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
CONFIG_SHELL TOPDIR HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ CONFIG_SHELL TOPDIR HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS PERL CPP AR NM STRIP OBJCOPY OBJDUMP MAKE GENKSYMS PERL UTS_MACHINE
export CPPFLAGS NOSTDINC_FLAGS OBJCOPYFLAGS LDFLAGS export CPPFLAGS NOSTDINC_FLAGS OBJCOPYFLAGS LDFLAGS
export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
...@@ -187,7 +197,7 @@ scripts/docproc scripts/fixdep scripts/split-include : scripts ; ...@@ -187,7 +197,7 @@ scripts/docproc scripts/fixdep scripts/split-include : scripts ;
.PHONY: scripts .PHONY: scripts
scripts: scripts:
+@$(call descend,scripts,) +@$(Q)$(MAKE) -f scripts/Makefile.build obj=scripts
# Objects we will link into vmlinux / subdirs we need to visit # Objects we will link into vmlinux / subdirs we need to visit
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -306,7 +316,7 @@ define rule_vmlinux__ ...@@ -306,7 +316,7 @@ define rule_vmlinux__
echo ' Generating build number' echo ' Generating build number'
. scripts/mkversion > .tmp_version . scripts/mkversion > .tmp_version
mv -f .tmp_version .version mv -f .tmp_version .version
+$(call descend,init,) $(Q)$(MAKE) -f scripts/Makefile.build obj=init
) )
$(call cmd,vmlinux__) $(call cmd,vmlinux__)
echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd
...@@ -365,7 +375,7 @@ $(sort $(vmlinux-objs)): $(SUBDIRS) ; ...@@ -365,7 +375,7 @@ $(sort $(vmlinux-objs)): $(SUBDIRS) ;
.PHONY: $(SUBDIRS) .PHONY: $(SUBDIRS)
$(SUBDIRS): .hdepend prepare $(SUBDIRS): .hdepend prepare
+@$(call descend,$@,) $(Q)$(MAKE) -f scripts/Makefile.build obj=$@
# Things we need done before we descend to build or make # Things we need done before we descend to build or make
# module versions are listed in "prepare" # module versions are listed in "prepare"
...@@ -388,17 +398,17 @@ targets += arch/$(ARCH)/vmlinux.lds.s ...@@ -388,17 +398,17 @@ targets += arch/$(ARCH)/vmlinux.lds.s
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
%.s: %.c scripts FORCE %.s: %.c scripts FORCE
+@$(call descend,$(@D),$@) $(Q)$(MAKE) -f scripts/Makefile.build obj=$(@D) $@
%.i: %.c scripts FORCE %.i: %.c scripts FORCE
+@$(call descend,$(@D),$@) $(Q)$(MAKE) -f scripts/Makefile.build obj=$(@D) $@
%.o: %.c scripts FORCE %.o: %.c scripts FORCE
+@$(call descend,$(@D),$@) $(Q)$(MAKE) -f scripts/Makefile.build obj=$(@D) $@
%.lst: %.c scripts FORCE %.lst: %.c scripts FORCE
+@$(call descend,$(@D),$@) $(Q)$(MAKE) -f scripts/Makefile.build obj=$(@D) $@
%.s: %.S scripts FORCE %.s: %.S scripts FORCE
+@$(call descend,$(@D),$@) $(Q)$(MAKE) -f scripts/Makefile.build obj=$(@D) $@
%.o: %.S scripts FORCE %.o: %.S scripts FORCE
+@$(call descend,$(@D),$@) $(Q)$(MAKE) -f scripts/Makefile.build obj=$(@D) $@
# FIXME: The asm symlink changes when $(ARCH) changes. That's # FIXME: The asm symlink changes when $(ARCH) changes. That's
# hard to detect, but I suppose "make mrproper" is a good idea # hard to detect, but I suppose "make mrproper" is a good idea
...@@ -472,9 +482,11 @@ ifdef CONFIG_MODVERSIONS ...@@ -472,9 +482,11 @@ ifdef CONFIG_MODVERSIONS
# Update modversions.h, but only if it would change. # Update modversions.h, but only if it would change.
include/linux/modversions.h: FORCE .PHONY: __rm_tmp_export-objs
__rm_tmp_export-objs:
@rm -rf .tmp_export-objs @rm -rf .tmp_export-objs
@$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS))
include/linux/modversions.h: $(patsubst %,_modver_%,$(SUBDIRS))
@echo -n ' Generating $@' @echo -n ' Generating $@'
@( echo "#ifndef _LINUX_MODVERSIONS_H";\ @( echo "#ifndef _LINUX_MODVERSIONS_H";\
echo "#define _LINUX_MODVERSIONS_H"; \ echo "#define _LINUX_MODVERSIONS_H"; \
...@@ -487,8 +499,9 @@ include/linux/modversions.h: FORCE ...@@ -487,8 +499,9 @@ include/linux/modversions.h: FORCE
) > $@.tmp; \ ) > $@.tmp; \
$(update-if-changed) $(update-if-changed)
$(patsubst %,_sfdep_%,$(SUBDIRS)): FORCE .PHONY: $(patsubst %, _modver_%, $(SUBDIRS))
+@$(call descend,$(patsubst _sfdep_%,%,$@),fastdep) $(patsubst %, _modver_%, $(SUBDIRS)): __rm_tmp_export-objs
$(Q)$(MAKE) -f scripts/Makefile.modver obj=$(patsubst _modver_%,%,$@)
else # !CONFIG_MODVERSIONS else # !CONFIG_MODVERSIONS
...@@ -540,8 +553,7 @@ _modinst_post: ...@@ -540,8 +553,7 @@ _modinst_post:
.PHONY: $(patsubst %, _modinst_%, $(SUBDIRS)) .PHONY: $(patsubst %, _modinst_%, $(SUBDIRS))
$(patsubst %, _modinst_%, $(SUBDIRS)) : $(patsubst %, _modinst_%, $(SUBDIRS)) :
+@$(call descend,$(patsubst _modinst_%,%,$@),modules_install) $(Q)$(MAKE) -f scripts/Makefile.modinst obj=$(patsubst _modinst_%,%,$@)
else # CONFIG_MODULES else # CONFIG_MODULES
# Modules not configured # Modules not configured
...@@ -638,11 +650,11 @@ ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),) ...@@ -638,11 +650,11 @@ ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
make_with_config make_with_config
xconfig: xconfig:
+@$(call descend,scripts,scripts/kconfig.tk) $(Q)$(MAKE) -f scripts/Makefile.build obj=scripts scripts/kconfig.tk
wish -f scripts/kconfig.tk wish -f scripts/kconfig.tk
menuconfig: menuconfig:
+@$(call descend,scripts,lxdialog) $(Q)$(MAKE) -f scripts/Makefile.build obj=scripts lxdialog
$(CONFIG_SHELL) $(src)/scripts/Menuconfig arch/$(ARCH)/config.in $(CONFIG_SHELL) $(src)/scripts/Menuconfig arch/$(ARCH)/config.in
config: config:
...@@ -698,7 +710,7 @@ MRPROPER_DIRS += \ ...@@ -698,7 +710,7 @@ MRPROPER_DIRS += \
clean-dirs += $(ALL_SUBDIRS) Documentation/DocBook scripts clean-dirs += $(ALL_SUBDIRS) Documentation/DocBook scripts
$(addprefix _clean_,$(clean-dirs)): $(addprefix _clean_,$(clean-dirs)):
$(MAKE) MAKEFILES= -rR -f scripts/Makefile.clean obj=$(patsubst _clean_%,%,$@) $(Q)$(MAKE) -f scripts/Makefile.clean obj=$(patsubst _clean_%,%,$@)
quiet_cmd_rmclean = RM $$(CLEAN_FILES) quiet_cmd_rmclean = RM $$(CLEAN_FILES)
cmd_rmclean = rm -f $(CLEAN_FILES) cmd_rmclean = rm -f $(CLEAN_FILES)
...@@ -798,7 +810,7 @@ help: ...@@ -798,7 +810,7 @@ help:
# Documentation targets # Documentation targets
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
sgmldocs psdocs pdfdocs htmldocs: scripts sgmldocs psdocs pdfdocs htmldocs: scripts
+@$(call descend,Documentation/DocBook,$@) $(Q)$(MAKE) -f Documentation/DocBook/Makefile $@
# Scripts to check various things for consistency # Scripts to check various things for consistency
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -833,12 +845,10 @@ endif # ifdef include-config ...@@ -833,12 +845,10 @@ endif # ifdef include-config
# FIXME Should go into a make.lib or something # FIXME Should go into a make.lib or something
# =========================================================================== # ===========================================================================
echo_target = $@
a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(NOSTDINC_FLAGS) \ a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(NOSTDINC_FLAGS) \
$(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
quiet_cmd_as_s_S = CPP $(echo_target) quiet_cmd_as_s_S = CPP $@
cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
# read all saved command lines # read all saved command lines
...@@ -885,13 +895,9 @@ define update-if-changed ...@@ -885,13 +895,9 @@ define update-if-changed
mv -f $@.tmp $@; \ mv -f $@.tmp $@; \
fi fi
endef 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>
ifeq ($(KBUILD_VERBOSE),1) descend = $(Q)$(MAKE) -f scripts/Makefile.build obj=$(1) $(2)
descend = echo '$(MAKE) -f $(1)/Makefile $(2)';
endif
descend += $(MAKE) -f $(1)/Makefile obj=$(1) $(2)
FORCE: FORCE:
This diff is collapsed.
...@@ -88,6 +88,6 @@ install: vmlinux ...@@ -88,6 +88,6 @@ install: vmlinux
+@$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) install) +@$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) install)
archclean: archclean:
$(MAKE) -rR -f scripts/Makefile.clean obj=arch/i386/boot @$(MAKE) -f scripts/Makefile.clean obj=arch/i386/boot
archmrproper: archmrproper:
...@@ -46,7 +46,7 @@ $(obj)/bzImage: IMAGE_OFFSET := 0x100000 ...@@ -46,7 +46,7 @@ $(obj)/bzImage: IMAGE_OFFSET := 0x100000
$(obj)/bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__ $(obj)/bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
$(obj)/bzImage: BUILDFLAGS := -b $(obj)/bzImage: BUILDFLAGS := -b
quiet_cmd_image = BUILD $(echo_target) quiet_cmd_image = BUILD $@
cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/bootsect $(obj)/setup \ cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/bootsect $(obj)/setup \
$(obj)/vmlinux.bin $(ROOT_DEV) > $@ $(obj)/vmlinux.bin $(ROOT_DEV) > $@
......
...@@ -46,7 +46,7 @@ $(obj)/bzImage: IMAGE_OFFSET := 0x100000 ...@@ -46,7 +46,7 @@ $(obj)/bzImage: IMAGE_OFFSET := 0x100000
$(obj)/bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__ $(obj)/bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
$(obj)/bzImage: BUILDFLAGS := -b $(obj)/bzImage: BUILDFLAGS := -b
quiet_cmd_image = BUILD $(echo_target) quiet_cmd_image = BUILD $@
cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/bootsect $(obj)/setup \ cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/bootsect $(obj)/setup \
$(obj)/vmlinux.bin $(ROOT_DEV) > $@ $(obj)/vmlinux.bin $(ROOT_DEV) > $@
......
...@@ -110,7 +110,7 @@ clean-files := consolemap_deftbl.c defkeymap.c qtronixmap.c ...@@ -110,7 +110,7 @@ clean-files := consolemap_deftbl.c defkeymap.c qtronixmap.c
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
$(obj)/consolemap_deftbl.c: $(src)/$(FONTMAPFILE) $(obj)/consolemap_deftbl.c: $(src)/$(FONTMAPFILE)
$(call do_cmd,CONMK $(echo_target),$(objtree)/scripts/conmakehash $< > $@) $(call do_cmd,CONMK $@,$(objtree)/scripts/conmakehash $< > $@)
$(obj)/defkeymap.o: $(obj)/defkeymap.c $(obj)/defkeymap.o: $(obj)/defkeymap.c
......
...@@ -15,7 +15,3 @@ obj-$(CONFIG_ISDN_DRV_ACT2000) += act2000/ ...@@ -15,7 +15,3 @@ obj-$(CONFIG_ISDN_DRV_ACT2000) += act2000/
obj-$(CONFIG_ISDN_DRV_EICON) += eicon/ obj-$(CONFIG_ISDN_DRV_EICON) += eicon/
obj-$(CONFIG_HYSDN) += hysdn/ obj-$(CONFIG_HYSDN) += hysdn/
obj-$(CONFIG_ISDN_DRV_TPAM) += tpam/ obj-$(CONFIG_ISDN_DRV_TPAM) += tpam/
# The global Rules.make.
include $(TOPDIR)/Rules.make
...@@ -7,5 +7,3 @@ obj-$(CONFIG_ISDN_DRV_ACT2000) += act2000.o ...@@ -7,5 +7,3 @@ obj-$(CONFIG_ISDN_DRV_ACT2000) += act2000.o
# Multipart objects. # Multipart objects.
act2000-objs := module.o capi.o act2000_isa.o act2000-objs := module.o capi.o act2000_isa.o
include $(TOPDIR)/Rules.make
...@@ -18,7 +18,3 @@ obj-$(CONFIG_ISDN_CAPI_CAPIFS) += capifs.o ...@@ -18,7 +18,3 @@ obj-$(CONFIG_ISDN_CAPI_CAPIFS) += capifs.o
kernelcapi-y := kcapi.o capiutil.o capilib.o kernelcapi-y := kcapi.o capiutil.o capilib.o
kernelcapi-$(CONFIG_PROC_FS) += kcapi_proc.o kernelcapi-$(CONFIG_PROC_FS) += kcapi_proc.o
kernelcapi-objs := $(kernelcapi-y) kernelcapi-objs := $(kernelcapi-y)
# The global Rules.make.
include $(TOPDIR)/Rules.make
...@@ -7,10 +7,3 @@ obj-$(CONFIG_ISDN_DIVERSION) += dss1_divert.o ...@@ -7,10 +7,3 @@ obj-$(CONFIG_ISDN_DIVERSION) += dss1_divert.o
# Multipart objects. # Multipart objects.
dss1_divert-objs := isdn_divert.o divert_procfs.o divert_init.o dss1_divert-objs := isdn_divert.o divert_procfs.o divert_init.o
include $(TOPDIR)/Rules.make
...@@ -23,5 +23,3 @@ eicon-objs-$(CONFIG_ISDN_DRV_EICON_PCI) += common.o idi.o bri.o pri.o log.o \ ...@@ -23,5 +23,3 @@ eicon-objs-$(CONFIG_ISDN_DRV_EICON_PCI) += common.o idi.o bri.o pri.o log.o \
linsys.o linio.o linsys.o linio.o
eicon-objs += $(eicon-objs-y) eicon-objs += $(eicon-objs-y)
include $(TOPDIR)/Rules.make
...@@ -4,7 +4,3 @@ ...@@ -4,7 +4,3 @@
obj-$(CONFIG_CAPI_AVM) += avm/ obj-$(CONFIG_CAPI_AVM) += avm/
obj-$(CONFIG_CAPI_EICON) += eicon/ obj-$(CONFIG_CAPI_EICON) += eicon/
# The global Rules.make.
include $(TOPDIR)/Rules.make
...@@ -13,7 +13,3 @@ obj-$(CONFIG_ISDN_DRV_AVMB1_AVM_CS) += avm_cs.o ...@@ -13,7 +13,3 @@ obj-$(CONFIG_ISDN_DRV_AVMB1_AVM_CS) += avm_cs.o
obj-$(CONFIG_ISDN_DRV_AVMB1_T1ISA) += t1isa.o b1.o obj-$(CONFIG_ISDN_DRV_AVMB1_T1ISA) += t1isa.o b1.o
obj-$(CONFIG_ISDN_DRV_AVMB1_T1PCI) += t1pci.o b1.o b1dma.o obj-$(CONFIG_ISDN_DRV_AVMB1_T1PCI) += t1pci.o b1.o b1dma.o
obj-$(CONFIG_ISDN_DRV_AVMB1_C4) += c4.o b1.o obj-$(CONFIG_ISDN_DRV_AVMB1_C4) += c4.o b1.o
# The global Rules.make.
include $(TOPDIR)/Rules.make
...@@ -26,6 +26,3 @@ obj-$(CONFIG_ISDN_DIVAS) += divadidd.o divas.o ...@@ -26,6 +26,3 @@ obj-$(CONFIG_ISDN_DIVAS) += divadidd.o divas.o
obj-$(CONFIG_ISDN_DIVAS_MAINT) += diva_mnt.o obj-$(CONFIG_ISDN_DIVAS_MAINT) += diva_mnt.o
obj-$(CONFIG_ISDN_DIVAS_USERIDI) += diva_idi.o obj-$(CONFIG_ISDN_DIVAS_USERIDI) += diva_idi.o
obj-$(CONFIG_ISDN_DIVAS_DIVACAPI) += divacapi.o obj-$(CONFIG_ISDN_DIVAS_DIVACAPI) += divacapi.o
include $(TOPDIR)/Rules.make
...@@ -65,5 +65,3 @@ hisax-objs += $(hisax-objs-y) ...@@ -65,5 +65,3 @@ hisax-objs += $(hisax-objs-y)
CERT := $(shell cd $(src); md5sum -c md5sums.asc > /dev/null 2> /dev/null ;echo $$?) CERT := $(shell cd $(src); md5sum -c md5sums.asc > /dev/null 2> /dev/null ;echo $$?)
CFLAGS_cert.o := -DCERTIFICATION=$(CERT) CFLAGS_cert.o := -DCERTIFICATION=$(CERT)
include $(TOPDIR)/Rules.make
...@@ -14,5 +14,3 @@ hysdn-objs := hysdn_procconf.o hysdn_proclog.o boardergo.o hysdn_boot.o \ ...@@ -14,5 +14,3 @@ hysdn-objs := hysdn_procconf.o hysdn_proclog.o boardergo.o hysdn_boot.o \
hysdn-objs-$(CONFIG_HYSDN_CAPI) += hycapi.o hysdn-objs-$(CONFIG_HYSDN_CAPI) += hycapi.o
hysdn-objs += $(hysdn-objs-y) hysdn-objs += $(hysdn-objs-y)
include $(TOPDIR)/Rules.make
...@@ -25,5 +25,3 @@ isdn-objs-$(CONFIG_ISDN_AUDIO) += isdn_audio.o ...@@ -25,5 +25,3 @@ isdn-objs-$(CONFIG_ISDN_AUDIO) += isdn_audio.o
isdn-objs-$(CONFIG_ISDN_TTY_FAX) += isdn_ttyfax.o isdn-objs-$(CONFIG_ISDN_TTY_FAX) += isdn_ttyfax.o
isdn-objs += $(isdn-objs-y) isdn-objs += $(isdn-objs-y)
include $(TOPDIR)/Rules.make
...@@ -3,5 +3,3 @@ ...@@ -3,5 +3,3 @@
# Each configuration option enables a list of files. # Each configuration option enables a list of files.
obj-$(CONFIG_ISDN_DRV_ICN) += icn.o obj-$(CONFIG_ISDN_DRV_ICN) += icn.o
include $(TOPDIR)/Rules.make
...@@ -5,6 +5,3 @@ ...@@ -5,6 +5,3 @@
# Each configuration option enables a list of files. # Each configuration option enables a list of files.
obj-$(CONFIG_ISDN_DRV_LOOP) += isdnloop.o obj-$(CONFIG_ISDN_DRV_LOOP) += isdnloop.o
include $(TOPDIR)/Rules.make
...@@ -7,5 +7,3 @@ obj-$(CONFIG_ISDN_DRV_PCBIT) += pcbit.o ...@@ -7,5 +7,3 @@ obj-$(CONFIG_ISDN_DRV_PCBIT) += pcbit.o
# Multipart objects. # Multipart objects.
pcbit-objs := module.o edss1.o drv.o layer2.o capi.o callbacks.o pcbit-objs := module.o edss1.o drv.o layer2.o capi.o callbacks.o
include $(TOPDIR)/Rules.make
...@@ -8,5 +8,3 @@ obj-$(CONFIG_ISDN_DRV_SC) += sc.o ...@@ -8,5 +8,3 @@ obj-$(CONFIG_ISDN_DRV_SC) += sc.o
sc-objs := shmem.o init.o debug.o packet.o command.o event.o \ sc-objs := shmem.o init.o debug.o packet.o command.o event.o \
ioctl.o interrupt.o message.o timer.o ioctl.o interrupt.o message.o timer.o
include $(TOPDIR)/Rules.make
...@@ -8,5 +8,3 @@ obj-$(CONFIG_ISDN_DRV_TPAM) += tpam.o ...@@ -8,5 +8,3 @@ obj-$(CONFIG_ISDN_DRV_TPAM) += tpam.o
tpam-objs := tpam_main.o tpam_nco.o tpam_memory.o tpam_commands.o \ tpam-objs := tpam_main.o tpam_nco.o tpam_memory.o tpam_commands.o \
tpam_queues.o tpam_hdlc.o tpam_crcpc.o tpam_queues.o tpam_hdlc.o tpam_crcpc.o
include $(TOPDIR)/Rules.make
...@@ -38,5 +38,5 @@ $(obj)/sm_hapn4800.o: $(obj)/sm_tbl_hapn4800.h ...@@ -38,5 +38,5 @@ $(obj)/sm_hapn4800.o: $(obj)/sm_tbl_hapn4800.h
$(obj)/sm_fsk9600.o: $(obj)/sm_tbl_fsk9600.h $(obj)/sm_fsk9600.o: $(obj)/sm_tbl_fsk9600.h
$(obj)/sm_tbl_%: $(obj)/gentbl $(obj)/sm_tbl_%: $(obj)/gentbl
$(obj)/gentbl cd $(obj) && ./gentbl
...@@ -24,8 +24,7 @@ endif ...@@ -24,8 +24,7 @@ endif
clean-files := aic7xxx_seq.h aic7xxx_reg.h clean-files := aic7xxx_seq.h aic7xxx_reg.h
# Command to be executed upon make clean # Command to be executed upon make clean
# Note: Assignment without ':' to force late evaluation of $(src) clean-rule := $(MAKE) -C $(src)/aicasm clean
clean-rule = @$(MAKE) -C $(src)/aicasm clean
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -39,7 +38,7 @@ ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y) ...@@ -39,7 +38,7 @@ ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y)
$(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg \ $(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg \
$(obj)/aicasm/aicasm $(obj)/aicasm/aicasm
$(obj)/aicasm/aicasm -I. -r $(obj)/aic7xxx_reg.h \ $(obj)/aicasm/aicasm -I$(obj) -r $(obj)/aic7xxx_reg.h \
-o $(obj)/aic7xxx_seq.h $(src)/aic7xxx.seq -o $(obj)/aic7xxx_seq.h $(src)/aic7xxx.seq
$(obj)/aic7xxx_reg.h: $(obj)/aix7xxx_seq.h $(obj)/aic7xxx_reg.h: $(obj)/aix7xxx_seq.h
......
...@@ -11,13 +11,13 @@ include $(TOPDIR)/Rules.make ...@@ -11,13 +11,13 @@ include $(TOPDIR)/Rules.make
# dependencies on generated files need to be listed explicitly # dependencies on generated files need to be listed explicitly
$(obj)/version.o: $(obj)/../include/linux/compile.h $(obj)/version.o: include/linux/compile.h
# compile.h changes depending on hostname, generation number, etc, # compile.h changes depending on hostname, generation number, etc,
# so we regenerate it always. # so we regenerate it always.
# mkcompile_h will make sure to only update the # mkcompile_h will make sure to only update the
# actual file if its content has changed. # actual file if its content has changed.
$(obj)/../include/linux/compile.h: FORCE include/linux/compile.h: FORCE
@echo -n ' Generating $(echo_target)' @echo -n ' Generating $@'
@sh $(srctree)/scripts/mkcompile_h $@ "$(ARCH)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)" @sh $(srctree)/scripts/mkcompile_h $@ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
...@@ -8,7 +8,6 @@ obj-$(CONFIG_ATALK) += appletalk.o ...@@ -8,7 +8,6 @@ obj-$(CONFIG_ATALK) += appletalk.o
appletalk-y := aarp.o ddp.o atalk_proc.o appletalk-y := aarp.o ddp.o atalk_proc.o
appletalk-$(CONFIG_SYSCTL) += sysctl_net_atalk.o appletalk-$(CONFIG_SYSCTL) += sysctl_net_atalk.o
appletalk-objs := $(appletalk-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -11,7 +11,6 @@ ax25-y := ax25_addr.o ax25_dev.o ax25_iface.o ax25_in.o ax25_ip.o ax25_out.o \ ...@@ -11,7 +11,6 @@ ax25-y := ax25_addr.o ax25_dev.o ax25_iface.o ax25_in.o ax25_ip.o ax25_out.o \
ax25_subr.o ax25_timer.o ax25_uid.o af_ax25.o ax25_subr.o ax25_timer.o ax25_uid.o af_ax25.o
ax25-$(CONFIG_AX25_DAMA_SLAVE) += ax25_ds_in.o ax25_ds_subr.o ax25_ds_timer.o ax25-$(CONFIG_AX25_DAMA_SLAVE) += ax25_ds_in.o ax25_ds_subr.o ax25_ds_timer.o
ax25-$(CONFIG_SYSCTL) += sysctl_net_ax25.o ax25-$(CONFIG_SYSCTL) += sysctl_net_ax25.o
ax25-objs := $(ax25-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -6,6 +6,5 @@ obj-$(CONFIG_BT_RFCOMM) += rfcomm.o ...@@ -6,6 +6,5 @@ obj-$(CONFIG_BT_RFCOMM) += rfcomm.o
rfcomm-y := core.o sock.o crc.o rfcomm-y := core.o sock.o crc.o
rfcomm-$(CONFIG_BT_RFCOMM_TTY) += tty.o rfcomm-$(CONFIG_BT_RFCOMM_TTY) += tty.o
rfcomm-objs := $(rfcomm-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -5,7 +5,6 @@ decnet-y := af_decnet.o dn_nsp_in.o dn_nsp_out.o dn_route.o dn_dev.o dn_neigh.o ...@@ -5,7 +5,6 @@ decnet-y := af_decnet.o dn_nsp_in.o dn_nsp_out.o dn_route.o dn_dev.o dn_neigh.o
decnet-$(CONFIG_DECNET_ROUTER) += dn_fib.o dn_rules.o dn_table.o decnet-$(CONFIG_DECNET_ROUTER) += dn_fib.o dn_rules.o dn_table.o
decnet-$(CONFIG_DECNET_FW) += dn_fw.o decnet-$(CONFIG_DECNET_FW) += dn_fw.o
decnet-y += sysctl_net_decnet.o decnet-y += sysctl_net_decnet.o
decnet-objs := $(decnet-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -6,6 +6,5 @@ obj-$(CONFIG_IPX) += ipx.o ...@@ -6,6 +6,5 @@ obj-$(CONFIG_IPX) += ipx.o
ipx-y := af_ipx.o ipx_proc.o ipx-y := af_ipx.o ipx_proc.o
ipx-$(CONFIG_SYSCTL) += sysctl_net_ipx.o ipx-$(CONFIG_SYSCTL) += sysctl_net_ipx.o
ipx-objs := $(ipx-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -15,6 +15,5 @@ irda-y := iriap.o iriap_event.o irlmp.o irlmp_event.o irlmp_frame.o \ ...@@ -15,6 +15,5 @@ irda-y := iriap.o iriap_event.o irlmp.o irlmp_event.o irlmp_frame.o \
discovery.o parameters.o irsyms.o discovery.o parameters.o irsyms.o
irda-$(CONFIG_PROC_FS) += irproc.o irda-$(CONFIG_PROC_FS) += irproc.o
irda-$(CONFIG_SYSCTL) += irsysctl.o irda-$(CONFIG_SYSCTL) += irsysctl.o
irda-objs := $(irda-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -18,7 +18,6 @@ llc-y := llc_if.o llc_c_ev.o llc_c_ac.o llc_mac.o llc_sap.o llc_s_st.o \ ...@@ -18,7 +18,6 @@ llc-y := llc_if.o llc_c_ev.o llc_c_ac.o llc_mac.o llc_sap.o llc_s_st.o \
llc_main.o llc_s_ac.o llc_conn.o llc_c_st.o llc_stat.o llc_actn.o \ llc_main.o llc_s_ac.o llc_conn.o llc_c_st.o llc_stat.o llc_actn.o \
llc_s_ev.o llc_evnt.o llc_pdu.o llc_proc.o llc_s_ev.o llc_evnt.o llc_pdu.o llc_proc.o
llc-$(CONFIG_LLC_UI) += af_llc.o llc-$(CONFIG_LLC_UI) += af_llc.o
llc-objs := $(llc-y)
# Objects that export symbols. # Objects that export symbols.
export-objs := llc_if.o export-objs := llc_if.o
......
...@@ -7,7 +7,6 @@ obj-$(CONFIG_NETROM) += netrom.o ...@@ -7,7 +7,6 @@ obj-$(CONFIG_NETROM) += netrom.o
netrom-y := af_netrom.o nr_dev.o nr_in.o nr_loopback.o \ netrom-y := af_netrom.o nr_dev.o nr_in.o nr_loopback.o \
nr_out.o nr_route.o nr_subr.o nr_timer.o nr_out.o nr_route.o nr_subr.o nr_timer.o
netrom-$(CONFIG_SYSCTL) += sysctl_net_netrom.o netrom-$(CONFIG_SYSCTL) += sysctl_net_netrom.o
netrom-objs := $(netrom-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -7,7 +7,6 @@ obj-$(CONFIG_ROSE) += rose.o ...@@ -7,7 +7,6 @@ obj-$(CONFIG_ROSE) += rose.o
rose-y := af_rose.o rose_dev.o rose_in.o rose_link.o rose_loopback.o \ rose-y := af_rose.o rose_dev.o rose_in.o rose_link.o rose_loopback.o \
rose_out.o rose_route.o rose_subr.o rose_timer.o rose_out.o rose_route.o rose_subr.o rose_timer.o
rose-$(CONFIG_SYSCTL) += sysctl_net_rose.o rose-$(CONFIG_SYSCTL) += sysctl_net_rose.o
rose-objs := $(rose-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -23,6 +23,4 @@ sctp-$(CONFIG_SYSCTL) += sysctl.o ...@@ -23,6 +23,4 @@ sctp-$(CONFIG_SYSCTL) += sysctl.o
sctp-$(subst m,y,$(CONFIG_IPV6)) += ipv6.o sctp-$(subst m,y,$(CONFIG_IPV6)) += ipv6.o
sctp-objs := $(sctp-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -13,6 +13,5 @@ sunrpc-y := clnt.o xprt.o sched.o \ ...@@ -13,6 +13,5 @@ sunrpc-y := clnt.o xprt.o sched.o \
sunrpc_syms.o cache.o sunrpc_syms.o cache.o
sunrpc-$(CONFIG_PROC_FS) += stats.o sunrpc-$(CONFIG_PROC_FS) += stats.o
sunrpc-$(CONFIG_SYSCTL) += sysctl.o sunrpc-$(CONFIG_SYSCTL) += sysctl.o
sunrpc-objs := $(sunrpc-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -6,7 +6,6 @@ obj-$(CONFIG_UNIX) += unix.o ...@@ -6,7 +6,6 @@ obj-$(CONFIG_UNIX) += unix.o
unix-y := af_unix.o garbage.o unix-y := af_unix.o garbage.o
unix-$(CONFIG_SYSCTL) += sysctl_net_unix.o unix-$(CONFIG_SYSCTL) += sysctl_net_unix.o
unix-objs := $(unix-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -8,7 +8,6 @@ x25-y := af_x25.o x25_dev.o x25_facilities.o x25_in.o \ ...@@ -8,7 +8,6 @@ x25-y := af_x25.o x25_dev.o x25_facilities.o x25_in.o \
x25_link.o x25_out.o x25_route.o x25_subr.o \ x25_link.o x25_out.o x25_route.o x25_subr.o \
x25_timer.o x25_proc.o x25_timer.o x25_proc.o
x25-$(CONFIG_SYSCTL) += sysctl_net_x25.o x25-$(CONFIG_SYSCTL) += sysctl_net_x25.o
x25-objs := $(x25-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
# ==========================================================================
# Building
# ==========================================================================
src := $(obj)
.PHONY: __build
__build:
include .config
include $(obj)/Makefile
include scripts/Makefile.lib
ifdef O_TARGET
$(error kbuild: $(obj)/Makefile - Usage of O_TARGET := $(O_TARGET) is obsolete in 2.5. Please fix!)
endif
ifdef L_TARGET
ifneq ($(L_TARGET),lib.a)
$(warning kbuild: $(obj)/Makefile - L_TARGET := $(L_TARGET) target shall be renamed to lib.a. Please fix!)
endif
endif
ifdef list-multi
$(warning kbuild: $(obj)/Makefile - list-multi := $(list-multi) is obsolete in 2.5. Please fix!)
endif
ifndef obj
$(warning kbuild: Makefile.build is included improperly)
endif
# ===========================================================================
# If a Makefile does not define a L_TARGET, link an object called "built-in.o"
ifdef L_TARGET
L_TARGET := $(obj)/$(L_TARGET)
else
O_TARGET := $(obj)/built-in.o
endif
__build: $(if $(KBUILD_BUILTIN),$(O_TARGET) $(L_TARGET) $(EXTRA_TARGETS)) \
$(if $(KBUILD_MODULES),$(obj-m)) \
$(subdir-ym)
@:
# Compile C sources (.c)
# ---------------------------------------------------------------------------
# Default is built-in, unless we know otherwise
modkern_cflags := $(CFLAGS_KERNEL)
$(real-objs-m) : modkern_cflags := $(CFLAGS_MODULE)
$(real-objs-m:.o=.i) : modkern_cflags := $(CFLAGS_MODULE)
$(real-objs-m:.o=.lst): modkern_cflags := $(CFLAGS_MODULE)
$(export-objs) : export_flags := $(EXPORT_FLAGS)
$(export-objs:.o=.i) : export_flags := $(EXPORT_FLAGS)
$(export-objs:.o=.s) : export_flags := $(EXPORT_FLAGS)
$(export-objs:.o=.lst): export_flags := $(EXPORT_FLAGS)
c_flags = -Wp,-MD,$(depfile) $(CFLAGS) $(NOSTDINC_FLAGS) \
$(modkern_cflags) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) \
-DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) \
$(export_flags)
quiet_cmd_cc_s_c = CC $@
cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $<
%.s: %.c FORCE
$(call if_changed_dep,cc_s_c)
quiet_cmd_cc_i_c = CPP $@
cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<
%.i: %.c FORCE
$(call if_changed_dep,cc_i_c)
quiet_cmd_cc_o_c = CC $@
cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
%.o: %.c FORCE
$(call if_changed_dep,cc_o_c)
quiet_cmd_cc_lst_c = MKLST $@
cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && sh scripts/makelst $*.o System.map $(OBJDUMP) > $@
%.lst: %.c FORCE
$(call if_changed_dep,cc_lst_c)
# Compile assembler sources (.S)
# ---------------------------------------------------------------------------
modkern_aflags := $(AFLAGS_KERNEL)
$(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE)
$(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)
a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(NOSTDINC_FLAGS) \
$(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
quiet_cmd_as_s_S = CPP $@
cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
%.s: %.S FORCE
$(call if_changed_dep,as_s_S)
quiet_cmd_as_o_S = AS $@
cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
%.o: %.S FORCE
$(call if_changed_dep,as_o_S)
targets += $(real-objs-y) $(real-objs-m) $(EXTRA_TARGETS) $(MAKECMDGOALS)
# Build the compiled-in targets
# ---------------------------------------------------------------------------
# To build objects in subdirs, we need to descend into the directories
$(sort $(subdir-obj-y)): $(subdir-ym) ;
#
# Rule to compile a set of .o files into one .o file
#
ifdef O_TARGET
quiet_cmd_link_o_target = LD $@
# If the list of objects to link is empty, just create an empty O_TARGET
cmd_link_o_target = $(if $(strip $(obj-y)),\
$(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^),\
rm -f $@; $(AR) rcs $@)
$(O_TARGET): $(obj-y) FORCE
$(call if_changed,link_o_target)
targets += $(O_TARGET)
endif # O_TARGET
#
# Rule to compile a set of .o files into one .a file
#
ifdef L_TARGET
quiet_cmd_link_l_target = AR $@
cmd_link_l_target = rm -f $@; $(AR) $(EXTRA_ARFLAGS) rcs $@ $(obj-y)
$(L_TARGET): $(obj-y) FORCE
$(call if_changed,link_l_target)
targets += $(L_TARGET)
endif
#
# Rule to link composite objects
#
quiet_cmd_link_multi = LD $@
cmd_link_multi = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.o=-objs))) $($(subst $(obj)/,,$(@:.o=-y)))),$^)
# We would rather have a list of rules like
# foo.o: $(foo-objs)
# but that's not so easy, so we rather make all composite objects depend
# on the set of all their parts
$(multi-used-y) : %.o: $(multi-objs-y) FORCE
$(call if_changed,link_multi)
$(multi-used-m) : %.o: $(multi-objs-m) FORCE
$(call if_changed,link_multi)
targets += $(multi-used-y) $(multi-used-m)
# Compile programs on the host
# ===========================================================================
quiet_cmd_host_cc__c = HOSTCC $@
cmd_host_cc__c = $(HOSTCC) -Wp,-MD,$(depfile) \
$(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \
$(HOST_LOADLIBES) -o $@ $<
$(host-progs-single): %: %.c FORCE
$(call if_changed_dep,host_cc__c)
quiet_cmd_host_cc_o_c = HOSTCC $@
cmd_host_cc_o_c = $(HOSTCC) -Wp,-MD,$(depfile) \
$(HOSTCFLAGS) $(HOST_EXTRACFLAGS) -c -o $@ $<
$(host-progs-multi-objs): %.o: %.c FORCE
$(call if_changed_dep,host_cc_o_c)
quiet_cmd_host_cc__o = HOSTLD $@
cmd_host_cc__o = $(HOSTCC) $(HOSTLDFLAGS) -o $@ $(addprefix $(obj)/,$($(subst $(obj)/,,$@)-objs)) \
$(HOST_LOADLIBES)
$(host-progs-multi): %: $(host-progs-multi-objs) FORCE
$(call if_changed,host_cc__o)
targets += $(host-progs-single) $(host-progs-multi-objs) $(host-progs-multi)
# Descending
# ---------------------------------------------------------------------------
.PHONY: $(subdir-ym)
$(subdir-ym):
$(Q)$(MAKE) -f scripts/Makefile.build obj=$@
# Add FORCE to the prequisites of a target to force it to be always rebuilt.
# ---------------------------------------------------------------------------
.PHONY: FORCE
FORCE:
# Read all saved command lines and dependencies for the $(targets) we
# may be building above, using $(if_changed{,_dep}). As an
# optimization, we don't need to read them if the target does not
# exist, we will rebuild anyway in that case.
targets := $(wildcard $(sort $(targets)))
cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
ifneq ($(cmd_files),)
include $(cmd_files)
endif
# ==========================================================================
# Cleaning up
# ==========================================================================
src := $(obj) src := $(obj)
no-rules.make := 1
.PHONY: __clean .PHONY: __clean
__clean: __clean:
include $(obj)/Makefile include $(obj)/Makefile
# Figure out what we need to build from the various variables
# ==========================================================================
__subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y))) __subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
subdir-y += $(__subdir-y) subdir-y += $(__subdir-y)
__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m))) __subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))
...@@ -17,26 +21,43 @@ subdir-n += $(__subdir-n) ...@@ -17,26 +21,43 @@ subdir-n += $(__subdir-n)
__subdir- := $(patsubst %/,%,$(filter %/, $(obj-))) __subdir- := $(patsubst %/,%,$(filter %/, $(obj-)))
subdir- += $(__subdir-) subdir- += $(__subdir-)
# Subdirectories we need to descend into
subdir-ym := $(sort $(subdir-y) $(subdir-m)) subdir-ym := $(sort $(subdir-y) $(subdir-m))
subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-)) subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-))
# Add subdir path
EXTRA_TARGETS := $(addprefix $(obj)/,$(EXTRA_TARGETS)) EXTRA_TARGETS := $(addprefix $(obj)/,$(EXTRA_TARGETS))
clean-files := $(addprefix $(obj)/,$(clean-files)) clean-files := $(addprefix $(obj)/,$(clean-files))
host-progs := $(addprefix $(obj)/,$(host-progs)) host-progs := $(addprefix $(obj)/,$(host-progs))
subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn)) subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn))
# ==========================================================================
__clean-files := $(wildcard $(EXTRA_TARGETS) $(host-progs) $(clean-files)) __clean-files := $(wildcard $(EXTRA_TARGETS) $(host-progs) $(clean-files))
quiet_cmd_clean = CLEAN $(obj)
cmd_clean = rm -f $(__clean-files); $(clean-rule)
__clean: $(subdir-ymn) __clean: $(subdir-ymn)
ifneq ($(strip $(__clean-files) $(clean-rule)),) ifneq ($(strip $(__clean-files) $(clean-rule)),)
rm -f $(__clean-files) +$(call cmd,clean)
$(clean-rule)
else else
@: @:
endif endif
.PHONY: $(subdir-ymn) # ===========================================================================
# Generic stuff
# ===========================================================================
# Descending
# ---------------------------------------------------------------------------
.PHONY: $(subdir-ymn)
$(subdir-ymn): $(subdir-ymn):
$(MAKE) -rR -f scripts/Makefile.clean obj=$@ $(Q)$(MAKE) -f scripts/Makefile.clean obj=$@
# If quiet is set, only print short version of command
cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
# ===========================================================================
# kbuild: Generic definitions
# ===========================================================================
# Standard vars
comma := ,
# Figure out what we need to build from the various variables
# ===========================================================================
# When an object is listed to be built compiled-in and modular,
# only build the compiled-in version
obj-m := $(filter-out $(obj-y),$(obj-m))
# Handle objects in subdirs
# ---------------------------------------------------------------------------
# o if we encounter foo/ in $(obj-y), replace it by foo/built-in.o
# and add the directory to the list of dirs to descend into: $(subdir-y)
# o if we encounter foo/ in $(obj-m), remove it from $(obj-m)
# and add the directory to the list of dirs to descend into: $(subdir-m)
__subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
subdir-y += $(__subdir-y)
__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))
subdir-m += $(__subdir-m)
obj-y := $(patsubst %/, %/built-in.o, $(obj-y))
obj-m := $(filter-out %/, $(obj-m))
# Subdirectories we need to descend into
subdir-ym := $(sort $(subdir-y) $(subdir-m))
# export.o is never a composite object, since $(export-objs) has a
# fixed meaning (== objects which EXPORT_SYMBOL())
__obj-y = $(filter-out export.o,$(obj-y))
__obj-m = $(filter-out export.o,$(obj-m))
# if $(foo-objs) exists, foo.o is a composite object
multi-used-y := $(sort $(foreach m,$(__obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
multi-used-m := $(sort $(foreach m,$(__obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
# Build list of the parts of our composite objects, our composite
# objects depend on those (obviously)
multi-objs-y := $(foreach m, $(multi-used-y), $($(m:.o=-objs)) $($(m:.o=-y)))
multi-objs-m := $(foreach m, $(multi-used-m), $($(m:.o=-objs)) $($(m:.o=-y)))
# $(subdir-obj-y) is the list of objects in $(obj-y) which do not live
# in the local directory
subdir-obj-y := $(foreach o,$(obj-y),$(if $(filter-out $(o),$(notdir $(o))),$(o)))
# Replace multi-part objects by their individual parts, look at local dir only
real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(EXTRA_TARGETS)
real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))
# Only build module versions for files which are selected to be built
export-objs := $(filter $(export-objs),$(real-objs-y) $(real-objs-m))
host-progs-single := $(foreach m,$(host-progs),$(if $($(m)-objs),,$(m)))
host-progs-multi := $(foreach m,$(host-progs),$(if $($(m)-objs),$(m)))
host-progs-multi-objs := $(foreach m,$(host-progs-multi),$($(m)-objs))
# Add subdir path
EXTRA_TARGETS := $(addprefix $(obj)/,$(EXTRA_TARGETS))
obj-y := $(addprefix $(obj)/,$(obj-y))
obj-m := $(addprefix $(obj)/,$(obj-m))
export-objs := $(addprefix $(obj)/,$(export-objs))
subdir-obj-y := $(addprefix $(obj)/,$(subdir-obj-y))
real-objs-y := $(addprefix $(obj)/,$(real-objs-y))
real-objs-m := $(addprefix $(obj)/,$(real-objs-m))
multi-used-y := $(addprefix $(obj)/,$(multi-used-y))
multi-used-m := $(addprefix $(obj)/,$(multi-used-m))
multi-objs-y := $(addprefix $(obj)/,$(multi-objs-y))
multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m))
subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
host-progs := $(addprefix $(obj)/,$(host-progs))
host-progs-single := $(addprefix $(obj)/,$(host-progs-single))
host-progs-multi := $(addprefix $(obj)/,$(host-progs-multi))
host-progs-multi-objs := $(addprefix $(obj)/,$(host-progs-multi-objs))
# The temporary file to save gcc -MD generated dependencies must not
# contain a comma
depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
# Shipped files
# ===========================================================================
quiet_cmd_shipped = SHIPPED $@
cmd_shipped = cat $< > $@
%:: %_shipped
$(call cmd,shipped)
# Commands useful for building a boot image
# ===========================================================================
#
# Use as following:
#
# target: source(s) FORCE
# $(if_changed,ld/objcopy/gzip)
#
# and add target to EXTRA_TARGETS so that we know we have to
# read in the saved command line
# Linking
# ---------------------------------------------------------------------------
quiet_cmd_ld = LD $@
cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \
$(filter-out FORCE,$^) -o $@
# Objcopy
# ---------------------------------------------------------------------------
quiet_cmd_objcopy = OBJCOPY $@
cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $< $@
# Gzip
# ---------------------------------------------------------------------------
quiet_cmd_gzip = GZIP $@
cmd_gzip = gzip -f -9 < $< > $@
# ===========================================================================
# Generic stuff
# ===========================================================================
# function to only execute the passed command if necessary
if_changed = $(if $(strip $? \
$(filter-out $(cmd_$(1)),$(cmd_$@))\
$(filter-out $(cmd_$@),$(cmd_$(1)))),\
@set -e; \
$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \
$(cmd_$(1)); \
echo 'cmd_$@ := $(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)))),\
@set -e; \
$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \
$(cmd_$(1)); \
scripts/fixdep $(depfile) $@ '$(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_$@))\
$(filter-out $(cmd_$@),$(cmd_$(1)))),\
@set -e; \
mkdir -p $(dir $@); \
$(rule_$(1)))
# If quiet is set, only print short version of command
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>)
# Recursively call a sub-make in <dir> with target <target>
descend = $(Q)$(MAKE) -f scripts/Makefile.build obj=$(1) $(2)
# ==========================================================================
# Installing modules
# ==========================================================================
src := $(obj)
.PHONY: modules_install
modules_install:
include .config
include $(obj)/Makefile
include scripts/Makefile.lib
# ==========================================================================
quiet_cmd_modules_install = INSTALL $(obj-m)
cmd_modules_install = mkdir -p $(MODLIB)/kernel/$(obj); \
cp $(obj-m) $(MODLIB)/kernel/$(obj)
modules_install: $(subdir-ym)
ifneq ($(obj-m),)
$(call cmd,modules_install)
else
@:
endif
# Descending
# ---------------------------------------------------------------------------
.PHONY: $(subdir-ym)
$(subdir-ym):
$(Q)$(MAKE) -rR -f scripts/Makefile.modinst obj=$@
# ===========================================================================
# Module versions
# ===========================================================================
src := $(obj)
.PHONY: modver
modver:
include .config
include $(obj)/Makefile
include scripts/Makefile.lib
# ===========================================================================
ifeq ($(strip $(export-objs)),)
# If we don't export any symbols in this dir, just descend
# ---------------------------------------------------------------------------
modver: $(subdir-ym)
@:
else
# This sets version suffixes on exported symbols
# ---------------------------------------------------------------------------
MODVERDIR := include/linux/modules
#
# Added the SMP separator to stop module accidents between uniprocessor
# and SMP Intel boxes - AC - from bits by Michael Chastain
#
ifdef CONFIG_SMP
genksyms_smp_prefix := -p smp_
else
genksyms_smp_prefix :=
endif
# Don't include modversions.h, we're just about to generate it here.
CFLAGS_MODULE := $(filter-out -include include/linux/modversions.h,$(CFLAGS_MODULE))
$(addprefix $(MODVERDIR)/,$(real-objs-y:.o=.ver)): modkern_cflags := $(CFLAGS_KERNEL)
$(addprefix $(MODVERDIR)/,$(real-objs-m:.o=.ver)): modkern_cflags := $(CFLAGS_MODULE)
$(addprefix $(MODVERDIR)/,$(export-objs:.o=.ver)): export_flags := -D__GENKSYMS__
c_flags = -Wp,-MD,$(depfile) $(CFLAGS) $(NOSTDINC_FLAGS) \
$(modkern_cflags) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) \
-DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) \
$(export_flags)
# Our objects only depend on modversions.h, not on the individual .ver
# files (fix-dep filters them), so touch modversions.h if any of the .ver
# files changes
quiet_cmd_cc_ver_c = MKVER include/linux/modules/$*.ver
cmd_cc_ver_c = $(CPP) $(c_flags) $< | $(GENKSYMS) $(genksyms_smp_prefix) \
-k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp
# Okay, let's explain what's happening in rule_make_cc_ver_c:
# o echo the command
# o execute the command
# o If the $(CPP) fails, we won't notice because it's output is piped
# to $(GENKSYMS) which does not fail. We recognize this case by
# looking if the generated $(depfile) exists, though.
# o If the .ver file changed, touch modversions.h, which is our marker
# of any changed .ver files.
# o Move command line and deps into their normal .*.cmd place.
define rule_cc_ver_c
$(if $($(quiet)cmd_cc_ver_c),echo ' $($(quiet)cmd_cc_ver_c)';) \
$(cmd_cc_ver_c); \
if [ ! -r $(depfile) ]; then exit 1; fi; \
scripts/fixdep $(depfile) $@ '$(cmd_cc_ver_c)' > $(@D)/.$(@F).tmp; \
rm -f $(depfile); \
if [ ! -r $@ ] || cmp -s $@ $@.tmp; then \
touch include/linux/modversions.h; \
fi; \
mv -f $@.tmp $@
mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd
endef
targets := $(addprefix $(MODVERDIR)/,$(export-objs:.o=.ver))
$(MODVERDIR)/%.ver: %.c FORCE
@$(call if_changed_rule,cc_ver_c)
modver: $(targets) $(subdir-ym)
@mkdir -p $(dir $(addprefix .tmp_export-objs/modules/,$(export-objs:.o=.ver)))
@touch $(addprefix .tmp_export-objs/modules/,$(export-objs:.o=.ver))
endif # export-objs
# Descending
# ---------------------------------------------------------------------------
.PHONY: $(subdir-ym)
$(subdir-ym):
$(Q)$(MAKE) -f scripts/Makefile.modver obj=$@
# Add FORCE to the prequisites of a target to force it to be always rebuilt.
# ---------------------------------------------------------------------------
.PHONY: FORCE
FORCE:
# Read all saved command lines and dependencies for the $(targets) we
# may be building above, using $(if_changed{,_dep}). As an
# optimization, we don't need to read them if the target does not
# exist, we will rebuild anyway in that case.
targets := $(wildcard $(sort $(targets)))
cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
ifneq ($(cmd_files),)
include $(cmd_files)
endif
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