|
From: Kenn H. <ke...@us...> - 2003-01-26 23:21:00
|
Update of /cvsroot/linux-vax/kernel-2.5
In directory sc8-pr-cvs1:/tmp/cvs-serv17108
Modified Files:
Makefile Rules.make
Log Message:
Merge with 2.5.23
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.5/Makefile,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- Makefile 25 Jan 2003 00:33:31 -0000 1.28
+++ Makefile 26 Jan 2003 23:20:56 -0000 1.29
@@ -1,6 +1,6 @@
VERSION = 2
PATCHLEVEL = 5
-SUBLEVEL = 22
+SUBLEVEL = 23
EXTRAVERSION =
# We are using a recursive build, so we need to do a little thinking
@@ -145,7 +145,8 @@
.config:
@echo '***'
@echo '*** You have not yet configured your kernel!'
- @echo '*** Please run "make xconfig/menuconfig/config/oldconfig"'
+ @echo '*** Please run some configurator (do "make xconfig" or'
+ @echo '*** "make menuconfig" or "make oldconfig" or "make config").'
@echo '***'
@exit 1
@@ -330,18 +331,16 @@
# The targets are still named depend / dep for traditional
# reasons, but the only thing we do here is generating
# the module version checksums.
-# FIXME: For now, we are also calling "archdep" from here,
-# which should be replaced by a more sensible solution.
.PHONY: depend dep $(patsubst %,_sfdep_%,$(SUBDIRS))
depend dep: .hdepend
# .hdepend is our (misnomed) marker for whether we've run
-# generated module versions and made archdep
+# generated module versions
.hdepend: $(if $(filter dep depend,$(MAKECMDGOALS)),FORCE)
- @$(MAKE) archdep include/linux/modversions.h
+ @$(MAKE) include/linux/modversions.h
@touch $@
ifdef CONFIG_MODVERSIONS
@@ -420,8 +419,8 @@
else # CONFIG_MODULES
-# ---------------------------------------------------------------------------
# Modules not configured
+# ---------------------------------------------------------------------------
modules modules_install: FORCE
@echo
@@ -433,6 +432,25 @@
endif # CONFIG_MODULES
+# Generate asm-offsets.h
+# ---------------------------------------------------------------------------
+
+define generate-asm-offsets.h
+ (set -e; \
+ echo "#ifndef __ASM_OFFSETS_H__"; \
+ echo "#define __ASM_OFFSETS_H__"; \
+ echo "/*"; \
+ echo " * DO NOT MODIFY."; \
+ echo " *"; \
+ echo " * This file was generated by arch/$(ARCH)/Makefile"; \
+ echo " *"; \
+ echo " */"; \
+ echo ""; \
+ sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
+ echo ""; \
+ echo "#endif" )
+endef
+
# RPM target
# ---------------------------------------------------------------------------
@@ -461,6 +479,8 @@
else # ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
+ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
+
# Targets which don't need .config
# ===========================================================================
#
@@ -519,23 +539,6 @@
defconfig:
yes '' | $(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
-# How we generate .config depends on which *config the
-# user chose when calling make
-
-.config: $(filter oldconfig xconfig menuconfig config,$(MAKECMDGOALS)) ;
-
-# If the user gave commands from both the need / need not
-# .config sections, we need to call make again after
-# .config is generated, now to take care of the remaining
-# targets we know nothing about in this section
-
-remaining_targets := $(filter-out $(noconfig_targets),$(MAKECMDGOALS))
-
-$(remaining_targets) : make_with_config
-
-make_with_config: .config
- @$(MAKE) $(remaining_targets)
-
# Cleaning up
# ---------------------------------------------------------------------------
@@ -604,7 +607,8 @@
mrproper: clean archmrproper
@echo 'Making mrproper'
- @find . \( -size 0 -o -name .depend \) -type f -print | xargs rm -f
+ @find . \( -size 0 -o -name .depend -o -name .\*.cmd \) \
+ -type f -print | xargs rm -f
@rm -f $(MRPROPER_FILES)
@rm -rf $(MRPROPER_DIRS)
@$(MAKE) -C Documentation/DocBook mrproper
@@ -639,8 +643,6 @@
@$(MAKE) -C Documentation/DocBook $@
-endif # ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
-
# Scripts to check various things for consistency
# ---------------------------------------------------------------------------
@@ -652,6 +654,18 @@
checkincludes:
find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkincludes.pl
+
+else # ifneq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
+
+# We're called with both targets which do and do not need
+# .config included. Handle them one after the other.
+# ===========================================================================
+
+%:: FORCE
+ $(MAKE) $@
+
+endif # ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
+endif # ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
# FIXME Should go into a make.lib or something
# ===========================================================================
Index: Rules.make
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.5/Rules.make,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Rules.make 25 Jan 2003 00:33:31 -0000 1.14
+++ Rules.make 26 Jan 2003 23:20:56 -0000 1.15
@@ -131,9 +131,13 @@
genksyms_smp_prefix :=
endif
-$(MODVERDIR)/$(real-objs-y:.o=.ver): modkern_cflags := $(CFLAGS_KERNEL)
-$(MODVERDIR)/$(real-objs-m:.o=.ver): modkern_cflags := $(CFLAGS_MODULE)
-$(MODVERDIR)/$(export-objs:.o=.ver): export_flags := -D__GENKSYMS__
+# Don't include modversions.h, we're just about to generate it here.
+
+CFLAGS_MODULE := $(filter-out -include $(HPATH)/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) \
@@ -145,18 +149,34 @@
# files changes
quiet_cmd_cc_ver_c = MKVER include/linux/modules/$(RELDIR)/$*.ver
-define cmd_cc_ver_c
- mkdir -p $(dir $@); \
- $(CPP) $(c_flags) $< | $(GENKSYMS) $(genksyms_smp_prefix) \
- -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp; \
+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 maker
+# 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; \
+ $(TOPDIR)/scripts/fixdep $(depfile) $@ $(TOPDIR) '$(cmd_cc_ver_c)' > $(@D)/.$(@F).tmp; \
+ rm -f $(depfile); \
if [ ! -r $@ ] || cmp -s $@ $@.tmp; then \
touch $(TOPDIR)/include/linux/modversions.h; \
fi; \
mv -f $@.tmp $@
+ mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd
endef
$(MODVERDIR)/%.ver: %.c FORCE
- @$(call if_changed_dep,cc_ver_c)
+ @$(call if_changed_rule,cc_ver_c)
targets := $(addprefix $(MODVERDIR)/,$(export-objs:.o=.ver))
@@ -449,7 +469,7 @@
# execute the command and also postprocess generated .d dependencies
# file
-if_changed_dep = $(if $(strip $? \
+if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\
$(filter-out $(cmd_$(1)),$(cmd_$@))\
$(filter-out $(cmd_$@),$(cmd_$(1)))),\
@set -e; \
@@ -458,6 +478,17 @@
$(TOPDIR)/scripts/fixdep $(depfile) $@ $(TOPDIR) '$(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
|