Commit bcb68b9b 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 eff95566 729586ea
......@@ -154,7 +154,6 @@ LOG := $(patsubst %.sgml, %.log, $(BOOKS))
OUT := $(patsubst %.sgml, %.out, $(BOOKS))
clean:
@echo 'Cleaning up (DocBook)'
@rm -f core *~
@rm -f $(BOOKS)
@rm -f $(DVI) $(AUX) $(TEX) $(LOG) $(OUT)
......@@ -162,7 +161,6 @@ clean:
@rm -f $(C-procfs-example)
mrproper:
@echo 'Making mrproper (DocBook)'
@rm -f $(PS) $(PDF)
@rm -f -r $(HTML) $(patsubst %.html,%,$(HTML))
......
......@@ -52,13 +52,6 @@ CROSS_COMPILE =
all: vmlinux
# Print entire command lines instead of short version
# For now, leave the default
ifndef KBUILD_VERBOSE
KBUILD_VERBOSE = 1
endif
# Decide whether to build built-in, modular, or both.
# Normally, just do built-in.
......@@ -105,12 +98,19 @@ export KBUILD_MODULES KBUILD_BUILTIN
# If it is set to "silent_", nothing wil be printed at all, since
# the variable $(silent_cmd_cc_o_c) doesn't exist.
# For now, leave verbose as default
ifndef KBUILD_VERBOSE
KBUILD_VERBOSE = 1
endif
MAKEFLAGS += --no-print-directory
# If the user wants quiet mode, echo short versions of the commands
# only and suppress the 'Entering/Leaving directory' messages
# only
ifneq ($(KBUILD_VERBOSE),1)
quiet=quiet_
MAKEFLAGS += --no-print-directory
endif
# If the user is running make -s (silent mode), suppress echoing of
......@@ -120,11 +120,18 @@ ifneq ($(findstring s,$(MAKEFLAGS)),)
quiet=silent_
endif
export quiet
export quiet KBUILD_VERBOSE
#
# Include the make variables (CC, etc...)
#
# Paths to obj / src tree
src := .
obj := .
srctree := .
objtree := .
export srctree objtree
# Make variables (CC, etc...)
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
......@@ -145,24 +152,21 @@ CFLAGS_MODULE = $(MODFLAGS)
AFLAGS_MODULE = $(MODFLAGS)
CFLAGS_KERNEL =
AFLAGS_KERNEL =
EXPORT_FLAGS =
NOSTDINC_FLAGS = -nostdinc -iwithprefix include
CPPFLAGS := -D__KERNEL__ -Iinclude
CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
-fomit-frame-pointer -fno-strict-aliasing -fno-common
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
CONFIG_SHELL TOPDIR HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS PERL
export CPPFLAGS EXPORT_FLAGS NOSTDINC_FLAGS OBJCOPYFLAGS
export CPPFLAGS NOSTDINC_FLAGS OBJCOPYFLAGS LDFLAGS
export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
src := .
obj := .
srctree := $(TOPDIR)
objtree := $(TOPDIR)
export srctree objtree
# The temporary file to save gcc -MD generated dependencies must not
# contain a comma
depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
......@@ -183,10 +187,46 @@ scripts/docproc scripts/fixdep scripts/split-include : scripts ;
.PHONY: scripts
scripts:
@$(MAKE) -C scripts
@$(call descend,scripts,)
# Objects we will link into vmlinux / subdirs we need to visit
# ---------------------------------------------------------------------------
init-y := init/
drivers-y := drivers/ sound/
net-y := net/
libs-y := lib/
core-y :=
SUBDIRS :=
ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
include-config := 1
-include .config
endif
include arch/$(ARCH)/Makefile
core-y += kernel/ mm/ fs/ ipc/ security/
SUBDIRS += $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \
$(net-y) $(net-m) $(libs-y) $(libs-m)))
ALL_SUBDIRS := $(SUBDIRS) $(patsubst %/,%,$(filter %/, $(init-n) $(init-) \
$(core-n) $(core-) $(drivers-n) $(drivers-) \
$(net-n) $(net-) $(libs-n) $(libs-)))
init-y := $(patsubst %/, %/built-in.o, $(init-y))
core-y := $(patsubst %/, %/built-in.o, $(core-y))
drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y))
net-y := $(patsubst %/, %/built-in.o, $(net-y))
libs-y := $(patsubst %/, %/lib.a, $(libs-y))
ifdef include-config
# Here goes the main Makefile
# ===========================================================================
#
......@@ -197,8 +237,6 @@ ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
# In this section, we need .config
-include .config
# If .config doesn't exist - tough luck
.config: arch/$(ARCH)/config.in $(shell find . -name Config.in)
......@@ -215,6 +253,10 @@ ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
@echo '***'
@exit 1
ifdef CONFIG_MODULES
export EXPORT_FLAGS := -DEXPORT_SYMTAB
endif
#
# INSTALL_PATH specifies where to place the updated kernel and system map
# images. Uncomment if you want to place them anywhere other than root.
......@@ -231,57 +273,6 @@ ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
MODLIB := $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
export MODLIB
#
# standard CFLAGS
#
CPPFLAGS := -D__KERNEL__ -I$(objtree)/include
CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
-fomit-frame-pointer -fno-strict-aliasing -fno-common
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
ifdef CONFIG_MODULES
EXPORT_FLAGS := -DEXPORT_SYMTAB
endif
# Link components for vmlinux
# ---------------------------------------------------------------------------
init-y := init/
drivers-y := drivers/ sound/
networks-y := net/
libs-y := lib/
CORE_FILES := kernel/built-in.o mm/built-in.o fs/built-in.o \
ipc/built-in.o security/built-in.o
SUBDIRS += kernel mm fs ipc security
include arch/$(ARCH)/Makefile
SUBDIRS += $(patsubst %/,%,$(filter %/, $(init-y) $(init-m)))
INIT += $(patsubst %/, %/built-in.o, $(init-y))
SUBDIRS += $(patsubst %/,%,$(filter %/, $(core-y) $(core-m)))
CORE_FILES := $(patsubst %/, %/built-in.o, $(core-y)) $(CORE_FILES)
SUBDIRS += $(patsubst %/,%,$(filter %/, $(drivers-y) $(drivers-m)))
DRIVERS += $(patsubst %/, %/built-in.o, $(drivers-y))
SUBDIRS += $(patsubst %/,%,$(filter %/, $(networks-y) $(networks-m)))
NETWORKS += $(patsubst %/, %/built-in.o, $(networks-y))
SUBDIRS += $(patsubst %/,%,$(filter %/, $(libs-y) $(libs-m)))
LIBS += $(patsubst %/, %/lib.a, $(libs-y))
export NETWORKS DRIVERS LIBS HEAD LDFLAGS MAKEBOOT
# boot target
# ---------------------------------------------------------------------------
boot: vmlinux
@$(MAKE) -C arch/$(ARCH)/boot
# Build vmlinux
# ---------------------------------------------------------------------------
......@@ -292,16 +283,16 @@ boot: vmlinux
# we cannot yet know if we will need to relink vmlinux.
# So we descend into init/ inside the rule for vmlinux again.
vmlinux-objs := $(HEAD) $(INIT) $(CORE_FILES) $(LIBS) $(DRIVERS) $(NETWORKS)
vmlinux-objs := $(HEAD) $(init-y) $(core-y) $(libs-y) $(drivers-y) $(net-y)
quiet_cmd_link_vmlinux = LD $@
define cmd_link_vmlinux
$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) $(HEAD) $(INIT) \
$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) $(HEAD) $(init-y) \
--start-group \
$(CORE_FILES) \
$(LIBS) \
$(DRIVERS) \
$(NETWORKS) \
$(core-y) \
$(libs-y) \
$(drivers-y) \
$(net-y) \
--end-group \
$(filter $(kallsyms.o),$^) \
-o $@
......@@ -314,7 +305,7 @@ define rule_vmlinux
echo ' Generating build number'
. scripts/mkversion > .tmp_version
mv -f .tmp_version .version
+$(MAKE) -C init
+$(call descend,init,)
$(call cmd,link_vmlinux)
echo 'cmd_$@ := $(cmd_link_vmlinux)' > $(@D)/.$(@F).cmd
$(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
......@@ -363,7 +354,7 @@ $(sort $(vmlinux-objs)): $(SUBDIRS) ;
.PHONY: $(SUBDIRS)
$(SUBDIRS): .hdepend prepare
@$(MAKE) -C $@
@$(call descend,$@,)
# Things we need done before we descend to build or make
# module versions are listed in "prepare"
......@@ -377,7 +368,7 @@ prepare: include/linux/version.h include/asm include/config/MARKER
AFLAGS_vmlinux.lds.o += -P -C -U$(ARCH)
arch/$(ARCH)/vmlinux.lds.s: arch/$(ARCH)/vmlinux.lds.S scripts FORCE
arch/$(ARCH)/vmlinux.lds.s: %.s: %.S scripts FORCE
$(call if_changed_dep,as_s_S)
targets += arch/$(ARCH)/vmlinux.lds.s
......@@ -386,17 +377,17 @@ targets += arch/$(ARCH)/vmlinux.lds.s
# ---------------------------------------------------------------------------
%.s: %.c FORCE
@$(MAKE) -C $(@D) $(@F)
@$(call descend,$(@D),$(@F))
%.i: %.c FORCE
@$(MAKE) -C $(@D) $(@F)
@$(call descend,$(@D),$(@F))
%.o: %.c FORCE
@$(MAKE) -C $(@D) $(@F)
@$(call descend,$(@D),$(@F))
%.lst: %.c FORCE
@$(MAKE) -C $(@D) $(@F)
@$(call descend,$(@D),$(@F))
%.s: %.S FORCE
@$(MAKE) -C $(@D) $(@F)
@$(call descend,$(@D),$(@F))
%.o: %.S FORCE
@$(MAKE) -C $(@D) $(@F)
@$(call descend,$(@D),$(@F))
# FIXME: The asm symlink changes when $(ARCH) changes. That's
# hard to detect, but I suppose "make mrproper" is a good idea
......@@ -481,7 +472,7 @@ include/linux/modversions.h: scripts/fixdep prepare FORCE
$(update-if-changed)
$(patsubst %,_sfdep_%,$(SUBDIRS)): FORCE
@$(MAKE) -C $(patsubst _sfdep_%, %, $@) fastdep
@$(call descend,$(patsubst _sfdep_%,%,$@),fastdep)
else # !CONFIG_MODVERSIONS
......@@ -499,7 +490,7 @@ ifdef CONFIG_MODULES
# Build modules
ifdef CONFIG_MODVERSIONS
MODFLAGS += -include $(objtree)/include/linux/modversions.h
MODFLAGS += -include include/linux/modversions.h
endif
.PHONY: modules
......@@ -533,7 +524,7 @@ _modinst_post:
.PHONY: $(patsubst %, _modinst_%, $(SUBDIRS))
$(patsubst %, _modinst_%, $(SUBDIRS)) :
@$(MAKE) -C $(patsubst _modinst_%, %, $@) modules_install
@$(call descend,$(patsubst _modinst_%,%,$@),modules_install)
else # CONFIG_MODULES
......@@ -597,7 +588,7 @@ rpm: clean spec
rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
rm $(TOPDIR)/../$(KERNELPATH).tar.gz
else # ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
else # ifdef include-config
ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
......@@ -631,11 +622,11 @@ ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
make_with_config
xconfig:
@$(MAKE) -C scripts kconfig.tk
@$(call descend,scripts,scripts/kconfig.tk)
wish -f scripts/kconfig.tk
menuconfig:
@$(MAKE) -C scripts lxdialog
@$(call descend,scripts,lxdialog)
$(CONFIG_SHELL) $(src)/scripts/Menuconfig arch/$(ARCH)/config.in
config:
......@@ -704,7 +695,7 @@ MRPROPER_FILES += \
.version .config* config.in config.old \
.menuconfig.log \
include/asm \
.hdepend $(TOPDIR)/include/linux/modversions.h \
.hdepend include/linux/modversions.h \
tags TAGS kernel.spec \
.tmp*
......@@ -712,11 +703,7 @@ MRPROPER_FILES += \
MRPROPER_DIRS += \
.tmp_export-objs \
include/config \
$(TOPDIR)/include/linux/modules
# That's our way to know about arch specific cleanup.
include arch/$(ARCH)/Makefile
include/linux/modules
clean: archclean
@echo 'Cleaning up'
......@@ -725,7 +712,7 @@ clean: archclean
-name .\*.tmp -o -name .\*.d \) -type f -print \
| grep -v lxdialog/ | xargs rm -f
@rm -f $(CLEAN_FILES)
@$(MAKE) -f Documentation/DocBook/Makefile clean
@$(call descend,Documentation/DocBook,clean)
mrproper: clean archmrproper
@echo 'Making mrproper'
......@@ -734,8 +721,8 @@ mrproper: clean archmrproper
-type f -print | xargs rm -f
@rm -rf $(MRPROPER_DIRS)
@rm -f $(MRPROPER_FILES)
@$(MAKE) -C scripts mrproper
@$(MAKE) -f Documentation/DocBook/Makefile mrproper
@$(call descend,scripts,mrproper)
@$(call descend,Documentation/DocBook,mrproper)
distclean: mrproper
@echo 'Making distclean'
......@@ -822,7 +809,7 @@ help:
# Documentation targets
# ---------------------------------------------------------------------------
sgmldocs psdocs pdfdocs htmldocs: scripts
@$(MAKE) -f Documentation/DocBook/Makefile $@
@$(call descend,Documentation/DocBook,$@)
# Scripts to check various things for consistency
# ---------------------------------------------------------------------------
......@@ -852,10 +839,11 @@ else # ifneq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
$(MAKE) $@
endif # ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
endif # ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
endif # ifdef include-config
# FIXME Should go into a make.lib or something
# ===========================================================================
echo_target = $@
a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(NOSTDINC_FLAGS) \
......@@ -909,5 +897,12 @@ define update-if-changed
fi
endef
# $(call descend,<dir>,<target>)
# Recursively call a sub-make in <dir> with target <target>
ifeq ($(KBUILD_VERBOSE),1)
descend = echo '$(MAKE) -f $(1)/Makefile $(2)';
endif
descend += $(MAKE) -f $(1)/Makefile obj=$(1) $(2)
FORCE:
......@@ -8,23 +8,38 @@ comma := ,
empty :=
space := $(empty) $(empty)
# Figure out paths
# Some bug traps
# ---------------------------------------------------------------------------
# Find the path relative to the toplevel dir, $(RELDIR), and express
# the toplevel dir as a relative path from this dir, $(TOPDIR_REL)
ifeq ($(findstring $(TOPDIR),$(CURDIR)),)
# Can only happen when something is built out of tree
RELDIR := $(CURDIR)
TOPDIR_REL := $(TOPDIR)
else
RELDIR := $(subst $(TOPDIR)/,,$(CURDIR))
TOPDIR_REL := $(subst $(space),,$(foreach d,$(subst /, ,$(RELDIR)),../))
ifdef O_TARGET
$(warning kbuild: Usage of O_TARGET is obsolete in 2.5. Please fix!
endif
ifdef L_TARGET
ifneq ($(L_TARGET),lib.a)
$(warning kbuild: L_TARGET ($(L_TARGET)) should be renamed to lib.a. Please fix!)
endif
endif
ifdef list-multi
$(warning kbuild: list-multi ($(list-multi)) is obsolete in 2.5. Please fix!)
endif
# Some paths for the Makefiles to use
# ---------------------------------------------------------------------------
# FIXME. For now, we leave it possible to use make -C or make -f
# to do work in subdirs.
ifndef obj
obj = .
CFLAGS := $(patsubst -I%,-I$(TOPDIR)/%,$(patsubst -I$(TOPDIR)/%,-I%,$(CFLAGS)))
AFLAGS := $(patsubst -I%,-I$(TOPDIR)/%,$(patsubst -I$(TOPDIR)/%,-I%,$(AFLAGS)))
endif
# For use in the quiet output
echo_target = $@
# Usage:
#
# $(obj)/target.o : target.o in the build dir
......@@ -41,12 +56,7 @@ endif
# We don't support separate source / object yet, so these are just
# placeholders for now
obj := .
src := .
# For use in the quiet output
echo_target = $(RELDIR)/$@
src := $(obj)
# Figure out what we need to build from the various variables
# ===========================================================================
......@@ -84,16 +94,8 @@ __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 $($(m:.o=-objs)), $(m))))
__multi-used-m := $(sort $(foreach m,$(__obj-m), $(if $($(m:.o=-objs)), $(m))))
# FIXME: Rip this out later
# Backwards compatibility: if a composite object is listed in
# $(list-multi), skip it here, since the Makefile will have an explicit
# link rule for it
multi-used-y := $(filter-out $(list-multi),$(__multi-used-y))
multi-used-m := $(filter-out $(list-multi),$(__multi-used-m))
multi-used-y := $(sort $(foreach m,$(__obj-y), $(if $($(m:.o=-objs)), $(m))))
multi-used-m := $(sort $(foreach m,$(__obj-m), $(if $($(m:.o=-objs)), $(m))))
# Build list of the parts of our composite objects, our composite
# objects depend on those (obviously)
......@@ -111,6 +113,21 @@ real-objs-m := $(foreach m, $(obj-m), $(if $($(m:.o=-objs)),$($(m:.o=-objs)),$(m
# Only build module versions for files which are selected to be built
export-objs := $(filter $(export-objs),$(real-objs-y) $(real-objs-m))
# 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))
# The temporary file to save gcc -MD generated dependencies must not
# contain a comma
depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
......@@ -136,15 +153,15 @@ ifeq ($(strip $(export-objs)),)
# If we don't export any symbols in this dir, just descend
# ---------------------------------------------------------------------------
fastdep: sub_dirs
@echo -n
fastdep: $(subdir-ym)
@/bin/true
else
# This sets version suffixes on exported symbols
# ---------------------------------------------------------------------------
MODVERDIR := $(TOPDIR)/include/linux/modules/$(RELDIR)
MODVERDIR := include/linux/modules/
#
# Added the SMP separator to stop module accidents between uniprocessor
......@@ -159,7 +176,7 @@ endif
# Don't include modversions.h, we're just about to generate it here.
CFLAGS_MODULE := $(filter-out -include $(HPATH)/linux/modversions.h,$(CFLAGS_MODULE))
CFLAGS_MODULE := $(filter-out -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)
......@@ -174,7 +191,7 @@ c_flags = -Wp,-MD,$(depfile) $(CFLAGS) $(NOSTDINC_FLAGS) \
# 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/$(RELDIR)/$*.ver
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
......@@ -206,9 +223,9 @@ $(MODVERDIR)/%.ver: %.c FORCE
targets := $(addprefix $(MODVERDIR)/,$(export-objs:.o=.ver))
fastdep: $(targets) sub_dirs
@mkdir -p $(TOPDIR)/.tmp_export-objs/modules/$(RELDIR)
@touch $(addprefix $(TOPDIR)/.tmp_export-objs/modules/$(RELDIR)/,$(export-objs:.o=.ver))
fastdep: $(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
......@@ -219,15 +236,17 @@ ifeq ($(MAKECMDGOALS),modules_install)
# Installing modules
# ==========================================================================
quiet_cmd_modules_install = INSTALL $(obj-m)
cmd_modules_install = mkdir -p $(MODLIB)/kernel/$(obj); \
cp $(obj-m) $(MODLIB)/kernel/$(obj)
.PHONY: modules_install
modules_install: sub_dirs
modules_install: $(subdir-ym)
ifneq ($(obj-m),)
@echo Installing modules in $(MODLIB)/kernel/$(RELDIR)
@mkdir -p $(MODLIB)/kernel/$(RELDIR)
@cp $(obj-m) $(MODLIB)/kernel/$(RELDIR)
$(call cmd,modules_install)
else
@echo -n
@/bin/true
endif
else # ! modules_install
......@@ -241,15 +260,18 @@ else # ! modules_install
ifndef O_TARGET
ifndef L_TARGET
O_TARGET := built-in.o
O_TARGET := $(obj)/built-in.o
endif
endif
# The echo suppresses the "Nothing to be done for first_rule"
ifdef L_TARGET
L_TARGET := $(obj)/$(L_TARGET)
endif
first_rule: $(if $(KBUILD_BUILTIN),$(O_TARGET) $(L_TARGET) $(EXTRA_TARGETS)) \
$(if $(KBUILD_MODULES),$(obj-m)) \
sub_dirs
@echo -n
$(subdir-ym)
@/bin/true
# Compile C sources (.c)
# ---------------------------------------------------------------------------
......@@ -324,7 +346,7 @@ targets += $(real-objs-y) $(real-objs-m) $(EXTRA_TARGETS) $(MAKECMDGOALS)
# ---------------------------------------------------------------------------
# To build objects in subdirs, we need to descend into the directories
$(sort $(subdir-obj-y)): sub_dirs ;
$(sort $(subdir-obj-y)): $(subdir-ym) ;
#
# Rule to compile a set of .o files into one .o file
......@@ -360,7 +382,7 @@ endif
#
quiet_cmd_link_multi = LD $(echo_target)
cmd_link_multi = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs),$^)
cmd_link_multi = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.o=-objs)))),$^)
# We would rather have a list of rules like
# foo.o: $(foo-objs)
......@@ -380,6 +402,9 @@ targets += $(multi-used-y) $(multi-used-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))
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))
quiet_cmd_host_cc__c = HOSTCC $(echo_target)
cmd_host_cc__c = $(HOSTCC) -Wp,-MD,$(depfile) \
......@@ -397,7 +422,7 @@ $(host-progs-multi-objs): %.o: %.c FORCE
$(call if_changed_dep,host_cc_o_c)
quiet_cmd_host_cc__o = HOSTLD $(echo_target)
cmd_host_cc__o = $(HOSTCC) $(HOSTLDFLAGS) -o $@ $($@-objs) \
cmd_host_cc__o = $(HOSTCC) $(HOSTLDFLAGS) -o $@ $(addprefix $(obj)/,$($(subst $(obj)/,,$@)-objs)) \
$(HOST_LOADLIBES)
$(host-progs-multi): %: $(host-progs-multi-objs) FORCE
......@@ -454,12 +479,10 @@ cmd_gzip = gzip -f -9 < $< > $@
# Descending
# ---------------------------------------------------------------------------
.PHONY: sub_dirs $(subdir-ym)
sub_dirs: $(subdir-ym)
.PHONY: $(subdir-ym)
$(subdir-ym):
@$(MAKE) -C $@ $(MAKECMDGOALS)
@$(call descend,$@,$(MAKECMDGOALS))
# Add FORCE to the prequisites of a target to force it to be always rebuilt.
# ---------------------------------------------------------------------------
......@@ -574,3 +597,10 @@ define do_cmd
$(2)
endef
# $(call descend,<dir>,<target>)
# Recursively call a sub-make in <dir> with target <target>
ifeq ($(KBUILD_VERBOSE),1)
descend = echo '$(MAKE) -f $(1)/Makefile $(2)';
endif
descend += $(MAKE) -f $(1)/Makefile obj=$(1) $(2)
......@@ -95,6 +95,8 @@ core-y += arch/alpha/kernel/ arch/alpha/mm/
core-$(CONFIG_MATHEMU) += arch/alpha/math-emu/
libs-y += arch/alpha/lib/
export libs-y
MAKEBOOT = $(MAKE) -C arch/alpha/boot
rawboot:
......
......@@ -20,7 +20,7 @@ BPOBJECTS = head.o bootp.o
TARGETS = vmlinux.gz tools/objstrip # also needed by aboot & milo
VMLINUX = $(TOPDIR)/vmlinux
OBJSTRIP = tools/objstrip
LIBS := $(patsubst lib/%,$(TOPDIR)/lib/%,$(LIBS))
LIBS := $(addprefix $(TOPDIR)/,$(libs-y))
all: $(TARGETS)
@echo Ready to install kernel in $(shell pwd)/vmlinux.gz
......
......@@ -98,8 +98,8 @@ core-y += arch/i386/kernel/ arch/i386/mm/ arch/i386/$(MACHINE)/
drivers-$(CONFIG_MATH_EMULATION) += arch/i386/math-emu/
drivers-$(CONFIG_PCI) += arch/i386/pci/
CFLAGS += -I$(TOPDIR)/arch/i386/$(MACHINE)
AFLAGS += -I$(TOPDIR)/arch/i386/$(MACHINE)
CFLAGS += -Iarch/i386/$(MACHINE)
AFLAGS += -Iarch/i386/$(MACHINE)
MAKEBOOT = +$(MAKE) -C arch/$(ARCH)/boot
......
......@@ -44,7 +44,7 @@ bzImage: IMAGE_OFFSET := 0x100000
bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
bzImage: BUILDFLAGS := -b
quiet_cmd_image = BUILD $(RELDIR)/$@
quiet_cmd_image = BUILD $(echo_target)
cmd_image = tools/build $(BUILDFLAGS) bootsect setup vmlinux.bin \
$(ROOT_DEV) > $@
......
......@@ -41,8 +41,7 @@ core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/
libs-y += arch/sparc/prom/ arch/sparc/lib/
# Export what is needed by arch/sparc/boot/Makefile
export CORE_FILES
export INIT
export init-y core-y drivers-y net-y libs-y HEAD
image: vmlinux
$(MAKE) -C arch/sparc/boot image
......
......@@ -22,9 +22,8 @@ btfixupprep: btfixupprep.c
clean:
rm -f btfixupprep piggyback tftpboot.img btfix.o btfix.s image
BTOBJS := $(HEAD) $(INIT)
BTLIBS := $(CORE_FILES) $(LIBS) \
$(DRIVERS) $(NETWORKS)
BTOBJS := $(HEAD) $(init-y)
BTLIBS := $(core-y) $(LIBS) $(drivers-y) $(net-y)
# Actual linking
image: btfix.o
......
......@@ -4,7 +4,7 @@
export ACPI_CFLAGS
ACPI_CFLAGS := -D_LINUX -I$(CURDIR)/include
ACPI_CFLAGS := -D_LINUX -Idrivers/acpi/include
ifdef CONFIG_ACPI_DEBUG
ACPI_CFLAGS += -DACPI_DEBUG_OUTPUT
......
......@@ -2,7 +2,8 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \
dsmethod.o dsobject.o dsutils.o dswload.o dswstate.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,8 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := evevent.o evregion.o evsci.o evxfevnt.o \
evmisc.o evrgnini.o evxface.o evxfregn.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,10 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := exconfig.o exfield.o exnames.o exoparg6.o exresolv.o exstorob.o\
exconvrt.o exfldio.o exoparg1.o exprep.o exresop.o exsystem.o\
excreate.o exmisc.o exoparg2.o exregion.o exstore.o exutils.o \
exdump.o exmutex.o exoparg3.o exresnte.o exstoren.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,7 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := hwacpi.o hwgpe.o hwregs.o hwsleep.o hwtimer.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,9 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := nsaccess.o nsdumpdv.o nsload.o nssearch.o nsxfeval.o \
nsalloc.o nseval.o nsnames.o nsutils.o nsxfname.o \
nsdump.o nsinit.o nsobject.o nswalk.o nsxfobj.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,8 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := psargs.o psparse.o pstree.o pswalk.o \
psopcode.o psscope.o psutils.o psxface.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,8 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := rsaddr.o rscreate.o rsio.o rslist.o rsmisc.o rsxface.o \
rscalc.o rsdump.o rsirq.o rsmemory.o rsutils.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,8 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := tbconvrt.o tbget.o tbrsdt.o tbxface.o \
tbgetall.o tbinstal.o tbutils.o tbxfroot.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,7 +2,8 @@
# Makefile for all Linux ACPI interpreter subdirectories
#
obj-$(CONFIG_ACPI_INTERPRETER) := $(patsubst %.c,%.o,$(wildcard *.c))
obj-y := utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \
utcopy.o utdelete.o utglobal.o utmath.o utobject.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......
......@@ -2,6 +2,6 @@
obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o
obj-$(CONFIG_BLK_DEV_IDE_RAPIDE) += rapide.o
EXTRA_CFLAGS := -I../
EXTRA_CFLAGS := -Idrivers/ide
include $(TOPDIR)/Rules.make
......@@ -17,6 +17,6 @@ obj-$(CONFIG_BLK_DEV_IDECS) += ide-cs.o
# Last of all
obj-$(CONFIG_BLK_DEV_HD) += hd.o
EXTRA_CFLAGS := -I../
EXTRA_CFLAGS := -Idrivers/ide
include $(TOPDIR)/Rules.make
......@@ -31,6 +31,6 @@ obj-$(CONFIG_BLK_DEV_VIA82CXXX) += via82cxxx.o
# Must appear at the end of the block
obj-$(CONFIG_BLK_DEV_GENERIC) += generic.o
EXTRA_CFLAGS := -I../
EXTRA_CFLAGS := -Idrivers/ide
include $(TOPDIR)/Rules.make
......@@ -3,6 +3,6 @@ obj-$(CONFIG_BLK_DEV_MPC8xx_IDE) += mpc8xx.o
obj-$(CONFIG_BLK_DEV_IDE_PMAC) += pmac.o
obj-$(CONFIG_BLK_DEV_IDE_SWARM) += swarm.o
EXTRA_CFLAGS := -I../
EXTRA_CFLAGS := -Idrivers/ide
include $(TOPDIR)/Rules.make
......@@ -63,7 +63,7 @@ hisax-objs-$(CONFIG_HISAX_ENTERNOW_PCI) += enternow_pci.o amd7930_fn.o
hisax-objs += $(hisax-objs-y)
CERT := $(shell md5sum -c md5sums.asc >> /dev/null;echo $$?)
CERT := $(shell cd $(src); md5sum -c md5sums.asc > /dev/null 2> /dev/null ;echo $$?)
CFLAGS_cert.o := -DCERTIFICATION=$(CERT)
include $(TOPDIR)/Rules.make
......@@ -27,7 +27,7 @@ int isdn_ppp_xmit(struct sk_buff *, struct net_device *);
#else
static inline int
isdn_ppp_xmit(struct sk_buff *, struct net_device *);
isdn_ppp_xmit(struct sk_buff *, struct net_device *)
{
return 0;
}
......
......@@ -13,7 +13,7 @@
# # sparc64
#EXTRA_CFLAGS += -gstabs+
EXTRA_CFLAGS += -I. ${MPT_CFLAGS}
EXTRA_CFLAGS += ${MPT_CFLAGS}
# Fusion MPT drivers; recognized debug defines...
# MPT general:
......
......@@ -55,7 +55,7 @@ endif
# SK_DBGCAT_DRV_INT_SRC 0x04000000 interrupts sources
# SK_DBGCAT_DRV_EVENT 0x08000000 driver events
EXTRA_CFLAGS += -I. -DSK_USE_CSUM $(DBGDEF)
EXTRA_CFLAGS += -Idrivers/net/sk98lin -DSK_USE_CSUM $(DBGDEF)
include $(TOPDIR)/Rules.make
......@@ -17,7 +17,7 @@ skfp-objs := skfddi.o hwmtm.o fplustm.o smt.o cfm.o \
# projects. To keep the source common for all those drivers (and
# thus simplify fixes to it), please do not clean it up!
EXTRA_CFLAGS += -I. -DPCI -DMEM_MAPPED_IO -Wno-strict-prototypes
EXTRA_CFLAGS += -Idrivers/net/skfp -DPCI -DMEM_MAPPED_IO -Wno-strict-prototypes
include $(TOPDIR)/Rules.make
......@@ -40,6 +40,6 @@ $(obj)/names.o: $(obj)/devlist.h $(obj)/classlist.h
# And that's how to generate them
$(obj)/devlist.h: $(src)/pci.ids $(obj)/gen-devlist
$(obj)/gen-devlist < $<
( cd $(obj); ./gen-devlist ) < $<
$(obj)/classlist.h: $(obj)/devlist.h
......@@ -7,6 +7,5 @@ obj-y := sbus.o dvma.o
endif
obj-$(CONFIG_SBUSCHAR) += char/
obj-$(CONFIG_SPARCAUDIO) += audio/
include $(TOPDIR)/Rules.make
......@@ -3,7 +3,5 @@
sym53c8xx-objs := sym_fw.o sym_glue.o sym_hipd.o sym_malloc.o sym_misc.o sym_nvram.o
obj-$(CONFIG_SCSI_SYM53C8XX_2) := sym53c8xx.o
EXTRA_CFLAGS += -I.
include $(TOPDIR)/Rules.make
......@@ -5,7 +5,7 @@
# Rewritten to use lists instead of if-statements.
#
EXTRA_CFLAGS := -I../../scsi/
EXTRA_CFLAGS := -Idrivers/scsi
obj-$(CONFIG_USB_STORAGE) += usb-storage.o
......
......@@ -18,4 +18,4 @@ $(obj)/names.o: $(obj)/devlist.h
# And that's how to generate them
$(obj)/devlist.h: $(src)/zorro.ids $(obj)/gen-devlist
$(obj)/gen-devlist < $<
( cd $(obj); ./gen-devlist ) < $<
......@@ -32,15 +32,10 @@
# Makefile for XFS on Linux.
#
# we also have source in the subdirectories..
vpath %.c = . linux pagebuf support
# This needs -I. because everything does #include <xfs.h> instead of "xfs.h".
# This needs -I because everything does #include <xfs.h> instead of "xfs.h".
# The code is wrong, local files should be included using "xfs.h", not <xfs.h>
# but I am not going to change every file at the moment.
EXTRA_CFLAGS += -I. -funsigned-char
EXTRA_CFLAGS += -Ifs/xfs -funsigned-char
ifeq ($(CONFIG_XFS_DEBUG),y)
EXTRA_CFLAGS += -g -DSTATIC="" -DDEBUG -DXFSDEBUG
......@@ -49,7 +44,8 @@ ifeq ($(CONFIG_PAGEBUF_DEBUG),y)
EXTRA_CFLAGS += -DPAGEBUF_TRACE
endif
export-objs := page_buf.o ktrace.o xfs_globals.o
export-objs := pagebuf/page_buf.o support/ktrace.o \
linux/xfs_globals.o
obj-$(CONFIG_XFS_FS) += xfs.o
......@@ -65,8 +61,8 @@ xfs-obj-$(CONFIG_XFS_QUOTA) += xfs_dquot.o \
xfs-obj-$(CONFIG_FS_POSIX_ACL) += xfs_acl.o
xfs-obj-$(CONFIG_FS_POSIX_CAP) += xfs_cap.o
xfs-obj-$(CONFIG_FS_POSIX_MAC) += xfs_mac.o
xfs-obj-$(CONFIG_PROC_FS) += xfs_stats.o
xfs-obj-$(CONFIG_SYSCTL) += xfs_sysctl.o
xfs-obj-$(CONFIG_PROC_FS) += linux/xfs_stats.o
xfs-obj-$(CONFIG_SYSCTL) += linux/xfs_sysctl.o
xfs-objs += $(xfs-obj-y) \
......@@ -118,11 +114,13 @@ xfs-objs += $(xfs-obj-y) \
xfs_rw.o
# Objects in pagebuf/
xfs-objs += page_buf.o \
page_buf_locking.o
xfs-objs += $(addprefix pagebuf/, \
page_buf.o \
page_buf_locking.o)
# Objects in linux/
xfs-objs += xfs_aops.o \
xfs-objs += $(addprefix linux/, \
xfs_aops.o \
xfs_behavior.o \
xfs_file.o \
xfs_fs_subr.o \
......@@ -131,16 +129,17 @@ xfs-objs += xfs_aops.o \
xfs_iops.o \
xfs_lrw.o \
xfs_super.o \
xfs_vnode.o
xfs_vnode.o)
# Objects in support/
xfs-objs += debug.o \
xfs-objs += $(addprefix support/, \
debug.o \
kmem.o \
ktrace.o \
move.o \
mrlock.o \
qsort.o \
uuid.o
uuid.o)
# If both xfs and kdb modules are built in then xfsidbg is built in. If xfs is
# a module and kdb modules are being compiled then xfsidbg must be a module, to
......@@ -155,6 +154,6 @@ ifneq ($(CONFIG_KDB_MODULES),)
endif
endif
CFLAGS_xfsidbg.o += -I $(TOPDIR)/arch/$(ARCH)/kdb
CFLAGS_xfsidbg.o += -Iarch/$(ARCH)/kdb
include $(TOPDIR)/Rules.make
......@@ -9,18 +9,18 @@
# conmakehash: Create arrays for initializing the kernel console tables
# tkparse: Used by xconfig
all: fixdep split-include docproc conmakehash __chmod
EXTRA_TARGETS := fixdep split-include docproc conmakehash
# Yikes. We need to build this stuff here even if the user only wants
# modules.
KBUILD_BUILTIN := 1
# The following temporary rule will make sure that people's
# trees get updated to the right permissions, since patch(1)
# can't do it
# ---------------------------------------------------------------------------
.PHONY: __chmod
__chmod: kernel-doc mkcompile_h makelst
@chmod a+x $^
host-progs := fixdep split-include conmakehash docproc tkparse
tkparse-objs := tkparse.o tkcond.o tkgen.o
......@@ -30,7 +30,7 @@ include $(TOPDIR)/Rules.make
# but it is not worth the effort to generate the dependencies.
# The alternative solution to always generate it is fairly fast.
# FORCE it to remake
$(obj)/kconfig.tk: $(srctree)/arch/$(ARCH)/config.in tkparse FORCE
$(obj)/kconfig.tk: $(srctree)/arch/$(ARCH)/config.in $(obj)/tkparse FORCE
@echo ' Generating $@'
@( \
if [ -f /usr/local/bin/wish ]; then \
......@@ -51,15 +51,13 @@ $(obj)/kconfig.tk: $(srctree)/arch/$(ARCH)/config.in tkparse FORCE
# Targets hardcoded and wellknow in top-level makefile
.PHONY: lxdialog
lxdialog:
$(MAKE) -C lxdialog all
$(call descend,scripts/lxdialog,)
# fixdep is needed to compile other host programs
$(obj)/split-include $(obj)/docproc $(addprefix $(obj)/,$(tkparse-objs)) \
$(obj)/conmakehash lxdialog: $(obj)/fixdep
mrproper:
@echo 'Making mrproper (scripts)'
@rm -f $(tkparse-objs) $(obj)/kconfig.tk
@rm -f core $(host-progs)
@$(MAKE) -C lxdialog mrproper
@rm -f $(addprefix $(obj)/,$(tkparse-objs) $(obj)/kconfig.tk core $(host-progs))
@$(call descend,scripts/lxdialog,mrproper)
......@@ -20,10 +20,14 @@ host-progs := lxdialog
lxdialog-objs := checklist.o menubox.o textbox.o yesno.o inputbox.o \
util.o lxdialog.o msgbox.o
all: ncurses lxdialog
EXTRA_TARGETS := lxdialog
first_rule: ncurses
include $(TOPDIR)/Rules.make
.PHONY: ncurses
ncurses:
@echo "main() {}" > lxtemp.c
@if $(HOSTCC) lxtemp.c $(HOST_LOADLIBES); then \
......@@ -40,4 +44,4 @@ ncurses:
fi
mrproper:
@rm -f core $(host-progs) $(lxdialog-objs) ncurses
@rm -f $(addprefix $(obj)/,core $(host-progs) $(lxdialog-objs) ncurses)
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