Commit 1eeca271 authored by Kai Germaschewski's avatar Kai Germaschewski

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

into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make
parents 4fd5bb5d 7a897475
......@@ -12,17 +12,12 @@ EPS-parportbook := $(patsubst %.fig, %.eps, $(IMG-parportbook))
PNG-parportbook := $(patsubst %.fig, %.png, $(IMG-parportbook))
C-procfs-example = procfs_example.sgml
$(TOPDIR)/scripts/docgen: FORCE
chmod 755 $(TOPDIR)/scripts/docgen
$(TOPDIR)/scripts/docgen $(TOPDIR)/scripts/gen-all-syms \
$(TOPDIR)/scripts/kernel-doc $(TOPDIR)/scripts/docproc: doc-progs ;
$(TOPDIR)/scripts/gen-all-syms: FORCE
chmod 755 $(TOPDIR)/scripts/gen-all-syms
$(TOPDIR)/scripts/kernel-doc: FORCE
chmod 755 $(TOPDIR)/scripts/kernel-doc
$(TOPDIR)/scripts/docproc: FORCE
$(MAKE) -C $(TOPDIR)/scripts docproc
.PHONY: doc-progs
doc-progs:
@$(MAKE) -C $(TOPDIR)/scripts doc-progs
$(BOOKS): $(TOPDIR)/scripts/docgen $(TOPDIR)/scripts/gen-all-syms \
$(TOPDIR)/scripts/kernel-doc $(TOPDIR)/scripts/docproc
......
......@@ -219,9 +219,24 @@ $(sort $(vmlinux-objs)): $(SUBDIRS) ;
# Handle descending into subdirectories listed in $(SUBDIRS)
.PHONY: $(SUBDIRS)
$(SUBDIRS): FORCE include/linux/version.h include/config/MARKER
@$(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
# ---------------------------------------------------------------------------
......@@ -262,6 +277,11 @@ include/linux/version.h: ./Makefile
@echo Generating $@
@. scripts/mkversion_h $@ $(KERNELRELEASE) $(VERSION) $(PATCHLEVEL) $(SUBLEVEL)
# helpers built in scripts/
scripts/mkdep scripts/split-include : FORCE
@$(MAKE) -C scripts
# ---------------------------------------------------------------------------
# Generate dependencies
......@@ -269,11 +289,34 @@ depend dep: dep-files
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
$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)"
@$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS))
ifdef CONFIG_MODVERSIONS
$(MAKE) update-modverfile
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
......@@ -337,19 +380,6 @@ modules modules_install: FORCE
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
# ---------------------------------------------------------------------------
......@@ -507,3 +537,4 @@ if_changed_rule = $(if $(strip $? \
$(filter-out $(cmd_$(@F)),$(cmd_$(1)))),\
@$(rule_$(1)))
FORCE:
......@@ -111,16 +111,18 @@ $(real-objs-m) : modkern_cflags := $(CFLAGS_MODULE)
$(real-objs-m:.o=.i): 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)
cmd_cc_s_c = $(CC) $(c_flags) -S $< -o $@
cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $<
%.s: %.c FORCE
$(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
$(call if_changed,cmd_cc_i_c)
......@@ -144,7 +146,7 @@ $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)
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
$(call if_changed,cmd_as_s_S)
......@@ -324,30 +326,8 @@ $(addprefix $(MODINCL)/$(MODPREFIX),$(export-objs:.o=.ver)): $(TOPDIR)/include/l
# updates .ver files but not modversions.h
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
# 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
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
TAIL=tail.tk
# Previous versions always remade kconfig.tk because they always depended
# 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.
kconfig.tk: FORCE
kconfig.tk: ${TOPDIR}/Makefile ${TOPDIR}/arch/${ARCH}/config.in \
tkparse ${HEADER} ${TAIL}
@if [ -f /usr/local/bin/wish ]; then \
echo '#!'"/usr/local/bin/wish -f" > kconfig.tk; \
else \
echo '#!'"/usr/bin/wish -f" > kconfig.tk; \
fi
cat ${HEADER} >> ./kconfig.tk
./tkparse < ../arch/${ARCH}/config.in >> kconfig.tk
echo "set defaults \"arch/${ARCH}/defconfig\"" >> kconfig.tk
echo "set ARCH \"${ARCH}\"" >> kconfig.tk
cat ${TAIL} >> kconfig.tk
chmod 755 kconfig.tk
kconfig.tk: $(TOPDIR)/arch/$(ARCH)/config.in tkparse $(HEADER) $(TAIL) FORCE
@echo Generating $@
@( \
if [ -f /usr/local/bin/wish ]; then \
echo '#!'"/usr/local/bin/wish -f"; \
else \
echo '#!'"/usr/bin/wish -f"; \
fi; \
cat $(HEADER); \
./tkparse < $<; \
echo "set defaults \"arch/${ARCH}/defconfig\""; \
echo "set ARCH \"${ARCH}\""; \
cat $(TAIL) \
) > $@
chmod 755 $@
tkparse: tkparse.o tkcond.o tkgen.o
${HOSTCC} -o tkparse tkparse.o tkcond.o tkgen.o
tkparse.o: tkparse.c tkparse.h
$(HOSTCC) -o $@ $^
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:
$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $(@:.o=.c)
doc-progs: docproc docgen gen-all-syms kernel-doc
docproc.o: docproc.c
$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $(@:.o=.c)
docproc: docproc.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
docproc: docproc.o
${HOSTCC} -o docproc docproc.o
docgen gen-all-syms kernel-doc: FORCE
chmod 755 $@
clean:
rm -f *~ kconfig.tk *.o tkparse mkdep split-include docproc
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