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 ...@@ -49,7 +49,7 @@ Card) hardware, for example, you probably needn't concern yourself
with pcmcia-cs. with pcmcia-cs.
o Gnu C 2.95.3 # gcc --version 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 binutils 2.9.5.0.25 # ld -v
o util-linux 2.10o # fdformat --version o util-linux 2.10o # fdformat --version
o modutils 2.4.2 # insmod -V o modutils 2.4.2 # insmod -V
......
...@@ -12,17 +12,30 @@ EPS-parportbook := $(patsubst %.fig, %.eps, $(IMG-parportbook)) ...@@ -12,17 +12,30 @@ EPS-parportbook := $(patsubst %.fig, %.eps, $(IMG-parportbook))
PNG-parportbook := $(patsubst %.fig, %.png, $(IMG-parportbook)) PNG-parportbook := $(patsubst %.fig, %.png, $(IMG-parportbook))
C-procfs-example = procfs_example.sgml 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 %.eps: %.fig
fig2dev -Leps $< $@ fig2dev -Leps $< $@
...@@ -39,9 +52,6 @@ html: $(HTML) ...@@ -39,9 +52,6 @@ html: $(HTML)
echo "</programlisting>" >> $@ echo "</programlisting>" >> $@
$(TOPDIR)/scripts/docproc:
$(MAKE) -C $(TOPDIR)/scripts docproc
mousedrivers.sgml: mousedrivers.tmpl mousedrivers.sgml: mousedrivers.tmpl
$(TOPDIR)/scripts/docgen <$< >$@ $(TOPDIR)/scripts/docgen <$< >$@
...@@ -131,7 +141,7 @@ APISOURCES := $(TOPDIR)/drivers/media/video/videodev.c \ ...@@ -131,7 +141,7 @@ APISOURCES := $(TOPDIR)/drivers/media/video/videodev.c \
$(TOPDIR)/lib/string.c \ $(TOPDIR)/lib/string.c \
$(TOPDIR)/lib/vsprintf.c \ $(TOPDIR)/lib/vsprintf.c \
$(TOPDIR)/net/netsyms.c $(TOPDIR)/net/netsyms.c
kernel-api.sgml: kernel-api.tmpl $(APISOURCES) kernel-api.sgml: kernel-api.tmpl $(APISOURCES)
$(TOPDIR)/scripts/docgen $(APISOURCES) \ $(TOPDIR)/scripts/docgen $(APISOURCES) \
<kernel-api.tmpl >kernel-api.sgml <kernel-api.tmpl >kernel-api.sgml
......
...@@ -56,7 +56,7 @@ ifeq (.config,$(wildcard .config)) ...@@ -56,7 +56,7 @@ ifeq (.config,$(wildcard .config))
include .config include .config
ifeq (.depend,$(wildcard .depend)) ifeq (.depend,$(wildcard .depend))
include .depend include .depend
do-it-all: Version vmlinux do-it-all: vmlinux
else else
CONFIGURATION = depend CONFIGURATION = depend
do-it-all: depend do-it-all: depend
...@@ -92,32 +92,6 @@ CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \ ...@@ -92,32 +92,6 @@ CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
-fomit-frame-pointer -fno-strict-aliasing -fno-common -fomit-frame-pointer -fno-strict-aliasing -fno-common
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS) 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 CORE_FILES =kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o
NETWORKS =net/network.o NETWORKS =net/network.o
...@@ -178,71 +152,14 @@ DRIVERS-$(CONFIG_ISDN) += drivers/isdn/vmlinux-obj.o ...@@ -178,71 +152,14 @@ DRIVERS-$(CONFIG_ISDN) += drivers/isdn/vmlinux-obj.o
DRIVERS := $(DRIVERS-y) 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 include arch/$(ARCH)/Makefile
export CPPFLAGS CFLAGS CFLAGS_KERNEL AFLAGS AFLAGS_KERNEL export CPPFLAGS CFLAGS CFLAGS_KERNEL AFLAGS AFLAGS_KERNEL
export NETWORKS DRIVERS LIBS HEAD LDFLAGS LINKFLAGS MAKEBOOT ASFLAGS export NETWORKS DRIVERS LIBS HEAD LDFLAGS LINKFLAGS MAKEBOOT ASFLAGS
.S.s: # Build vmlinux / boot target
$(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
boot: vmlinux boot: vmlinux
@$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C arch/$(ARCH)/boot @$(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 ...@@ -258,12 +175,15 @@ vmlinux: include/linux/version.h $(CONFIGURATION) init/main.o init/version.o ini
-o vmlinux -o vmlinux
$(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map $(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
symlinks: # Handle descending into subdirectories listed in $(SUBDIRS)
rm -f include/asm
( cd include ; ln -sf asm-$(ARCH) asm) linuxsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
@if [ ! -d include/linux/modules ]; then \
mkdir include/linux/modules; \ $(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/linux/version.h include/config/MARKER
fi $(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C $(patsubst _dir_%, %, $@)
# Configuration
# ---------------------------------------------------------------------------
oldconfig: symlinks oldconfig: symlinks
$(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in $(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
...@@ -279,50 +199,44 @@ menuconfig: include/linux/version.h symlinks ...@@ -279,50 +199,44 @@ menuconfig: include/linux/version.h symlinks
config: symlinks config: symlinks
$(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in $(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 include/config/MARKER: scripts/split-include include/linux/autoconf.h
scripts/split-include include/linux/autoconf.h include/config scripts/split-include include/linux/autoconf.h include/config
@ touch include/config/MARKER @ touch include/config/MARKER
. scripts/mkversion > .tmpversion
@mv -f .tmpversion .version
linuxsubdirs: $(patsubst %, _dir_%, $(SUBDIRS)) # Generate some files
$(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/linux/version.h include/config/MARKER
$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" -C $(patsubst _dir_%, %, $@)
$(TOPDIR)/include/linux/version.h: include/linux/version.h $(TOPDIR)/include/linux/version.h: include/linux/version.h
$(TOPDIR)/include/linux/compile.h: include/linux/compile.h $(TOPDIR)/include/linux/compile.h: include/linux/compile.h
newversion: include/linux/compile.h: $(CONFIGURATION) include/linux/version.h
. scripts/mkversion > .tmpversion @echo Generating $@
@mv -f .tmpversion .version @. scripts/mkcompile_h $@ "$(ARCH)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
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/version.h: ./Makefile include/linux/version.h: ./Makefile
@echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver @echo Generating $@
@echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver @. scripts/mkversion_h $@ $(KERNELRELEASE) $(VERSION) $(PATCHLEVEL) $(SUBLEVEL)
@echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))' >>.ver
@mv -f .ver $@
comma := , 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 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 init/main.o: init/main.c include/config/MARKER
$(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -c -o $*.o $< $(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 ...@@ -330,22 +244,26 @@ init/main.o: init/main.c include/config/MARKER
init/do_mounts.o: init/do_mounts.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 $< $(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 depend dep: dep-files
{ 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 -
# Exuberant ctags works better with -I dep-files: scripts/mkdep archdep include/linux/version.h
tags: dummy scripts/mkdep -- init/*.c > .depend
CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \ scripts/mkdep -- `find $(FINDHPATH) -name SCCS -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
ctags $$CTAGSF `find include/asm-$(ARCH) -name '*.h'` && \ $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)"
find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \ ifdef CONFIG_MODVERSIONS
find $(SUBDIRS) init -name '*.[ch]' | xargs ctags $$CTAGSF -a $(MAKE) update-modverfile
endif
# ---------------------------------------------------------------------------
# Modules
ifdef CONFIG_MODULES ifdef CONFIG_MODULES
# Build modules
ifdef CONFIG_MODVERSIONS ifdef CONFIG_MODVERSIONS
MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h
endif endif
...@@ -357,6 +275,8 @@ modules: $(patsubst %, _mod_%, $(SUBDIRS)) ...@@ -357,6 +275,8 @@ modules: $(patsubst %, _mod_%, $(SUBDIRS))
$(patsubst %, _mod_%, $(SUBDIRS)) : include/linux/version.h include/config/MARKER $(patsubst %, _mod_%, $(SUBDIRS)) : include/linux/version.h include/config/MARKER
$(MAKE) -C $(patsubst _mod_%, %, $@) CFLAGS="$(CFLAGS) $(MODFLAGS)" MAKING_MODULES=1 modules $(MAKE) -C $(patsubst _mod_%, %, $@) CFLAGS="$(CFLAGS) $(MODFLAGS)" MAKING_MODULES=1 modules
# Install modules
.PHONY: modules_install .PHONY: modules_install
modules_install: _modinst_ $(patsubst %, _modinst_%, $(SUBDIRS)) _modinst_post modules_install: _modinst_ $(patsubst %, _modinst_%, $(SUBDIRS)) _modinst_post
...@@ -385,9 +305,11 @@ _modinst_post: ...@@ -385,9 +305,11 @@ _modinst_post:
$(patsubst %, _modinst_%, $(SUBDIRS)) : $(patsubst %, _modinst_%, $(SUBDIRS)) :
$(MAKE) -C $(patsubst _modinst_%, %, $@) modules_install $(MAKE) -C $(patsubst _modinst_%, %, $@) modules_install
# modules disabled.... else # CONFIG_MODULES
# ---------------------------------------------------------------------------
# Modules not configured
else
modules modules_install: dummy modules modules_install: dummy
@echo @echo
@echo "The present kernel configuration has modules disabled." @echo "The present kernel configuration has modules disabled."
...@@ -395,7 +317,77 @@ modules modules_install: dummy ...@@ -395,7 +317,77 @@ modules modules_install: dummy
@echo "Then build a kernel with module support enabled." @echo "Then build a kernel with module support enabled."
@echo @echo
@exit 1 @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 clean: archclean
find . \( -name '*.[oas]' -o -name core -o -name '.*.flags' \) -type f -print \ find . \( -name '*.[oas]' -o -name core -o -name '.*.flags' \) -type f -print \
...@@ -416,44 +408,41 @@ distclean: mrproper ...@@ -416,44 +408,41 @@ distclean: mrproper
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags
backup: mrproper # Assorted miscellaneous targets
cd .. && tar cf - linux/ | gzip -9 > backup.gz # ---------------------------------------------------------------------------
sync
sgmldocs: # Documentation targets
chmod 755 $(TOPDIR)/scripts/docgen
chmod 755 $(TOPDIR)/scripts/gen-all-syms
chmod 755 $(TOPDIR)/scripts/kernel-doc
$(MAKE) -C $(TOPDIR)/Documentation/DocBook books
psdocs: sgmldocs sgmldocs psdocs pdfdocs htmldocs:
$(MAKE) -C Documentation/DocBook ps $(MAKE) -C Documentation/DocBook $@
pdfdocs: sgmldocs
$(MAKE) -C Documentation/DocBook pdf
htmldocs: sgmldocs # RPM target
$(MAKE) -C Documentation/DocBook html #
# If you do a make spec before packing the tarball you can rpm -ta it
sums: spec:
find . -type f -print | sort | xargs sum > .SUMS . scripts/mkspec >kernel.spec
dep-files: scripts/mkdep archdep include/linux/version.h # Build a tar ball, generate an rpm from it and pack the result
scripts/mkdep -- init/*.c > .depend # There arw two bits of magic here
scripts/mkdep -- `find $(FINDHPATH) -name SCCS -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend # 1) The use of /. to avoid tar packing just the symlink
$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)" # 2) Removing the .dep files as they have source paths in them that
ifdef CONFIG_MODVERSIONS # will become invalid
$(MAKE) update-modverfile
endif
ifdef CONFIG_MODVERSIONS rpm: clean spec
MODVERFILE := $(TOPDIR)/include/linux/modversions.h find . \( -size 0 -o -name .depend -o -name .hdepend \) -type f -print | xargs rm -f
else set -e; \
MODVERFILE := cd $(TOPDIR)/.. ; \
endif ln -sf $(TOPDIR) $(KERNELPATH) ; \
export MODVERFILE 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: checkconfig:
find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkconfig.pl find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkconfig.pl
...@@ -464,61 +453,37 @@ checkhelp: ...@@ -464,61 +453,37 @@ checkhelp:
checkincludes: checkincludes:
find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkincludes.pl find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkincludes.pl
ifdef CONFIGURATION # Generate tags for editors
..$(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:
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_$@, $@)
# # Make a backup
# This generates dependencies for the .h files. # FIXME anybody still using this?
#
scripts/mkdep: scripts/mkdep.c backup: mrproper
$(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c cd .. && tar cf - linux/ | gzip -9 > backup.gz
sync
scripts/split-include: scripts/split-include.c # Make checksums
$(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c # FIXME anybody still using this?
# sums:
# RPM target find . -type f -print | sort | xargs sum > .SUMS
#
# If you do a make spec before packing the tarball you can rpm -ta it
#
spec:
. scripts/mkspec >kernel.spec
#
# 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) ...@@ -49,27 +49,28 @@ SUB_DIRS := $(subdir-y)
MOD_SUB_DIRS := $(sort $(subdir-m) $(both-m)) MOD_SUB_DIRS := $(sort $(subdir-m) $(both-m))
ALL_SUB_DIRS := $(sort $(subdir-y) $(subdir-m) $(subdir-n) $(subdir-)) ALL_SUB_DIRS := $(sort $(subdir-y) $(subdir-m) $(subdir-n) $(subdir-))
# #
# Common rules # Common rules
# #
%.s: %.c # export_flags will be set to -DEXPORT_SYMBOL for objects in $(export-objs)
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(CFLAGS_$@) -S $< -o $@
%.i: %.c c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(export_flags)
$(CPP) $(CFLAGS) $(EXTRA_CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(CFLAGS_$@) $< > $@
%.o: %.c cmd_cc_s_c = $(CC) $(c_flags) -S $< -o $@
$(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
%.o: %.s %.s: %.c dummy
$(AS) $(AFLAGS) $(EXTRA_CFLAGS) -o $@ $< $(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, # Old makefiles define their own rules for compiling .S files,
# but these standard rules are available for any Makefile that # 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-)) ...@@ -77,16 +78,26 @@ ALL_SUB_DIRS := $(sort $(subdir-y) $(subdir-m) $(subdir-n) $(subdir-))
# the Makefiles to these standard rules. -- rmk, mec # the Makefiles to these standard rules. -- rmk, mec
ifdef USE_STANDARD_AS_RULE ifdef USE_STANDARD_AS_RULE
%.s: %.S a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@)
$(CPP) $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@) $< > $@
cmd_as_s_S = $(CPP) $(a_flags) $< > $@
%.s: %.S dummy
$(call if_changed,cmd_as_s_S)
%.o: %.S cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
$(CC) $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@) -c -o $@ $<
%.o: %.S dummy
$(call if_changed,cmd_as_o_S)
endif endif
# FIXME is anybody using this rule? Why does it have EXTRA_CFLAGS?
%.o: %.s
$(AS) $(AFLAGS) $(EXTRA_CFLAGS) -o $@ $<
%.lst: %.c %.lst: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -g -c -o $*.o $< $(CC) $(c_flags) -g -c -o $*.o $<
$(TOPDIR)/scripts/makelst $* $(TOPDIR) $(OBJDUMP) $(TOPDIR)/scripts/makelst $* $(TOPDIR) $(OBJDUMP)
# #
# #
...@@ -97,66 +108,61 @@ all_targets: $(O_TARGET) $(L_TARGET) ...@@ -97,66 +108,61 @@ all_targets: $(O_TARGET) $(L_TARGET)
# Rule to compile a set of .o files into one .o file # Rule to compile a set of .o files into one .o file
# #
ifdef O_TARGET ifdef O_TARGET
$(O_TARGET): $(obj-y) # If the list of objects to link is empty, just create an empty O_TARGET
rm -f $@ cmd_link_o_target = $(if $(strip $(obj-y)),\
ifneq "$(strip $(obj-y))" "" $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^),\
$(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^) rm -f $@; $(AR) rcs $@)
else
$(AR) rcs $@ $(O_TARGET): $(obj-y) dummy
endif $(call if_changed,cmd_link_o_target)
@ ( \
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
endif # O_TARGET endif # O_TARGET
# #
# Rule to compile a set of .o files into one .a file # Rule to compile a set of .o files into one .a file
# #
ifdef L_TARGET ifdef L_TARGET
$(L_TARGET): $(obj-y) cmd_link_l_target = rm -f $@; $(AR) $(EXTRA_ARFLAGS) rcs $@ $(obj-y)
rm -f $@
$(AR) $(EXTRA_ARFLAGS) rcs $@ $(obj-y) $(L_TARGET): $(obj-y) dummy
@ ( \ $(call if_changed,cmd_link_l_target)
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
endif endif
# #
# Rule to link composite objects # Rule to link composite objects
# #
# for make >= 3.78 the following is cleaner: # export.o is never a composite object, since $(export-objs) has a
# multi-used := $(foreach m,$(obj-y) $(obj-m), $(if $($(basename $(m))-objs), $(m))) # fixed meaning (== objects which EXPORT_SYMBOL())
__obj-y = $(filter-out export.o,$(obj-y)) __obj-y = $(filter-out export.o,$(obj-y))
__obj-m = $(filter-out export.o,$(obj-m)) __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)))) # if $(foo-objs) exists, foo.o is a composite object
ld-multi-used-y := $(filter-out $(list-multi),$(multi-used-y)) __multi-used-y := $(sort $(foreach m,$(__obj-y), $(if $($(basename $(m))-objs), $(m))))
ld-multi-used-m := $(filter-out $(list-multi),$(multi-used-m)) __multi-used-m := $(sort $(foreach m,$(__obj-m), $(if $($(basename $(m))-objs), $(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)) # Backwards compatibility: if a composite object is listed in
# $(list-multi), skip it here, since the Makefile will have an explicit
$(ld-multi-used-y) : %.o: $(ld-multi-objs-y) # link rule for it
rm -f $@
$(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs), $^) multi-used-y := $(filter-out $(list-multi),$(__multi-used-y))
@ ( \ multi-used-m := $(filter-out $(list-multi),$(__multi-used-m))
echo 'ifeq ($(strip $(subst $(comma),:,$(LD) $(EXTRA_LDFLAGS) $($(basename $@)-objs)),$$(strip $$(subst $$(comma),:,$$(LD) $$(EXTRA_LDFLAGS) $$($(basename $@)-objs)))))' ; \
echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \ # Build list of the parts of our composite objects, our composite
echo 'endif' \ # objects depend on those (obviously)
) > $(dir $@)/.$(notdir $@).flags multi-objs-y := $(foreach m, $(multi-used-y), $($(basename $(m))-objs))
multi-objs-m := $(foreach m, $(multi-used-m), $($(basename $(m))-objs))
$(ld-multi-used-m) : %.o: $(ld-multi-objs-m)
rm -f $@ cmd_link_multi = $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs),$^)
$(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs), $^)
@ ( \ # We would rather have a list of rules like
echo 'ifeq ($(strip $(subst $(comma),:,$(LD) $(EXTRA_LDFLAGS) $($(basename $@)-objs)),$$(strip $$(subst $$(comma),:,$$(LD) $$(EXTRA_LDFLAGS) $$($(basename $@)-objs)))))' ; \ # foo.o: $(foo-objs)
echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \ # but that's not so easy, so we rather make all composite objects depend
echo 'endif' \ # on the set of all their parts
) > $(dir $@)/.$(notdir $@).flags $(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 # This make dependencies quickly
...@@ -306,14 +312,10 @@ $(TOPDIR)/include/linux/modversions.h: ...@@ -306,14 +312,10 @@ $(TOPDIR)/include/linux/modversions.h:
endif # CONFIG_MODVERSIONS endif # CONFIG_MODVERSIONS
ifneq "$(strip $(export-objs))" "" ifneq "$(strip $(export-objs))" ""
$(export-objs): $(TOPDIR)/include/linux/modversions.h $(export-objs): $(TOPDIR)/include/linux/modversions.h
$(export-objs): %.o: %.c $(export-objs): export_flags := -DEXPORT_SYMTAB
$(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
endif endif
endif # CONFIG_MODULES endif # CONFIG_MODULES
...@@ -330,35 +332,48 @@ ifneq ($(wildcard $(TOPDIR)/.hdepend),) ...@@ -330,35 +332,48 @@ ifneq ($(wildcard $(TOPDIR)/.hdepend),)
include $(TOPDIR)/.hdepend include $(TOPDIR)/.hdepend
endif endif
# ---------------------------------------------------------------------------
# Check if command line has changed
# Usage:
# normally one uses rules like
# #
# Find files whose flags have changed and force recompilation. # %.o: %.c
# For safety, this works in the converse direction: # <command line>
# every file is forced, except those whose flags are positively up-to-date.
# #
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. # read all saved command lines
comma = ,
FILES_FLAGS_EXIST := $(wildcard .*.flags) cmd_files := $(wildcard .*.cmd)
ifneq ($(FILES_FLAGS_EXIST),) ifneq ($(cmd_files),)
include $(FILES_FLAGS_EXIST) include $(cmd_files)
endif endif
FILES_FLAGS_CHANGED := $(strip \ # function to only execute the passed command if necessary
$(filter-out $(FILES_FLAGS_UP_TO_DATE), \
$(O_TARGET) $(L_TARGET) $(active-objs) \ if_changed = $(if $(strip $? \
)) $(filter-out $($(1)),$(cmd_$@))\
$(filter-out $(cmd_$@),$($(1)))),\
# A kludge: .S files don't get flag dependencies (yet), @echo $($(1)); $($(1)); echo 'cmd_$@ := $($(1))' > .$@.cmd)
# 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
...@@ -8,6 +8,25 @@ ...@@ -8,6 +8,25 @@
# Copyright (C) 1994 by Linus Torvalds # 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 \ BOOT_INCL = $(TOPDIR)/include/linux/config.h \
$(TOPDIR)/include/linux/autoconf.h \ $(TOPDIR)/include/linux/autoconf.h \
$(TOPDIR)/include/asm/boot.h $(TOPDIR)/include/asm/boot.h
......
...@@ -8,6 +8,25 @@ ...@@ -8,6 +8,25 @@
# Copyright (C) 1994 by Linus Torvalds # 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 \ BOOT_INCL = $(TOPDIR)/include/linux/config.h \
$(TOPDIR)/include/linux/autoconf.h \ $(TOPDIR)/include/linux/autoconf.h \
$(TOPDIR)/include/asm/boot.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