Commit 8876c643 authored by Kai Germaschewski's avatar Kai Germaschewski

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

into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make.next
parents fa82a1da 0633cab8
......@@ -49,7 +49,7 @@ Card) hardware, for example, you probably needn't concern yourself
with pcmcia-cs.
o Gnu C 2.95.3 # gcc --version
o Gnu make 3.77 # make --version
o Gnu make 3.78 # make --version
o binutils 2.9.5.0.25 # ld -v
o util-linux 2.10o # fdformat --version
o modutils 2.4.2 # insmod -V
......
......@@ -12,17 +12,30 @@ EPS-parportbook := $(patsubst %.fig, %.eps, $(IMG-parportbook))
PNG-parportbook := $(patsubst %.fig, %.png, $(IMG-parportbook))
C-procfs-example = procfs_example.sgml
books: $(BOOKS)
$(TOPDIR)/scripts/docgen: dummy
chmod 755 $(TOPDIR)/scripts/docgen
$(BOOKS): $(TOPDIR)/scripts/docproc
$(TOPDIR)/scripts/gen-all-syms: dummy
chmod 755 $(TOPDIR)/scripts/gen-all-syms
.PHONY: books ps pdf html clean mrproper
$(TOPDIR)/scripts/kernel-doc: dummy
chmod 755 $(TOPDIR)/scripts/kernel-doc
ps: $(PS)
$(TOPDIR)/scripts/docproc: dummy
$(MAKE) -C $(TOPDIR)/scripts docproc
$(BOOKS): $(TOPDIR)/scripts/docgen $(TOPDIR)/scripts/gen-all-syms \
$(TOPDIR)/scripts/kernel-doc $(TOPDIR)/scripts/docproc
.PHONY: sgmldocs psdocs pdfdocs htmldocs clean mrproper
sgmldocs: $(BOOKS)
pdf: $(PDF)
psdocs: $(PS)
html: $(HTML)
pdfdocs: $(PDF)
htmldocs: $(HTML)
%.eps: %.fig
fig2dev -Leps $< $@
......@@ -39,9 +52,6 @@ html: $(HTML)
echo "</programlisting>" >> $@
$(TOPDIR)/scripts/docproc:
$(MAKE) -C $(TOPDIR)/scripts docproc
mousedrivers.sgml: mousedrivers.tmpl
$(TOPDIR)/scripts/docgen <$< >$@
......@@ -131,7 +141,7 @@ APISOURCES := $(TOPDIR)/drivers/media/video/videodev.c \
$(TOPDIR)/lib/string.c \
$(TOPDIR)/lib/vsprintf.c \
$(TOPDIR)/net/netsyms.c
kernel-api.sgml: kernel-api.tmpl $(APISOURCES)
$(TOPDIR)/scripts/docgen $(APISOURCES) \
<kernel-api.tmpl >kernel-api.sgml
......
This diff is collapsed.
......@@ -49,27 +49,28 @@ SUB_DIRS := $(subdir-y)
MOD_SUB_DIRS := $(sort $(subdir-m) $(both-m))
ALL_SUB_DIRS := $(sort $(subdir-y) $(subdir-m) $(subdir-n) $(subdir-))
#
# Common rules
#
%.s: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(CFLAGS_$@) -S $< -o $@
# export_flags will be set to -DEXPORT_SYMBOL for objects in $(export-objs)
%.i: %.c
$(CPP) $(CFLAGS) $(EXTRA_CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(CFLAGS_$@) $< > $@
c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(export_flags)
%.o: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(CFLAGS_$@) -c -o $@ $<
@ ( \
echo 'ifeq ($(strip $(subst $(comma),:,$(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@))),$$(strip $$(subst $$(comma),:,$$(CFLAGS) $$(EXTRA_CFLAGS) $$(CFLAGS_$@))))' ; \
echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
echo 'endif' \
) > $(dir $@)/.$(notdir $@).flags
cmd_cc_s_c = $(CC) $(c_flags) -S $< -o $@
%.o: %.s
$(AS) $(AFLAGS) $(EXTRA_CFLAGS) -o $@ $<
%.s: %.c dummy
$(call if_changed,cmd_cc_s_c)
cmd_cc_i_c = $(CPP) $(c_flags) $< > $@
%.i: %.c dummy
$(call if_changed,cmd_cc_i_c)
cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
%.o: %.c dummy
$(call if_changed,cmd_cc_o_c)
# Old makefiles define their own rules for compiling .S files,
# but these standard rules are available for any Makefile that
......@@ -77,16 +78,26 @@ ALL_SUB_DIRS := $(sort $(subdir-y) $(subdir-m) $(subdir-n) $(subdir-))
# the Makefiles to these standard rules. -- rmk, mec
ifdef USE_STANDARD_AS_RULE
%.s: %.S
$(CPP) $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@) $< > $@
a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@)
cmd_as_s_S = $(CPP) $(a_flags) $< > $@
%.s: %.S dummy
$(call if_changed,cmd_as_s_S)
%.o: %.S
$(CC) $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@) -c -o $@ $<
cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
%.o: %.S dummy
$(call if_changed,cmd_as_o_S)
endif
# FIXME is anybody using this rule? Why does it have EXTRA_CFLAGS?
%.o: %.s
$(AS) $(AFLAGS) $(EXTRA_CFLAGS) -o $@ $<
%.lst: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -g -c -o $*.o $<
$(CC) $(c_flags) -g -c -o $*.o $<
$(TOPDIR)/scripts/makelst $* $(TOPDIR) $(OBJDUMP)
#
#
......@@ -97,66 +108,61 @@ all_targets: $(O_TARGET) $(L_TARGET)
# Rule to compile a set of .o files into one .o file
#
ifdef O_TARGET
$(O_TARGET): $(obj-y)
rm -f $@
ifneq "$(strip $(obj-y))" ""
$(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^)
else
$(AR) rcs $@
endif
@ ( \
echo 'ifeq ($(strip $(subst $(comma),:,$(EXTRA_LDFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(EXTRA_LDFLAGS) $$(obj-y))))' ; \
echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
echo 'endif' \
) > $(dir $@)/.$(notdir $@).flags
# If the list of objects to link is empty, just create an empty O_TARGET
cmd_link_o_target = $(if $(strip $(obj-y)),\
$(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^),\
rm -f $@; $(AR) rcs $@)
$(O_TARGET): $(obj-y) dummy
$(call if_changed,cmd_link_o_target)
endif # O_TARGET
#
# Rule to compile a set of .o files into one .a file
#
ifdef L_TARGET
$(L_TARGET): $(obj-y)
rm -f $@
$(AR) $(EXTRA_ARFLAGS) rcs $@ $(obj-y)
@ ( \
echo 'ifeq ($(strip $(subst $(comma),:,$(EXTRA_ARFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(EXTRA_ARFLAGS) $$(obj-y))))' ; \
echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
echo 'endif' \
) > $(dir $@)/.$(notdir $@).flags
cmd_link_l_target = rm -f $@; $(AR) $(EXTRA_ARFLAGS) rcs $@ $(obj-y)
$(L_TARGET): $(obj-y) dummy
$(call if_changed,cmd_link_l_target)
endif
#
# Rule to link composite objects
#
# for make >= 3.78 the following is cleaner:
# multi-used := $(foreach m,$(obj-y) $(obj-m), $(if $($(basename $(m))-objs), $(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))
multi-used-y := $(sort $(foreach m,$(__obj-y),$(patsubst %,$(m),$($(basename $(m))-objs))))
multi-used-m := $(sort $(foreach m,$(__obj-m),$(patsubst %,$(m),$($(basename $(m))-objs))))
ld-multi-used-y := $(filter-out $(list-multi),$(multi-used-y))
ld-multi-used-m := $(filter-out $(list-multi),$(multi-used-m))
ld-multi-objs-y := $(foreach m, $(ld-multi-used-y), $($(basename $(m))-objs))
ld-multi-objs-m := $(foreach m, $(ld-multi-used-m), $($(basename $(m))-objs))
$(ld-multi-used-y) : %.o: $(ld-multi-objs-y)
rm -f $@
$(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs), $^)
@ ( \
echo 'ifeq ($(strip $(subst $(comma),:,$(LD) $(EXTRA_LDFLAGS) $($(basename $@)-objs)),$$(strip $$(subst $$(comma),:,$$(LD) $$(EXTRA_LDFLAGS) $$($(basename $@)-objs)))))' ; \
echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
echo 'endif' \
) > $(dir $@)/.$(notdir $@).flags
$(ld-multi-used-m) : %.o: $(ld-multi-objs-m)
rm -f $@
$(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs), $^)
@ ( \
echo 'ifeq ($(strip $(subst $(comma),:,$(LD) $(EXTRA_LDFLAGS) $($(basename $@)-objs)),$$(strip $$(subst $$(comma),:,$$(LD) $$(EXTRA_LDFLAGS) $$($(basename $@)-objs)))))' ; \
echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
echo 'endif' \
) > $(dir $@)/.$(notdir $@).flags
# if $(foo-objs) exists, foo.o is a composite object
__multi-used-y := $(sort $(foreach m,$(__obj-y), $(if $($(basename $(m))-objs), $(m))))
__multi-used-m := $(sort $(foreach m,$(__obj-m), $(if $($(basename $(m))-objs), $(m))))
# 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))
# Build list of the parts of our composite objects, our composite
# objects depend on those (obviously)
multi-objs-y := $(foreach m, $(multi-used-y), $($(basename $(m))-objs))
multi-objs-m := $(foreach m, $(multi-used-m), $($(basename $(m))-objs))
cmd_link_multi = $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs),$^)
# 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) dummy
$(call if_changed,cmd_link_multi)
$(multi-used-m) : %.o: $(multi-objs-m) dummy
$(call if_changed,cmd_link_multi)
#
# This make dependencies quickly
......@@ -306,14 +312,10 @@ $(TOPDIR)/include/linux/modversions.h:
endif # CONFIG_MODVERSIONS
ifneq "$(strip $(export-objs))" ""
$(export-objs): $(TOPDIR)/include/linux/modversions.h
$(export-objs): %.o: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(CFLAGS_$@) -DEXPORT_SYMTAB -c $(@:.o=.c)
@ ( \
echo 'ifeq ($(strip $(subst $(comma),:,$(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -DEXPORT_SYMTAB)),$$(strip $$(subst $$(comma),:,$$(CFLAGS) $$(EXTRA_CFLAGS) $$(CFLAGS_$@) -DEXPORT_SYMTAB)))' ; \
echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
echo 'endif' \
) > $(dir $@)/.$(notdir $@).flags
$(export-objs): export_flags := -DEXPORT_SYMTAB
endif
endif # CONFIG_MODULES
......@@ -330,35 +332,48 @@ ifneq ($(wildcard $(TOPDIR)/.hdepend),)
include $(TOPDIR)/.hdepend
endif
# ---------------------------------------------------------------------------
# Check if command line has changed
# Usage:
# normally one uses rules like
#
# Find files whose flags have changed and force recompilation.
# For safety, this works in the converse direction:
# every file is forced, except those whose flags are positively up-to-date.
# %.o: %.c
# <command line>
#
FILES_FLAGS_UP_TO_DATE :=
# However, these only rebuild the target when the source has changed,
# but not when e.g. the command or the flags on the command line changed.
#
# This extension allows to do the following:
#
# command = <command line>
#
# %.o: %.c dummy
# $(call if_changed,command)
#
# which will make sure to rebuild the target when either its prerequisites
# change or the command line changes
#
# The magic works as follows:
# The addition of dummy to the dependencies causes the rule for rebuilding
# to be always executed. However, the if_changed function will generate
# an empty command when
# o none of the prequesites changed (i.e $? is empty)
# o the command line did not change (we compare the old command line,
# which is saved in .<target>.o, to the current command line using
# the two filter-out commands)
# For use in expunging commas from flags, which mung our checking.
comma = ,
# read all saved command lines
FILES_FLAGS_EXIST := $(wildcard .*.flags)
ifneq ($(FILES_FLAGS_EXIST),)
include $(FILES_FLAGS_EXIST)
cmd_files := $(wildcard .*.cmd)
ifneq ($(cmd_files),)
include $(cmd_files)
endif
FILES_FLAGS_CHANGED := $(strip \
$(filter-out $(FILES_FLAGS_UP_TO_DATE), \
$(O_TARGET) $(L_TARGET) $(active-objs) \
))
# A kludge: .S files don't get flag dependencies (yet),
# because that will involve changing a lot of Makefiles. Also
# suppress object files explicitly listed in $(IGNORE_FLAGS_OBJS).
# This allows handling of assembly files that get translated into
# multiple object files (see arch/ia64/lib/idiv.S, for example).
FILES_FLAGS_CHANGED := $(strip \
$(filter-out $(patsubst %.S, %.o, $(wildcard *.S) $(IGNORE_FLAGS_OBJS)), \
$(FILES_FLAGS_CHANGED)))
ifneq ($(FILES_FLAGS_CHANGED),)
$(FILES_FLAGS_CHANGED): dummy
endif
# function to only execute the passed command if necessary
if_changed = $(if $(strip $? \
$(filter-out $($(1)),$(cmd_$@))\
$(filter-out $(cmd_$@),$($(1)))),\
@echo $($(1)); $($(1)); echo 'cmd_$@ := $($(1))' > .$@.cmd)
......@@ -8,6 +8,25 @@
# Copyright (C) 1994 by Linus Torvalds
#
# ROOT_DEV specifies the default root-device when making the image.
# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
# the default of FLOPPY is used by 'build'.
ROOT_DEV := CURRENT
# If you want to preset the SVGA mode, uncomment the next line and
# set SVGA_MODE to whatever number you want.
# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
# The number is the same as you would ordinarily press at bootup.
SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
# If you want the RAM disk device, define this to be the size in blocks.
RAMDISK := -DRAMDISK=512
# ---------------------------------------------------------------------------
BOOT_INCL = $(TOPDIR)/include/linux/config.h \
$(TOPDIR)/include/linux/autoconf.h \
$(TOPDIR)/include/asm/boot.h
......
......@@ -8,6 +8,25 @@
# Copyright (C) 1994 by Linus Torvalds
#
# ROOT_DEV specifies the default root-device when making the image.
# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
# the default of FLOPPY is used by 'build'.
ROOT_DEV := CURRENT
# If you want to preset the SVGA mode, uncomment the next line and
# set SVGA_MODE to whatever number you want.
# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
# The number is the same as you would ordinarily press at bootup.
SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
# If you want the RAM disk device, define this to be the size in blocks.
RAMDISK := -DRAMDISK=512
# ---------------------------------------------------------------------------
BOOT_INCL = $(TOPDIR)/include/linux/config.h \
$(TOPDIR)/include/linux/autoconf.h \
$(TOPDIR)/include/asm/boot.h
......
TARGET=$1
ARCH=$2
SMP=$3
CC=$4
# Generate a temporary compile.h
( echo /\* This file is auto generated, version `cat .version` \*/
echo \#define UTS_MACHINE \"$ARCH\"
echo -n \#define UTS_VERSION \"\#`cat .version`
if [ -n "$SMP" ] ; then echo -n " SMP"; fi
echo ' '`date`'"'
echo \#define LINUX_COMPILE_TIME \"`date +%T`\"
echo \#define LINUX_COMPILE_BY \"`whoami`\"
echo \#define LINUX_COMPILE_HOST \"`hostname`\"
if [ -x /bin/dnsdomainname ]; then
echo \#define LINUX_COMPILE_DOMAIN \"`dnsdomainname`\"
elif [ -x /bin/domainname ]; then
echo \#define LINUX_COMPILE_DOMAIN \"`domainname`\"
else
echo \#define LINUX_COMPILE_DOMAIN
fi
echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -1`\"
) > .tmpcompile
# Only replace the real compile.h if the new one is different,
# in order to preserve the timestamp and avoid unnecessary
# recompilations.
# We don't consider the file changed if only the date/time changed.
# A kernel config change will increase the generation number, thus
# causing compile.h to be updated (including date/time) due to the
# changed comment in the
# first line.
if [ -r $TARGET ] && \
grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' $TARGET > .tmpver.1 && \
grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' .tmpcompile > .tmpver.2 && \
cmp -s .tmpver.1 .tmpver.2; then
echo $TARGET is unchanged;
rm -f .tmpcompile
else
mv -f .tmpcompile $TARGET
fi
rm -f .tmpver.1 .tmpver.2
TARGET=$1
KERNELRELEASE=$2
VERSION=$3
PATCHLEVEL=$4
SUBLEVEL=$5
# Generate a temporary version.h
( echo \#define UTS_RELEASE \"$KERNELRELEASE\"
echo \#define LINUX_VERSION_CODE `expr $VERSION \\* 65536 + $PATCHLEVEL \\* 256 + $SUBLEVEL`
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'
) > .tmpversion
mv -f .tmpversion $TARGET
\ No newline at end of file
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