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
......
......@@ -56,7 +56,7 @@ ifeq (.config,$(wildcard .config))
include .config
ifeq (.depend,$(wildcard .depend))
include .depend
do-it-all: Version vmlinux
do-it-all: vmlinux
else
CONFIGURATION = depend
do-it-all: depend
......@@ -92,32 +92,6 @@ CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
-fomit-frame-pointer -fno-strict-aliasing -fno-common
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
#
# 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'.
# This is i386 specific.
#
export 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.
# This is i386 specific.
#
export SVGA_MODE = -DSVGA_MODE=NORMAL_VGA
#
# If you want the RAM disk device, define this to be the size in blocks.
# This is i386 specific.
#
#export RAMDISK = -DRAMDISK=512
CORE_FILES =kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o
NETWORKS =net/network.o
......@@ -178,71 +152,14 @@ DRIVERS-$(CONFIG_ISDN) += drivers/isdn/vmlinux-obj.o
DRIVERS := $(DRIVERS-y)
# files removed with 'make clean'
CLEAN_FILES = \
kernel/ksyms.lst include/linux/compile.h \
vmlinux System.map \
.tmp* \
drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c \
drivers/char/conmakehash \
drivers/char/drm/*-mod.c \
drivers/pci/devlist.h drivers/pci/classlist.h drivers/pci/gen-devlist \
drivers/zorro/devlist.h drivers/zorro/gen-devlist \
sound/oss/bin2hex sound/oss/hex2hex \
drivers/atm/fore200e_mkfirm drivers/atm/{pca,sba}*{.bin,.bin1,.bin2} \
drivers/scsi/aic7xxx/aicasm/aicasm_gram.c \
drivers/scsi/aic7xxx/aicasm/aicasm_scan.c \
drivers/scsi/aic7xxx/aicasm/y.tab.h \
drivers/scsi/aic7xxx/aicasm/aicasm \
drivers/scsi/53c700_d.h \
net/khttpd/make_times_h \
net/khttpd/times.h \
submenu*
# directories removed with 'make clean'
CLEAN_DIRS = \
modules
# files removed with 'make mrproper'
MRPROPER_FILES = \
include/linux/autoconf.h include/linux/version.h \
drivers/net/hamradio/soundmodem/sm_tbl_{afsk1200,afsk2666,fsk9600}.h \
drivers/net/hamradio/soundmodem/sm_tbl_{hapn4800,psk4800}.h \
drivers/net/hamradio/soundmodem/sm_tbl_{afsk2400_7,afsk2400_8}.h \
drivers/net/hamradio/soundmodem/gentbl \
sound/oss/*_boot.h sound/oss/.*.boot \
sound/oss/msndinit.c \
sound/oss/msndperm.c \
sound/oss/pndsperm.c \
sound/oss/pndspini.c \
drivers/atm/fore200e_*_fw.c drivers/atm/.fore200e_*.fw \
.version .config* config.in config.old \
scripts/tkparse scripts/kconfig.tk scripts/kconfig.tmp \
scripts/lxdialog/*.o scripts/lxdialog/lxdialog \
.menuconfig.log \
include/asm \
.hdepend scripts/mkdep scripts/split-include scripts/docproc \
$(TOPDIR)/include/linux/modversions.h \
kernel.spec
# directories removed with 'make mrproper'
MRPROPER_DIRS = \
include/config \
$(TOPDIR)/include/linux/modules
include arch/$(ARCH)/Makefile
export CPPFLAGS CFLAGS CFLAGS_KERNEL AFLAGS AFLAGS_KERNEL
export NETWORKS DRIVERS LIBS HEAD LDFLAGS LINKFLAGS MAKEBOOT ASFLAGS
.S.s:
$(CPP) $(AFLAGS) $(AFLAGS_KERNEL) -traditional -o $*.s $<
.S.o:
$(CC) $(AFLAGS) $(AFLAGS_KERNEL) -traditional -c -o $*.o $<
Version: dummy
@rm -f include/linux/compile.h
# Build vmlinux / boot target
# ---------------------------------------------------------------------------
boot: vmlinux
@$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C arch/$(ARCH)/boot
......@@ -258,12 +175,15 @@ vmlinux: include/linux/version.h $(CONFIGURATION) init/main.o init/version.o ini
-o vmlinux
$(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
symlinks:
rm -f include/asm
( cd include ; ln -sf asm-$(ARCH) asm)
@if [ ! -d include/linux/modules ]; then \
mkdir include/linux/modules; \
fi
# Handle descending into subdirectories listed in $(SUBDIRS)
linuxsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
$(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/linux/version.h include/config/MARKER
$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C $(patsubst _dir_%, %, $@)
# Configuration
# ---------------------------------------------------------------------------
oldconfig: symlinks
$(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
......@@ -279,50 +199,44 @@ menuconfig: include/linux/version.h symlinks
config: symlinks
$(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in
# make asm->asm-$(ARCH) symlink
symlinks:
rm -f include/asm
( cd include ; ln -sf asm-$(ARCH) asm)
@if [ ! -d include/linux/modules ]; then \
mkdir include/linux/modules; \
fi
# split autoconf.h into include/linux/config/*
include/config/MARKER: scripts/split-include include/linux/autoconf.h
scripts/split-include include/linux/autoconf.h include/config
@ touch include/config/MARKER
. scripts/mkversion > .tmpversion
@mv -f .tmpversion .version
linuxsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
$(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/linux/version.h include/config/MARKER
$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C $(patsubst _dir_%, %, $@)
# Generate some files
$(TOPDIR)/include/linux/version.h: include/linux/version.h
$(TOPDIR)/include/linux/compile.h: include/linux/compile.h
newversion:
. scripts/mkversion > .tmpversion
@mv -f .tmpversion .version
include/linux/compile.h: $(CONFIGURATION) include/linux/version.h newversion
@echo -n \#define UTS_VERSION \"\#`cat .version` > .ver
@if [ -n "$(CONFIG_SMP)" ] ; then echo -n " SMP" >> .ver; fi
@if [ -f .name ]; then echo -n \-`cat .name` >> .ver; fi
@echo ' '`date`'"' >> .ver
@echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> .ver
@echo \#define LINUX_COMPILE_BY \"`whoami`\" >> .ver
@echo \#define LINUX_COMPILE_HOST \"`hostname`\" >> .ver
@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 >> .ver
@echo \#define LINUX_COMPILER \"`$(CC) $(CFLAGS) -v 2>&1 | tail -1`\" >> .ver
@mv -f .ver $@
include/linux/compile.h: $(CONFIGURATION) include/linux/version.h
@echo Generating $@
@. scripts/mkcompile_h $@ "$(ARCH)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
include/linux/version.h: ./Makefile
@echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
@echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver
@echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))' >>.ver
@mv -f .ver $@
@echo Generating $@
@. scripts/mkversion_h $@ $(KERNELRELEASE) $(VERSION) $(PATCHLEVEL) $(SUBLEVEL)
comma := ,
# ---------------------------------------------------------------------------
# Build files in init
# FIXME should be moved to init/Makefile
init/version.o: init/version.c include/linux/compile.h include/config/MARKER
$(CC) $(CFLAGS) $(CFLAGS_KERNEL) -DUTS_MACHINE='"$(ARCH)"' -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o init/version.o init/version.c
$(CC) $(CFLAGS) $(CFLAGS_KERNEL) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o init/version.o init/version.c
init/main.o: init/main.c include/config/MARKER
$(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $*.o $<
......@@ -330,22 +244,26 @@ init/main.o: init/main.c include/config/MARKER
init/do_mounts.o: init/do_mounts.c include/config/MARKER
$(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $*.o $<
fs lib mm ipc kernel drivers net sound: dummy
$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@)
# ---------------------------------------------------------------------------
# Generate dependencies
TAGS: dummy
{ find include/asm-${ARCH} -name '*.h' -print ; \
find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print ; \
find $(SUBDIRS) init -name '*.[ch]' ; } | grep -v SCCS | etags -
depend dep: dep-files
# Exuberant ctags works better with -I
tags: dummy
CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
ctags $$CTAGSF `find include/asm-$(ARCH) -name '*.h'` && \
find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \
find $(SUBDIRS) init -name '*.[ch]' | xargs ctags $$CTAGSF -a
dep-files: scripts/mkdep archdep include/linux/version.h
scripts/mkdep -- init/*.c > .depend
scripts/mkdep -- `find $(FINDHPATH) -name SCCS -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)"
ifdef CONFIG_MODVERSIONS
$(MAKE) update-modverfile
endif
# ---------------------------------------------------------------------------
# Modules
ifdef CONFIG_MODULES
# Build modules
ifdef CONFIG_MODVERSIONS
MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h
endif
......@@ -357,6 +275,8 @@ modules: $(patsubst %, _mod_%, $(SUBDIRS))
$(patsubst %, _mod_%, $(SUBDIRS)) : include/linux/version.h include/config/MARKER
$(MAKE) -C $(patsubst _mod_%, %, $@) CFLAGS="$(CFLAGS) $(MODFLAGS)" MAKING_MODULES=1 modules
# Install modules
.PHONY: modules_install
modules_install: _modinst_ $(patsubst %, _modinst_%, $(SUBDIRS)) _modinst_post
......@@ -385,9 +305,11 @@ _modinst_post:
$(patsubst %, _modinst_%, $(SUBDIRS)) :
$(MAKE) -C $(patsubst _modinst_%, %, $@) modules_install
# modules disabled....
else # CONFIG_MODULES
# ---------------------------------------------------------------------------
# Modules not configured
else
modules modules_install: dummy
@echo
@echo "The present kernel configuration has modules disabled."
......@@ -395,7 +317,77 @@ modules modules_install: dummy
@echo "Then build a kernel with module support enabled."
@echo
@exit 1
endif
endif # CONFIG_MODULES
# ---------------------------------------------------------------------------
include Rules.make
# Build helpers in scripts/
# FIXME: do that in scripts/Makefile?
scripts/mkdep: scripts/mkdep.c
$(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
scripts/split-include: scripts/split-include.c
$(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
# Cleaning up
# ---------------------------------------------------------------------------
# files removed with 'make clean'
CLEAN_FILES += \
kernel/ksyms.lst include/linux/compile.h \
vmlinux System.map \
.tmp* \
drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c \
drivers/char/conmakehash \
drivers/char/drm/*-mod.c \
drivers/pci/devlist.h drivers/pci/classlist.h drivers/pci/gen-devlist \
drivers/zorro/devlist.h drivers/zorro/gen-devlist \
sound/oss/bin2hex sound/oss/hex2hex \
drivers/atm/fore200e_mkfirm drivers/atm/{pca,sba}*{.bin,.bin1,.bin2} \
drivers/scsi/aic7xxx/aicasm/aicasm_gram.c \
drivers/scsi/aic7xxx/aicasm/aicasm_scan.c \
drivers/scsi/aic7xxx/aicasm/y.tab.h \
drivers/scsi/aic7xxx/aicasm/aicasm \
drivers/scsi/53c700_d.h \
net/khttpd/make_times_h \
net/khttpd/times.h \
submenu*
# directories removed with 'make clean'
CLEAN_DIRS += \
modules
# files removed with 'make mrproper'
MRPROPER_FILES += \
include/linux/autoconf.h include/linux/version.h \
drivers/net/hamradio/soundmodem/sm_tbl_{afsk1200,afsk2666,fsk9600}.h \
drivers/net/hamradio/soundmodem/sm_tbl_{hapn4800,psk4800}.h \
drivers/net/hamradio/soundmodem/sm_tbl_{afsk2400_7,afsk2400_8}.h \
drivers/net/hamradio/soundmodem/gentbl \
sound/oss/*_boot.h sound/oss/.*.boot \
sound/oss/msndinit.c \
sound/oss/msndperm.c \
sound/oss/pndsperm.c \
sound/oss/pndspini.c \
drivers/atm/fore200e_*_fw.c drivers/atm/.fore200e_*.fw \
.version .config* config.in config.old \
scripts/tkparse scripts/kconfig.tk scripts/kconfig.tmp \
scripts/lxdialog/*.o scripts/lxdialog/lxdialog \
.menuconfig.log \
include/asm \
.hdepend scripts/mkdep scripts/split-include scripts/docproc \
$(TOPDIR)/include/linux/modversions.h \
kernel.spec
# directories removed with 'make mrproper'
MRPROPER_DIRS += \
include/config \
$(TOPDIR)/include/linux/modules
clean: archclean
find . \( -name '*.[oas]' -o -name core -o -name '.*.flags' \) -type f -print \
......@@ -416,44 +408,41 @@ distclean: mrproper
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags
backup: mrproper
cd .. && tar cf - linux/ | gzip -9 > backup.gz
sync
# Assorted miscellaneous targets
# ---------------------------------------------------------------------------
sgmldocs:
chmod 755 $(TOPDIR)/scripts/docgen
chmod 755 $(TOPDIR)/scripts/gen-all-syms
chmod 755 $(TOPDIR)/scripts/kernel-doc
$(MAKE) -C $(TOPDIR)/Documentation/DocBook books
# Documentation targets
psdocs: sgmldocs
$(MAKE) -C Documentation/DocBook ps
sgmldocs psdocs pdfdocs htmldocs:
$(MAKE) -C Documentation/DocBook $@
pdfdocs: sgmldocs
$(MAKE) -C Documentation/DocBook pdf
htmldocs: sgmldocs
$(MAKE) -C Documentation/DocBook html
# RPM target
#
# If you do a make spec before packing the tarball you can rpm -ta it
sums:
find . -type f -print | sort | xargs sum > .SUMS
spec:
. scripts/mkspec >kernel.spec
dep-files: scripts/mkdep archdep include/linux/version.h
scripts/mkdep -- init/*.c > .depend
scripts/mkdep -- `find $(FINDHPATH) -name SCCS -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)"
ifdef CONFIG_MODVERSIONS
$(MAKE) update-modverfile
endif
# Build a tar ball, generate an rpm from it and pack the result
# There arw two bits of magic here
# 1) The use of /. to avoid tar packing just the symlink
# 2) Removing the .dep files as they have source paths in them that
# will become invalid
ifdef CONFIG_MODVERSIONS
MODVERFILE := $(TOPDIR)/include/linux/modversions.h
else
MODVERFILE :=
endif
export MODVERFILE
rpm: clean spec
find . \( -size 0 -o -name .depend -o -name .hdepend \) -type f -print | xargs rm -f
set -e; \
cd $(TOPDIR)/.. ; \
ln -sf $(TOPDIR) $(KERNELPATH) ; \
tar -cvz --exclude CVS -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
rm $(KERNELPATH) ; \
cd $(TOPDIR) ; \
. scripts/mkversion > .version ; \
rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
rm $(TOPDIR)/../$(KERNELPATH).tar.gz
depend dep: dep-files
# Scripts to check various things for consistency
checkconfig:
find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkconfig.pl
......@@ -464,61 +453,37 @@ checkhelp:
checkincludes:
find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkincludes.pl
ifdef CONFIGURATION
..$(CONFIGURATION):
@echo
@echo "You have a bad or nonexistent" .$(CONFIGURATION) ": running 'make" $(CONFIGURATION)"'"
@echo
$(MAKE) $(CONFIGURATION)
@echo
@echo "Successful. Try re-making (ignore the error that follows)"
@echo
exit 1
#dummy: ..$(CONFIGURATION)
dummy:
# Generate tags for editors
else
TAGS: dummy
{ find include/asm-${ARCH} -name '*.h' -print ; \
find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print ; \
find $(SUBDIRS) init -name '*.[ch]' ; } | grep -v SCCS | etags -
dummy:
# Exuberant ctags works better with -I
tags: dummy
CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
ctags $$CTAGSF `find include/asm-$(ARCH) -name '*.h'` && \
find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \
find $(SUBDIRS) init -name '*.[ch]' | xargs ctags $$CTAGSF -a
endif
# Targets which will only descend into one subdir, not trying
# to link vmlinux afterwards
# FIXME: anybody still using this?
include Rules.make
fs lib mm ipc kernel drivers net sound: dummy
$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@)
#
# This generates dependencies for the .h files.
#
# Make a backup
# FIXME anybody still using this?
scripts/mkdep: scripts/mkdep.c
$(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
backup: mrproper
cd .. && tar cf - linux/ | gzip -9 > backup.gz
sync
scripts/split-include: scripts/split-include.c
$(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
# Make checksums
# FIXME anybody still using this?
#
# RPM target
#
# If you do a make spec before packing the tarball you can rpm -ta it
#
spec:
. scripts/mkspec >kernel.spec
sums:
find . -type f -print | sort | xargs sum > .SUMS
#
# Build a tar ball, generate an rpm from it and pack the result
# There arw two bits of magic here
# 1) The use of /. to avoid tar packing just the symlink
# 2) Removing the .dep files as they have source paths in them that
# will become invalid
#
rpm: clean spec
find . \( -size 0 -o -name .depend -o -name .hdepend \) -type f -print | xargs rm -f
set -e; \
cd $(TOPDIR)/.. ; \
ln -sf $(TOPDIR) $(KERNELPATH) ; \
tar -cvz --exclude CVS -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
rm $(KERNELPATH) ; \
cd $(TOPDIR) ; \
. scripts/mkversion > .version ; \
rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
rm $(TOPDIR)/../$(KERNELPATH).tar.gz
......@@ -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