Commit 08a2a0a6 authored by Kai Germaschewski's avatar Kai Germaschewski

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

into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make
parents faf7b0b0 b832bf81
...@@ -12,17 +12,12 @@ EPS-parportbook := $(patsubst %.fig, %.eps, $(IMG-parportbook)) ...@@ -12,17 +12,12 @@ 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
$(TOPDIR)/scripts/docgen: FORCE $(TOPDIR)/scripts/docgen $(TOPDIR)/scripts/gen-all-syms \
chmod 755 $(TOPDIR)/scripts/docgen $(TOPDIR)/scripts/kernel-doc $(TOPDIR)/scripts/docproc: doc-progs ;
$(TOPDIR)/scripts/gen-all-syms: FORCE .PHONY: doc-progs
chmod 755 $(TOPDIR)/scripts/gen-all-syms doc-progs:
@$(MAKE) -C $(TOPDIR)/scripts doc-progs
$(TOPDIR)/scripts/kernel-doc: FORCE
chmod 755 $(TOPDIR)/scripts/kernel-doc
$(TOPDIR)/scripts/docproc: FORCE
$(MAKE) -C $(TOPDIR)/scripts docproc
$(BOOKS): $(TOPDIR)/scripts/docgen $(TOPDIR)/scripts/gen-all-syms \ $(BOOKS): $(TOPDIR)/scripts/docgen $(TOPDIR)/scripts/gen-all-syms \
$(TOPDIR)/scripts/kernel-doc $(TOPDIR)/scripts/docproc $(TOPDIR)/scripts/kernel-doc $(TOPDIR)/scripts/docproc
......
...@@ -219,9 +219,24 @@ $(sort $(vmlinux-objs)): $(SUBDIRS) ; ...@@ -219,9 +219,24 @@ $(sort $(vmlinux-objs)): $(SUBDIRS) ;
# Handle descending into subdirectories listed in $(SUBDIRS) # Handle descending into subdirectories listed in $(SUBDIRS)
.PHONY: $(SUBDIRS)
$(SUBDIRS): FORCE include/linux/version.h include/config/MARKER $(SUBDIRS): FORCE include/linux/version.h include/config/MARKER
@$(MAKE) -C $@ @$(MAKE) -C $@
# Single targets
# ---------------------------------------------------------------------------
%.s: %.c FORCE
@$(MAKE) -C $(@D) $(@F)
%.i: %.c FORCE
@$(MAKE) -C $(@D) $(@F)
%.o: %.c FORCE
@$(MAKE) -C $(@D) $(@F)
%.s: %.S FORCE
@$(MAKE) -C $(@D) $(@F)
%.o: %.S FORCE
@$(MAKE) -C $(@D) $(@F)
# Configuration # Configuration
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -262,6 +277,11 @@ include/linux/version.h: ./Makefile ...@@ -262,6 +277,11 @@ include/linux/version.h: ./Makefile
@echo Generating $@ @echo Generating $@
@. scripts/mkversion_h $@ $(KERNELRELEASE) $(VERSION) $(PATCHLEVEL) $(SUBLEVEL) @. scripts/mkversion_h $@ $(KERNELRELEASE) $(VERSION) $(PATCHLEVEL) $(SUBLEVEL)
# helpers built in scripts/
scripts/mkdep scripts/split-include : FORCE
@$(MAKE) -C scripts
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Generate dependencies # Generate dependencies
...@@ -269,11 +289,34 @@ depend dep: dep-files ...@@ -269,11 +289,34 @@ depend dep: dep-files
dep-files: scripts/mkdep archdep include/linux/version.h dep-files: scripts/mkdep archdep include/linux/version.h
scripts/mkdep -- `find $(FINDHPATH) -name SCCS -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend 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)" @$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS))
ifdef CONFIG_MODVERSIONS ifdef CONFIG_MODVERSIONS
$(MAKE) update-modverfile $(MAKE) update-modverfile
endif endif
.PHONY: $(patsubst %,_sfdep_%,$(SUBDIRS))
$(patsubst %,_sfdep_%,$(SUBDIRS)): FORCE
@$(MAKE) -C $(patsubst _sfdep_%, %, $@) fastdep
# update modversions.h, but only if it would change
update-modverfile:
@(echo "#ifndef _LINUX_MODVERSIONS_H";\
echo "#define _LINUX_MODVERSIONS_H"; \
echo "#include <linux/modsetver.h>"; \
cd $(TOPDIR)/include/linux/modules; \
for f in *.ver; do \
if [ -f $$f ]; then echo "#include <linux/modules/$${f}>"; fi; \
done; \
echo "#endif"; \
) > $(TOPDIR)/include/linux/modversions.h.tmp
@if [ -r $(TOPDIR)/include/linux/modversions.h ] && cmp -s $(TOPDIR)/include/linux/modversions.h $(TOPDIR)/include/linux/modversions.h.tmp; then \
echo $(TOPDIR)/include/linux/modversions.h was not updated; \
rm -f $(TOPDIR)/include/linux/modversions.h.tmp; \
else \
echo $(TOPDIR)/include/linux/modversions.h was updated; \
mv -f $(TOPDIR)/include/linux/modversions.h.tmp $(TOPDIR)/include/linux/modversions.h; \
fi
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Modules # Modules
...@@ -337,19 +380,6 @@ modules modules_install: FORCE ...@@ -337,19 +380,6 @@ modules modules_install: FORCE
endif # CONFIG_MODULES 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 # Cleaning up
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -507,3 +537,4 @@ if_changed_rule = $(if $(strip $? \ ...@@ -507,3 +537,4 @@ if_changed_rule = $(if $(strip $? \
$(filter-out $(cmd_$(@F)),$(cmd_$(1)))),\ $(filter-out $(cmd_$(@F)),$(cmd_$(1)))),\
@$(rule_$(1))) @$(rule_$(1)))
FORCE:
...@@ -111,16 +111,18 @@ $(real-objs-m) : modkern_cflags := $(CFLAGS_MODULE) ...@@ -111,16 +111,18 @@ $(real-objs-m) : modkern_cflags := $(CFLAGS_MODULE)
$(real-objs-m:.o=.i): modkern_cflags := $(CFLAGS_MODULE) $(real-objs-m:.o=.i): modkern_cflags := $(CFLAGS_MODULE)
$(real-objs-m:.o=.s): modkern_cflags := $(CFLAGS_MODULE) $(real-objs-m:.o=.s): modkern_cflags := $(CFLAGS_MODULE)
$(export-objs) : export_flags := $(EXPORT_FLAGS) $(export-objs) : export_flags := $(EXPORT_FLAGS)
$(export-objs:.o=.i): export_flags := $(EXPORT_FLAGS)
$(export-objs:.o=.s): export_flags := $(EXPORT_FLAGS)
c_flags = $(CFLAGS) $(modkern_cflags) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(export_flags) c_flags = $(CFLAGS) $(modkern_cflags) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(export_flags)
cmd_cc_s_c = $(CC) $(c_flags) -S $< -o $@ cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $<
%.s: %.c FORCE %.s: %.c FORCE
$(call if_changed,cmd_cc_s_c) $(call if_changed,cmd_cc_s_c)
cmd_cc_i_c = $(CPP) $(c_flags) $< > $@ cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<
%.i: %.c FORCE %.i: %.c FORCE
$(call if_changed,cmd_cc_i_c) $(call if_changed,cmd_cc_i_c)
...@@ -144,7 +146,7 @@ $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE) ...@@ -144,7 +146,7 @@ $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)
a_flags = $(AFLAGS) $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) a_flags = $(AFLAGS) $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
cmd_as_s_S = $(CPP) $(a_flags) $< > $@ cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
%.s: %.S FORCE %.s: %.S FORCE
$(call if_changed,cmd_as_s_S) $(call if_changed,cmd_as_s_S)
...@@ -324,30 +326,8 @@ $(addprefix $(MODINCL)/$(MODPREFIX),$(export-objs:.o=.ver)): $(TOPDIR)/include/l ...@@ -324,30 +326,8 @@ $(addprefix $(MODINCL)/$(MODPREFIX),$(export-objs:.o=.ver)): $(TOPDIR)/include/l
# updates .ver files but not modversions.h # updates .ver files but not modversions.h
fastdep: $(addprefix $(MODINCL)/$(MODPREFIX),$(export-objs:.o=.ver)) fastdep: $(addprefix $(MODINCL)/$(MODPREFIX),$(export-objs:.o=.ver))
# updates .ver files and modversions.h like before (is this needed?)
dep: fastdep update-modverfile
endif # export-objs endif # export-objs
# update modversions.h, but only if it would change
update-modverfile:
@(echo "#ifndef _LINUX_MODVERSIONS_H";\
echo "#define _LINUX_MODVERSIONS_H"; \
echo "#include <linux/modsetver.h>"; \
cd $(TOPDIR)/include/linux/modules; \
for f in *.ver; do \
if [ -f $$f ]; then echo "#include <linux/modules/$${f}>"; fi; \
done; \
echo "#endif"; \
) > $(TOPDIR)/include/linux/modversions.h.tmp
@if [ -r $(TOPDIR)/include/linux/modversions.h ] && cmp -s $(TOPDIR)/include/linux/modversions.h $(TOPDIR)/include/linux/modversions.h.tmp; then \
echo $(TOPDIR)/include/linux/modversions.h was not updated; \
rm -f $(TOPDIR)/include/linux/modversions.h.tmp; \
else \
echo $(TOPDIR)/include/linux/modversions.h was updated; \
mv -f $(TOPDIR)/include/linux/modversions.h.tmp $(TOPDIR)/include/linux/modversions.h; \
fi
$(active-objs): $(TOPDIR)/include/linux/modversions.h $(active-objs): $(TOPDIR)/include/linux/modversions.h
else else
......
# always needed
# ---------------------------------------------------------------------------
all: mkdep split-include
mkdep: mkdep.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
split-include: split-include.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
# xconfig
# ---------------------------------------------------------------------------
HEADER=header.tk HEADER=header.tk
TAIL=tail.tk TAIL=tail.tk
# Previous versions always remade kconfig.tk because they always depended # Previous versions always remade kconfig.tk because they always depended
# on soundscript. This runs fairly fast, and I can't find all the # on soundscript. This runs fairly fast, and I can't find all the
# Config.in files to depend on anyways. So I'll force it to remake. # Config.in files to depend on anyways. So I'll force it to remake.
kconfig.tk: FORCE kconfig.tk: $(TOPDIR)/arch/$(ARCH)/config.in tkparse $(HEADER) $(TAIL) FORCE
@echo Generating $@
kconfig.tk: ${TOPDIR}/Makefile ${TOPDIR}/arch/${ARCH}/config.in \ @( \
tkparse ${HEADER} ${TAIL} if [ -f /usr/local/bin/wish ]; then \
@if [ -f /usr/local/bin/wish ]; then \ echo '#!'"/usr/local/bin/wish -f"; \
echo '#!'"/usr/local/bin/wish -f" > kconfig.tk; \ else \
else \ echo '#!'"/usr/bin/wish -f"; \
echo '#!'"/usr/bin/wish -f" > kconfig.tk; \ fi; \
fi cat $(HEADER); \
cat ${HEADER} >> ./kconfig.tk ./tkparse < $<; \
./tkparse < ../arch/${ARCH}/config.in >> kconfig.tk echo "set defaults \"arch/${ARCH}/defconfig\""; \
echo "set defaults \"arch/${ARCH}/defconfig\"" >> kconfig.tk echo "set ARCH \"${ARCH}\""; \
echo "set ARCH \"${ARCH}\"" >> kconfig.tk cat $(TAIL) \
cat ${TAIL} >> kconfig.tk ) > $@
chmod 755 kconfig.tk chmod 755 $@
tkparse: tkparse.o tkcond.o tkgen.o tkparse: tkparse.o tkcond.o tkgen.o
${HOSTCC} -o tkparse tkparse.o tkcond.o tkgen.o $(HOSTCC) -o $@ $^
tkparse.o: tkparse.c tkparse.h
tkcond.o: tkcond.c tkparse.h tkparse.o tkcond.o tkgen.o: %.o: %.c
$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
tkgen.o: tkgen.c tkparse.h # DocBook stuff
# ---------------------------------------------------------------------------
tkparse.o tkcond.o tkgen.o: doc-progs: docproc docgen gen-all-syms kernel-doc
$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $(@:.o=.c)
docproc.o: docproc.c docproc: docproc.c
$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $(@:.o=.c) $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
docproc: docproc.o docgen gen-all-syms kernel-doc: FORCE
${HOSTCC} -o docproc docproc.o chmod 755 $@
clean:
rm -f *~ kconfig.tk *.o tkparse mkdep split-include docproc
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
# we don't have automatic deps for host programs
tkparse.o tkcond.o tkgen.o: tkparse.h
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