[PATCH] Rules.make for new style Makefiles

From: Christoph Hellwig (chhellwig@gmx.net)
Date: Sun May 14 2000 - 06:41:22 EST


Hi,
I've hacked together an version of Rules.make (called
$(TOPDIR)/Makefile.inc), that directly understands the
variables of the 'new-style' list-trick Makefiles.

After removing all things that are now in Makefile.inc and
changing the include statement everything works fine with
2.3.99pre9. I'll try to change more Makefiles to the list-trick
soon ...

The only problem are some dity Makefiles that define both L_TARGET
and O_TARGET to link some objects togheter, but I'be a solution for
this too.

        Christoph

P.S. Is L_TARGET really needed? Some experiments show me, that everything
works fine with s/.a/.o/ for the targets and some linker-hacks.

-- 
Always remember that you are unique.  Just like everyone else.

diff -rNu --exclude-from=/usr/src/exclude linux.orig/Makefile.inc linux/Makefile.inc --- linux.orig/Makefile.inc Thu Jan 1 01:00:00 1970 +++ linux/Makefile.inc Sun May 14 13:09:08 2000 @@ -0,0 +1,331 @@ +# +# This file contains rules which are shared between multiple Makefiles. +# + +# +# False targets. +# +.PHONY: dummy + +# +# Special variables which should not be exported +# +unexport EXTRA_ASFLAGS +unexport EXTRA_CFLAGS +unexport EXTRA_LDFLAGS +unexport EXTRA_ARFLAGS +unexport O_TARGTET +unexport L_TARGET +unexport MOD_LIST_NAME + +# Subdirs will be be new-style soon! +unexport SUBDIRS +unexport SUB_DIRS +unexport ALL_SUB_DIRS +unexport MOD_SUB_DIRS +unexport o-objs +unexport m-objs +unexport obj-y +unexport obj-m +unexport obj-n +unexport obj- +unexport multi-y +unexport multi-m +unexport int-y +unexport int-m +unexport export-objs +unexport list-multi + +# +# Get things started. +# +first_rule: sub_dirs + $(MAKE) all_targets + +# +# Common rules +# + +CFLAGS += $(EXTRA_CFLAGS) +ASFLAGS += $(EXTRA_CFLAGS) + +%.s: %.c + $(CC) $(CFLAGS) $(CFLAGS_$@) -S $< -o $@ + +%.i: %.c + $(CPP) $(CFLAGS) $(CFLAGS_$@) $< > $@ + +%.o: %.c + $(CC) $(CFLAGS) $(CFLAGS_$@) -c -o $@ $< + @ ( \ + echo 'ifeq ($(strip $(subst $(comma),:,$(CFLAGS) $(CFLAGS_$@))),$$(strip $$(subst $$(comma),:,$$(CFLAGS) $$(CFLAGS_$@))))' ; \ + echo 'files-up-to-date += $@' ; \ + echo 'endif' \ + ) > $(dir $@)/.$(notdir $@).flags + +%.o: %.s + $(AS) $(ASFLAGS) -o $@ $< + +# +# +# +all_targets: $(O_TARGET) $(L_TARGET) + +# +# Extract lists of the multi-part drivers. +# The 'int-*' lists are the intermediate files used to build the multi's. +# +ifneq "$(strip $(list-multi))" "" +multi-y := $(filter $(list-multi), $(obj-y)) +multi-m := $(filter $(list-multi), $(obj-m)) +int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) +int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) +endif + +# +# Files that are both resident and modular: remove from modular. +# +obj-m := $(filter-out $(obj-y), $(obj-m)) +int-m := $(filter-out $(int-y), $(int-m)) + +# +# Take multi-part drivers out of obj-y and put components in. +# +obj-y := $(filter-out $(list-multi), $(obj-y)) $(int-y) + +# +# Drop everything that's not in obj-y, obj-m, int-y or int-m out of export-objs +# +export-objs := $(filter $(export-objs), $(obj-y) $(obj-m) $(int-y) $(int-m)) + +# +# 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 $@ $(filter $(obj-y), $^) + endif + @ ( \ + echo 'ifeq ($(strip $(subst $(comma),:,$(EXTRA_LDFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(EXTRA_LDFLAGS) $$(obj-y))))' ; \ + echo 'files-up-to-date += $@' ; \ + echo 'endif' \ + ) > $(dir $@)/.$(notdir $@).flags +endif + +# +# 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-up-to-date += $@' ; \ + echo 'endif' \ + ) > $(dir $@)/.$(notdir $@).flags +endif + +# +# This make dependencies quickly +# +fastdep: dummy + $(TOPDIR)/scripts/mkdep $(wildcard *.[chS] local.h.master) > .depend + ifdef ALL_SUB_DIRS + $(MAKE) $(patsubst %,_sfdep_%,$(ALL_SUB_DIRS)) _FASTDEP_ALL_SUB_DIRS="$(ALL_SUB_DIRS)" + endif + +ifdef _FASTDEP_ALL_SUB_DIRS +$(patsubst %,_sfdep_%,$(_FASTDEP_ALL_SUB_DIRS)): + $(MAKE) -C $(patsubst _sfdep_%,%,$@) fastdep +endif + +# +# A rule to make subdirectories +# +sub_dirs: dummy $(patsubst %,_subdir_%,$(SUB_DIRS)) + +ifdef SUB_DIRS +$(patsubst %,_subdir_%,$(SUB_DIRS)) : dummy + $(MAKE) -C $(patsubst _subdir_%,%,$@) +endif + +# +# A rule to make modules +# + +ifneq "$(strip $(obj-m))" "" +PDWN=$(shell $(CONFIG_SHELL) $(TOPDIR)/scripts/pathdown.sh) +endif + +ifdef MOD_SUB_DIRS +$(patsubst %,_modsubdir_%,$(MOD_SUB_DIRS)) : dummy + $(MAKE) -C $(patsubst _modsubdir_%,%,$@) modules +endif +ifdef MOD_IN_SUB_DIRS +$(patsubst %,_modinsubdir_%,$(MOD_IN_SUB_DIRS)) : dummy + $(MAKE) -C $(patsubst _modinsubdir_%,%,$@) modules +endif + +modules: $(obj-m) $(int-m) dummy \ + $(patsubst %,_modsubdir_%,$(MOD_SUB_DIRS)) \ + $(patsubst %,_modinsubdir_%,$(MOD_IN_SUB_DIRS)) + ifneq "$(strip $(MOD_LIST_NAME))" "" + rm -f $$TOPDIR/modules/$(MOD_LIST_NAME) + ifdef MOD_SUB_DIRS + for i in $(MOD_SUB_DIRS); do \ + echo `basename $$i`.o >> $$TOPDIR/modules/$(MOD_LIST_NAME); \ + done + endif + ifneq "$(strip $(obj-m))" "" + echo $(obj-m) >> $$TOPDIR/modules/$(MOD_LIST_NAME) + endif + endif + ifneq "$(strip $(obj-m))" "" + echo $(PDWN) + cd $$TOPDIR/modules; for i in $(obj-m); do \ + ln -sf ../$(PDWN)/$$i $$i; done + endif + +# +# A rule to do nothing +# +dummy: + +# +# This is useful for testing +# +script: + $(SCRIPT) + +# +# This sets version suffixes on exported symbols +# Uses export-objs +# Separate the object into "normal" objects and "exporting" objects +# Exporting objects are: all objects that define symbol tables +# +ifdef CONFIG_MODULES + +ifdef CONFIG_MODVERSIONS +ifneq "$(strip $(export-objs))" "" + +mod-include = $(TOPDIR)/include/linux/modules + +# The -w option (enable warnings) for genksyms will return here in 2.1 +# So where has it gone? +# +# Added the SMP separator to stop module accidents between uniprocessor +# and SMP Intel boxes - AC - from bits by Michael Chastain +# + +ifdef CONFIG_SMP + genksyms_smp_prefix := -p smp_ +else + genksyms_smp_prefix := +endif + +$(mod-include)/%.ver: %.c + @if [ ! -r $(mod-include)/$*.stamp -o $(mod-include)/$*.stamp -ot $< ]; then \ + echo '$(CC) $(CFLAGS) -E -D__GENKSYMS__ $<'; \ + echo '| $(GENKSYMS) $(genksyms_smp_prefix) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp'; \ + $(CC) $(CFLAGS) -E -D__GENKSYMS__ $< \ + | $(GENKSYMS) $(genksyms_smp_prefix) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp; \ + if [ -r $@ ] && cmp -s $@ $@.tmp; then echo $@ is unchanged; rm -f $@.tmp; \ + else echo mv $@.tmp $@; mv -f $@.tmp $@; fi; \ + fi; touch $(mod-include)/$*.stamp + +$(addprefix $(mod-include)/,$(export-objs:.o=.ver)): $(TOPDIR)/include/linux/autoconf.h + +$(TOPDIR)/include/linux/modversions.h: $(addprefix $(mod-include)/,$(export-objs:.o=.ver)) + @echo updating $(TOPDIR)/include/linux/modversions.h + @(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"; \ + ) > $@ + +dep fastdep: $(TOPDIR)/include/linux/modversions.h + +endif + +ifneq "$(strip $(obj-m))" "" +m-objs := $(filter-out $(export-objs), $(obj-m)) +$(m-objs): $(TOPDIR)/include/linux/modversions.h +endif + +ifdef MAKING_MODULES + ifneq "$(strip $(obj-y))" "" +o-objs := $(filter-out $(export-objs), $(obj-y)) +$(o-objs): $(TOPDIR)/include/linux/modversions.h + endif +endif + +else + +$(TOPDIR)/include/linux/modversions.h: + @echo "#include <linux/modsetver.h>" > $@ + +endif # CONFIG_MODVERSIONS + +ifneq "$(strip $(export-objs))" "" +$(export-objs): $(export-objs:.o=.c) $(TOPDIR)/include/linux/modversions.h + $(CC) $(CFLAGS) $(CFLAGS_$@) -DEXPORT_SYMTAB -c $(@:.o=.c) + @ ( \ + echo 'ifeq ($(strip $(subst $(comma),:,$(CFLAGS) $(CFLAGS_$@) -DEXPORT_SYMTAB)),$$(strip $$(subst $$(comma),:,$$(CFLAGS) $$(CFLAGS_$@) -DEXPORT_SYMTAB)))' ; \ + echo 'files-up-to-date += $@' ; \ + echo 'endif' \ + ) > $(dir $@)/.$(notdir $@).flags +endif + +endif # CONFIG_MODULES + + +# +# include dependency files if they exist +# +ifneq ($(wildcard .depend),) +include .depend +endif + +ifneq ($(wildcard $(TOPDIR)/.hdepend),) +include $(TOPDIR)/.hdepend +endif + +# +# 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 files-up-to-date. +# +files-up-to-date := + +# For use in expunging commas from flags, which mung our checking. +comma = , + +files-exists := $(wildcard .*.flags) +ifneq ($(files-exists),) +include $(files-exists) +endif + +files-changed := $(strip \ + $(filter-out $(files-up-to-date), \ + $(O_TARGET) $(L_TARGET)\ + $(obj-y) $(obj-m) $(int-m) \ + )) + +# A kludge: .S files don't get flag dependencies (yet), +# because that will involve changing a lot of Makefiles. +files-changed := $(strip \ + $(filter-out $(patsubst %.S, %.o, $(wildcard *.S)), \ + $(files-changed))) + +ifneq ($(files-changed),) +$(files-changed): dummy +endif diff -rNu --exclude-from=/usr/src/exclude linux.orig/arch/arm/kernel/Makefile linux/arch/arm/kernel/Makefile --- linux.orig/arch/arm/kernel/Makefile Sat May 13 15:18:20 2000 +++ linux/arch/arm/kernel/Makefile Sun May 14 12:24:07 2000 @@ -28,10 +28,6 @@ obj-y := arch.o $(ENTRY_OBJ) ioport.o irq.o process.o ptrace.o \ semaphore.o setup.o signal.o sys_arm.o time.o traps.o \ $(O_OBJS_$(MACHINE)) -obj-m := -obj-n := -obj- := - export-objs := armksyms.o dma.o ecard.o hw-footbridge.o leds-$(MACHINE).o obj-$(CONFIG_ARCH_ACORN) += dma.o ecard.o iic.o fiq.o time-acorn.o @@ -46,23 +42,12 @@ obj-$(CONFIG_PCI) += bios32.o dec21285.o endif -# Files that are both resident and modular; remove from modular. - -obj-m := $(filter-out $(obj-y), $(obj-m)) - -# Translate to Rules.make lists. - -O_OBJS := $(filter-out $(export-objs), $(obj-y)) -OX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) - all: kernel.o $(HEAD_OBJ) init_task.o $(HEAD_OBJ): $(HEAD_OBJ:.o=.S) $(CC) $(AFLAGS) -DTEXTADDR=$(TEXTADDR) -traditional -c $(HEAD_OBJ:.o=.S) -o $@ -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc .S.o: $(CC) $(AFLAGS) $(AFLAGS_$@) -c -o $*.o $< diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/acorn/block/Makefile linux/drivers/acorn/block/Makefile --- linux.orig/drivers/acorn/block/Makefile Fri May 5 15:35:46 2000 +++ linux/drivers/acorn/block/Makefile Sun May 14 12:28:58 2000 @@ -12,12 +12,6 @@ L_TARGET := acorn-block.a MOD_LIST_NAME := ACORN_BLOCK_MODULES -obj-y := -obj-m := -obj-n := -obj- := - -export-objs := list-multi := fd1772_mod.o mfmhd_mod.o fd1772_mod-objs := fd1772.o fd1772dma.o mfmhd_mod-objs := mfmhd.o mfm.o @@ -25,31 +19,7 @@ obj-$(CONFIG_BLK_DEV_FD1772) += fd1772_mod.o obj-$(CONFIG_BLK_DEV_MFM) += mfmhd.o mfm.o -# Extract lists of the multi-part drivers. -# The 'int-*' lists are intermediate files used to build the multi's. - -multi-y := $(filter $(list-multi), $(obj-y)) -multi-m := $(filter $(list-multi), $(obj-m)) -int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) -int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) - -# Files that are both resident and modular; remove from modular. - -obj-m := $(filter-out $(obj-y), $(obj-m)) -int-m := $(filter-out $(int-y), $(int-m)) - -# Take multi-part drivers out of obj-y and put components in. - -obj-y := $(filter-out $(list-multi), $(obj-y)) $(int-y) - -# Translate to Rules.make lists. - -L_OBJS := $(filter-out $(export-objs), $(obj-y)) -LX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc fd1772_mod.o: $(FLOPPY) $(LD) -r -o $@ $(FLOPPY) diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/acorn/char/Makefile linux/drivers/acorn/char/Makefile --- linux.orig/drivers/acorn/char/Makefile Fri May 5 15:29:28 2000 +++ linux/drivers/acorn/char/Makefile Sun May 14 12:29:59 2000 @@ -11,21 +11,11 @@ O_TARGET := acorn-char.o -O_OBJS := -OX_OBJS := -M_OBJS := -MX_OBJS := - -# Object file lists. - -obj-y := i2c.o pcf8583.o -obj-m := -obj-n := -obj- := - # All the objects that export symbols. export-objs := mouse_rpc.o +obj-y := i2c.o pcf8583.o + obj-arc := keyb_arc.o obj-a5k := keyb_arc.o obj-rpc := keyb_ps2.o @@ -36,9 +26,4 @@ obj-y += $(obj-$(MACHINE)) -O_OBJS := $(filter-out $(export-objs), $(obj-y)) -OX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/acorn/net/Makefile linux/drivers/acorn/net/Makefile --- linux.orig/drivers/acorn/net/Makefile Fri May 5 15:29:28 2000 +++ linux/drivers/acorn/net/Makefile Sun May 14 12:29:19 2000 @@ -6,16 +6,8 @@ L_TARGET := acorn-net.a MOD_LIST_NAME := ACORN_NET_MODULES -obj-y := -obj-m := -obj-n := -obj- := - obj-$(CONFIG_ARM_ETHER1) += ether1.o obj-$(CONFIG_ARM_ETHER3) += ether3.o obj-$(CONFIG_ARM_ETHERH) += etherh.o -L_OBJS := $(obj-y) -M_OBJS := $(obj-m) - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/acorn/scsi/Makefile linux/drivers/acorn/scsi/Makefile --- linux.orig/drivers/acorn/scsi/Makefile Fri May 5 15:35:46 2000 +++ linux/drivers/acorn/scsi/Makefile Sun May 14 12:28:40 2000 @@ -5,11 +5,6 @@ L_TARGET := acorn-scsi.a MOD_LIST_NAME := ACORN_SCSI_MODULES -obj-y := -obj-m := -obj-n := -obj- := - export-objs := fas216.o queue.o msgqueue.o list-multi := acornscsi_mod.o acornscsi_mod-objs := acornscsi.o acornscsi-io.o @@ -23,31 +18,7 @@ obj-$(CONFIG_SCSI_POWERTECSCSI) += powertec.o fas216.o queue.o msgqueue.o obj-$(CONFIG_SCSI_EESOXSCSI) += eesox.o fas216.o queue.o msgqueue.o -# Extract lists of the multi-part drivers. -# The 'int-*' lists are intermediate files used to build the multi's. - -multi-y := $(filter $(list-multi), $(obj-y)) -multi-m := $(filter $(list-multi), $(obj-m)) -int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) -int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) - -# Files that are both resident and modular; remove from modular. - -obj-m := $(filter-out $(obj-y), $(obj-m)) -int-m := $(filter-out $(int-y), $(int-m)) - -# Take multi-part drivers out of obj-y and put components in. - -obj-y := $(filter-out $(list-multi), $(obj-y)) $(int-y) - -# Translate to Rules.make lists. - -L_OBJS := $(filter-out $(export-objs), $(obj-y)) -LX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc acornscsi_mod.o: acornscsi.o acornscsi-io.o $(LD) $(LD_RFLAG) -r -o $@ acornscsi.o acornscsi-io.o diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/cdrom/Makefile linux/drivers/cdrom/Makefile --- linux.orig/drivers/cdrom/Makefile Fri Aug 21 00:17:06 1998 +++ linux/drivers/cdrom/Makefile Sun May 14 12:26:52 2000 @@ -3,24 +3,14 @@ # 30 Jan 1998, Michael Elizabeth Chastain, <mailto:mec@shout.net> # Rewritten to use lists instead of if-statements. - +L_TARGET := cdrom.a +MOD_LIST_NAME := CDROM_MODULES # All of the (potential) objects that export symbols. # This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'. export-objs := cdrom.o - - -# Object file lists. - -obj-y := -obj-m := -obj-n := -obj- := - - - # Each configuration option enables a list of files. obj-$(CONFIG_BLK_DEV_IDECD) += cdrom.o @@ -42,26 +32,4 @@ obj-$(CONFIG_SJCD) += sjcd.o obj-$(CONFIG_CDU535) += sonycd535.o - - -# Files that are both resident and modular: remove from modular. - -obj-m := $(filter-out $(obj-y), $(obj-m)) - - - -# Translate to Rules.make lists. - -L_TARGET := cdrom.a -MOD_LIST_NAME := CDROM_MODULES - -L_OBJS := $(sort $(filter-out $(export-objs), $(obj-y))) -LX_OBJS := $(sort $(filter $(export-objs), $(obj-y))) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) - - - -# Hand off to Rules.make. - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/char/Makefile linux/drivers/char/Makefile --- linux.orig/drivers/char/Makefile Fri May 12 20:57:15 2000 +++ linux/drivers/char/Makefile Sun May 14 12:25:18 2000 @@ -9,18 +9,6 @@ # parent makes.. # -O_OBJS := -OX_OBJS := -M_OBJS := -MX_OBJS := - -# Object file lists. - -obj-y := -obj-m := -obj-n := -obj- := - SUB_DIRS := MOD_SUB_DIRS := $(SUB_DIRS) ALL_SUB_DIRS := $(SUB_DIRS) ftape joystick pcmcia rio @@ -332,7 +320,7 @@ obj-$(L_I2C) += i2c-old.o ifeq ($(CONFIG_DZ),y) - L_OBJS += dz.o + obj-y += dz.o endif obj-$(CONFIG_NWBUTTON) += nwbutton.o @@ -364,31 +352,7 @@ endif endif -# Extract lists of the multi-part drivers. -# The 'int-*' lists are the intermediate files used to build the multi's. - -multi-y := $(filter $(list-multi), $(obj-y)) -multi-m := $(filter $(list-multi), $(obj-m)) -int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) -int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) - -# Files that are both resident and modular: remove from modular. - -obj-m := $(filter-out $(obj-y), $(obj-m)) -int-m := $(filter-out $(int-y), $(int-m)) - -# Take multi-part drivers out of obj-y and put components in. - -obj-y := $(filter-out $(list-multi), $(obj-y)) $(int-y) - -# Translate to Rules.make lists. - -O_OBJS := $(filter-out $(export-objs), $(obj-y)) -OX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc fastdep: diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/char/pcmcia/Makefile linux/drivers/char/pcmcia/Makefile --- linux.orig/drivers/char/pcmcia/Makefile Fri Nov 12 01:03:36 1999 +++ linux/drivers/char/pcmcia/Makefile Sun May 14 12:25:28 2000 @@ -11,17 +11,7 @@ O_TARGET := pcmcia_char.o MOD_LIST_NAME := PCMCIA_CHAR_MODULES -obj-y := -obj-m := -obj-n := -obj- := - obj-$(CONFIG_PCMCIA_SERIAL_CS) += serial_cs.o obj-$(CONFIG_PCMCIA_SERIAL_CB) += serial_cb.o -O_OBJS := $(obj-y) -OX_OBJS := -M_OBJS := $(obj-m) -MX_OBJS := - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/net/Makefile linux/drivers/net/Makefile --- linux.orig/drivers/net/Makefile Sat May 13 15:18:21 2000 +++ linux/drivers/net/Makefile Sun May 14 12:24:17 2000 @@ -3,17 +3,6 @@ # Makefile for the Linux network (ethercard) device drivers. # -O_OBJS := -M_OBJS := -MX_OBJS := - -# Object file lists. - -obj-y := -obj-m := -obj-n := -obj- := - SUB_DIRS := MOD_SUB_DIRS := MOD_IN_SUB_DIRS := @@ -285,35 +274,11 @@ # -# Extract lists of the multi-part drivers. -# The 'int-*' lists are the intermediate files used to build the multi's. - -multi-y := $(filter $(list-multi), $(obj-y)) -multi-m := $(filter $(list-multi), $(obj-m)) -int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) -int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) - -# Files that are both resident and modular: remove from modular. - -obj-m := $(filter-out $(obj-y), $(obj-m)) -int-m := $(filter-out $(int-y), $(int-m)) - -# Take multi-part drivers out of obj-y and put components in. - -obj-y := $(filter-out $(list-multi), $(obj-y)) $(int-y) - -# Translate to Rules.make lists. - -O_OBJS := $(filter-out $(export-objs), $(obj-y)) -OX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) - ifneq ($(ARCH),s390) -O_OBJS += auto_irq.o +obj-y += auto_irq.o endif -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc clean: rm -f core *.o *.a *.s diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/net/appletalk/Makefile linux/drivers/net/appletalk/Makefile --- linux.orig/drivers/net/appletalk/Makefile Fri May 5 15:29:37 2000 +++ linux/drivers/net/appletalk/Makefile Sun May 14 12:24:50 2000 @@ -10,21 +10,11 @@ MOD_SUB_DIRS := $(SUB_DIRS) ALL_SUB_DIRS := $(SUB_DIRS) -obj-y := -obj-n := -obj-m := -obj- := -export-objs := +L_TARGET := appletalk.a obj-$(CONFIG_LTPC) += ltpc.o obj-$(CONFIG_COPS) += cops.o obj-$(CONFIG_IPDDP) += ipddp.o -L_TARGET := appletalk.a -L_OBJS := $(filter-out $(export-objs), $(obj-y)) -LX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/net/arcnet/Makefile linux/drivers/net/arcnet/Makefile --- linux.orig/drivers/net/arcnet/Makefile Fri May 5 15:27:04 2000 +++ linux/drivers/net/arcnet/Makefile Sun May 14 12:24:38 2000 @@ -9,10 +9,8 @@ MOD_SUB_DIRS := $(SUB_DIRS) ALL_SUB_DIRS := $(SUB_DIRS) -obj-y := -obj-n := -obj-m := -obj- := +L_TARGET := arcnet.a + export-objs := arcnet.o com20020.o obj-$(CONFIG_ARCNET) += arcnet.o @@ -26,10 +24,4 @@ obj-$(CONFIG_ARCNET_COM20020_ISA) += com20020-isa.o obj-$(CONFIG_ARCNET_COM20020_PCI) += com20020-pci.o -L_TARGET := arcnet.a -L_OBJS := $(filter-out $(export-objs), $(obj-y)) -LX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/net/pcmcia/Makefile linux/drivers/net/pcmcia/Makefile --- linux.orig/drivers/net/pcmcia/Makefile Fri May 5 15:36:20 2000 +++ linux/drivers/net/pcmcia/Makefile Sun May 14 12:25:03 2000 @@ -11,11 +11,6 @@ O_TARGET := pcmcia_net.o MOD_LIST_NAME := PCMCIA_NET_MODULES -obj-y := -obj-m := -obj-n := -obj- := - # Things that need to export symbols export-objs := ray_cs.o @@ -40,12 +35,7 @@ obj-$(CONFIG_PCMCIA_IBMTR) += ibmtr_cs.o -O_OBJS := $(filter-out $(export-objs), $(obj-y)) -OX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(filter-out $(export-objs), $(obj-m)) -MX_OBJS := $(filter $(export-objs), $(obj-m)) - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc .ibmtr.o: ../tokenring/ibmtr.c $(CC) $(CFLAGS) -D__NO_VERSION__ -DPCMCIA -c -o $@ ../tokenring/ibmtr.c diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/net/tokenring/Makefile linux/drivers/net/tokenring/Makefile --- linux.orig/drivers/net/tokenring/Makefile Fri May 5 15:35:32 2000 +++ linux/drivers/net/tokenring/Makefile Sun May 14 12:24:29 2000 @@ -10,10 +10,8 @@ MOD_SUB_DIRS := $(SUB_DIRS) ALL_SUB_DIRS := $(SUB_DIRS) -obj-y := -obj-n := -obj-m := -obj- := +L_TARGET := tr.a + export-objs := tms380tr.o obj-$(CONFIG_IBMTR) += ibmtr.o @@ -25,10 +23,4 @@ obj-$(CONFIG_TMSPCI) += tmspci.o obj-$(CONFIG_SMCTR) += smctr.o -L_TARGET := tr.a -L_OBJS := $(filter-out $(export-objs), $(obj-y)) -LX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/scsi/pcmcia/Makefile linux/drivers/scsi/pcmcia/Makefile --- linux.orig/drivers/scsi/pcmcia/Makefile Fri May 5 15:28:46 2000 +++ linux/drivers/scsi/pcmcia/Makefile Sun May 14 12:25:41 2000 @@ -10,11 +10,6 @@ MOD_LIST_NAME := PCMCIA_SCSI_MODULES -obj-y := -obj-m := -obj-n := -obj- := - vpath %c .. CFLAGS_aha152x.o = -DPCMCIA -D__NO_VERSION__ -DAHA152X_STAT @@ -36,23 +31,7 @@ fdomain-objs := fdomain_stub.o fdomain.o qlogic-objs := qlogic_stub.o qlogicfas.o -# Extract lists of the multi-part drivers. - -multi-y := $(filter $(list-multi), $(obj-y)) -multi-m := $(filter $(list-multi), $(obj-m)) -int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) -int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) - -# Translate to Rules.make lists. - -O_OBJS := $(filter-out $(export-objs), $(obj-y)) -OX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(filter-out $(export-objs), $(obj-m)) -MX_OBJS := $(filter $(export-objs), $(obj-m)) -MI_OBJS := $(filter-out $(export-objs), $(int-m)) -MIX_OBJS := $(filter $(export-objs), $(int-m)) - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc aha152x_cs.o: $(aha152x-objs) $(LD) -r -o $@ $(aha152x-objs) diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/sound/Makefile linux/drivers/sound/Makefile --- linux.orig/drivers/sound/Makefile Fri May 12 20:57:22 2000 +++ linux/drivers/sound/Makefile Sun May 14 12:25:58 2000 @@ -3,15 +3,14 @@ # 18 Apr 1998, Michael Elizabeth Chastain, <mailto:mec@shout.net> # Rewritten to use lists instead of if-statements. - - -# My subdirectories. - SUB_DIRS := MOD_SUB_DIRS := MOD_IN_SUB_DIRS := ALL_SUB_DIRS := $(SUB_DIRS) emu10k1 +O_TARGET := sounddrivers.o +MOD_LIST_NAME := SOUND_MODULES + # All of the (potential) objects that export symbols. # This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'. @@ -21,16 +20,6 @@ nm256_audio.o ac97.o ac97_codec.o - -# Object file lists. - -obj-y := -obj-m := -obj-n := -obj- := - - - # Each configuration option enables a list of files. obj-$(CONFIG_SOUND) += soundcore.o @@ -121,43 +110,7 @@ vidc_mod-objs := vidc.o vidc_fill.o wavefront-objs := wavfront.o wf_midi.o yss225.o - -# Extract lists of the multi-part drivers. -# The 'int-*' lists are the intermediate files used to build the multi's. - -multi-y := $(filter $(list-multi), $(obj-y)) -multi-m := $(filter $(list-multi), $(obj-m)) -int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) -int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) - - - -# Files that are both resident and modular: remove from modular. - -obj-m := $(filter-out $(obj-y), $(obj-m)) -int-m := $(filter-out $(int-y), $(int-m)) - - -# Take multi-part drivers out of obj-y and put components in. - -obj-y := $(filter-out $(list-multi), $(obj-y)) $(int-y) - - - -# Translate to Rules.make lists. - -O_TARGET := sounddrivers.o -MOD_LIST_NAME := SOUND_MODULES - -O_OBJS := $(filter-out $(export-objs), $(obj-y)) -OX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) -MI_OBJS := $(sort $(filter-out $(export-objs), $(int-m))) -MIX_OBJS := $(sort $(filter $(export-objs), $(int-m))) - -include $(TOPDIR)/Rules.make - +include $(TOPDIR)/Makefile.inc # Link rules for multi-part drivers. diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/sound/dmasound/Makefile linux/drivers/sound/dmasound/Makefile --- linux.orig/drivers/sound/dmasound/Makefile Fri May 5 15:36:03 2000 +++ linux/drivers/sound/dmasound/Makefile Sun May 14 12:26:08 2000 @@ -7,11 +7,9 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... -O_TARGET := -O_OBJS := -OX_OBJS := -M_OBJS := -MX_OBJS := +ifeq ($(CONFIG_DMASOUND),y) + O_TARGET = dmasound.o +endif export-objs := dmasound_core.o @@ -20,19 +18,5 @@ obj-$(CONFIG_DMASOUND_PAULA) += dmasound_core.o dmasound_paula.o obj-$(CONFIG_DMASOUND_Q40) += dmasound_core.o dmasound_q40.o -# Files that are both resident and modular: remove from modular. - -obj-m := $(filter-out $(obj-y), $(obj-m)) - -# Translate to Rules.make lists. - -O_OBJS := $(filter-out $(export-objs), $(obj-y)) -OX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) - -ifeq ($(CONFIG_DMASOUND),y) - O_TARGET = dmasound.o -endif -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/usb/Makefile linux/drivers/usb/Makefile --- linux.orig/drivers/usb/Makefile Fri May 5 15:36:03 2000 +++ linux/drivers/usb/Makefile Sun May 14 12:30:43 2000 @@ -9,11 +9,7 @@ MOD_IN_SUB_DIRS := $(SUB_DIRS) ALL_SUB_DIRS := $(SUB_DIRS) serial -# The target object and module list name. - O_TARGET := usbdrv.o -M_OBJS := -O_OBJS := MOD_LIST_NAME := USB_MODULES # Objects that export symbols. @@ -31,13 +27,6 @@ usbcore-objs += devio.o inode.o drivers.o devices.o endif -# Object file lists. - -obj-y := -obj-m := -obj-n := -obj- := - # Object files in subdirectories ifeq ($(CONFIG_USB_SERIAL),y) @@ -83,35 +72,7 @@ obj-$(CONFIG_USB_RIO500) += rio500.o obj-$(CONFIG_USB_DSBR) += dsbr100.o -# Extract lists of the multi-part drivers. -# The 'int-*' lists are the intermediate files used to build the multi's. - -multi-y := $(filter $(list-multi), $(obj-y)) -multi-m := $(filter $(list-multi), $(obj-m)) -int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) -int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) - -# Files that are both resident and modular: remove from modular. - -obj-m := $(filter-out $(obj-y), $(obj-m)) -int-m := $(filter-out $(int-y), $(int-m)) - -# Take multi-part drivers out of obj-y and put components in. - -obj-y := $(filter-out $(list-multi), $(obj-y)) $(int-y) - -# Translate to Rules.make lists. - -O_OBJS := $(sort $(filter-out $(export-objs), $(obj-y))) -OX_OBJS := $(sort $(filter $(export-objs), $(obj-y))) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) -MI_OBJS := $(sort $(filter-out $(export-objs), $(int-m))) -MIX_OBJS := $(sort $(filter $(export-objs), $(int-m))) - -# The global Rules.make. - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc # Link rules for multi-part drivers. diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/video/Makefile linux/drivers/video/Makefile --- linux.orig/drivers/video/Makefile Fri May 12 20:57:22 2000 +++ linux/drivers/video/Makefile Sun May 14 12:59:55 2000 @@ -8,14 +8,18 @@ ALL_SUB_DIRS := $(SUB_DIRS) matrox riva O_TARGET := video.o -O_OBJS := -M_OBJS := # This is a nice idea but needs depmod altering # MOD_LIST_NAME := VIDEO_MODULES # All of the (potential) objects that export symbols. # This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'. +obj-y := +obj-m := +obj-n := +obj- := +list-multi := + export-objs := fbmem.o fbcmap.o fbcon.o fbmon.o modedb.o \ fbcon-afb.o fbcon-ilbm.o \ fbcon-vga.o fbcon-iplan2p2.o fbcon-iplan2p4.o \ @@ -23,12 +27,7 @@ fbcon-cfb2.o fbcon-cfb24.o fbcon-cfb32.o fbcon-cfb4.o \ fbcon-cfb8.o fbcon-mac.o fbcon-mfb.o fbcon-vga8-planes.o \ matrox/matroxfb.o cyber2000fb.o fbcon-hga.o - -# Object file lists. -obj-y := -obj-m := -obj-n := -obj- := + # fbcon-vga8-planes.c doesn't exist ... -ch # Each configuration option enables a list of files. @@ -134,31 +133,7 @@ obj-$(CONFIG_FBCON_VGA) += fbcon-vga.o obj-$(CONFIG_FBCON_HGA) += fbcon-hga.o -# Extract lists of the multi-part drivers. -# The 'int-*' lists are the intermediate files used to build the multi's. - -multi-y := $(filter $(list-multi), $(obj-y)) -multi-m := $(filter $(list-multi), $(obj-m)) -int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) -int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) - -# Files that are both resident and modular: remove from modular. - -obj-m := $(filter-out $(obj-y), $(obj-m)) -int-m := $(filter-out $(int-y), $(int-m)) - -# Take multi-part drivers out of obj-y and put components in. - -obj-y := $(filter-out $(list-multi), $(obj-y)) $(int-y) - -# Translate to Rules.make lists. - -O_OBJS := $(filter-out $(export-objs), $(obj-y)) -OX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc clean: rm -f core *.o *.a *.s diff -rNu --exclude-from=/usr/src/exclude linux.orig/drivers/video/matrox/Makefile linux/drivers/video/matrox/Makefile --- linux.orig/drivers/video/matrox/Makefile Fri May 5 15:29:16 2000 +++ linux/drivers/video/matrox/Makefile Sun May 14 12:28:07 2000 @@ -8,8 +8,6 @@ ALL_SUB_DIRS := $(SUB_DIRS) O_TARGET := matrox.o -O_OBJS := -M_OBJS := # This is a nice idea but needs depmod altering # MOD_LIST_NAME := VIDEO_MODULES @@ -18,43 +16,13 @@ export-objs := matroxfb_base.o matroxfb_accel.o matroxfb_DAC1064.o matroxfb_Ti3026.o matroxfb_misc.o -# Object file lists. -obj-y := -obj-m := -obj-n := -obj- := - # Each configuration option enables a list of files. obj-$(CONFIG_FB_MATROX) += matroxfb_base.o matroxfb_accel.o matroxfb_DAC1064.o matroxfb_Ti3026.o matroxfb_misc.o obj-$(CONFIG_FB_MATROX_I2C) += i2c-matroxfb.o obj-$(CONFIG_FB_MATROX_MAVEN) += matroxfb_maven.o matroxfb_crtc2.o -# Extract lists of the multi-part drivers. -# The 'int-*' lists are the intermediate files used to build the multi's. - -multi-y := $(filter $(list-multi), $(obj-y)) -multi-m := $(filter $(list-multi), $(obj-m)) -int-y := $(sort $(foreach m, $(multi-y), $($(basename $(m))-objs))) -int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs))) - -# Files that are both resident and modular: remove from modular. - -obj-m := $(filter-out $(obj-y), $(obj-m)) -int-m := $(filter-out $(int-y), $(int-m)) - -# Take multi-part drivers out of obj-y and put components in. - -obj-y := $(filter-out $(list-multi), $(obj-y)) $(int-y) - -# Translate to Rules.make lists. - -O_OBJS := $(filter-out $(export-objs), $(obj-y)) -OX_OBJS := $(filter $(export-objs), $(obj-y)) -M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) -MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) - -include $(TOPDIR)/Rules.make +include $(TOPDIR)/Makefile.inc clean: rm -f core *.o *.a *.s

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:24 EST