Re: [kbuild-devel] [PATCH] Makefile fixes

2001-02-28 Thread Peter Samuelson


[Kai Germaschewski]
> +list-multi   := fore_200e
> +fore_200e-objs   := fore200e.o $(FORE200E_FW_OBJS)

   list-multi   := fore_200e.o

Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] Makefile fixes

2001-02-28 Thread Kai Germaschewski


Could people (particularly the affected maintainers) please look over the 
appended patch, which I'm planning to submit to Linus at an appropriate 
time.

It contains a couple of small Makefile fixes, particularly

o $(list-multi) is supposed to list composite modules, i.e. modules
  which are made out of multiple source files.
  Make sure that $(list-multi) is only defined where applicable, and
  that it really lists all composite objects. Some Makefiles forget
  this or use e.g. $(multi-objs) which is wrong. The variable
  $(list-multi) is used in Rules.make, currently only for dependencies,
  that's why most people haven't seen any problems yet.

o For all foo.o listed in $(list-multi) there needs to be a $(foo-objs) 
  which lists the actual parts of the composite module. Currently,
  there also needs to be a link rule for each of the composite objects,
  which looks like

foo.o: $(foo-objs)
$(LD) -r -o $@ $(foo-objs)

  The patch corrects places where this was done incorrectly.

o some cleanup

The reason behind this is that I'm planning to remove the need for the
list-multi and the link rule, and this needs to be done in preparation.
(But it's needed for correctness anyway).

Patch is against 2.4.2-pre3 but still applies cleanly against 2.4.2-final.

--Kai

diff -ur linux-2.4.2-pre3/drivers/atm/Makefile 
linux-2.4.2-pre3.makefixes/drivers/atm/Makefile
--- linux-2.4.2-pre3/drivers/atm/Makefile   Sun Jan 21 01:27:44 2001
+++ linux-2.4.2-pre3.makefixes/drivers/atm/Makefile Fri Feb 16 22:02:02 2001
@@ -50,6 +50,9 @@
 
 EXTRA_CFLAGS=-g
 
+list-multi := fore_200e
+fore_200e-objs := fore200e.o $(FORE200E_FW_OBJS)
+
 include $(TOPDIR)/Rules.make
 
 
@@ -82,9 +85,8 @@
objcopy -Iihex $< -Obinary $@.gz
gzip -df $@.gz
 
-# module build
-fore_200e.o: fore200e.o $(FORE200E_FW_OBJS)
-   $(LD) -r -o $@ $< $(FORE200E_FW_OBJS)
+fore_200e.o: $(fore_200e-objs)
+   $(LD) -r -o $@ $(fore_200e-objs)
 
 # firmware dependency stuff taken from drivers/sound/Makefile
 FORE200E_FW_UP_TO_DATE :=
diff -ur linux-2.4.2-pre3/drivers/char/Makefile 
linux-2.4.2-pre3.makefixes/drivers/char/Makefile
--- linux-2.4.2-pre3/drivers/char/Makefile  Thu Jan  4 22:00:55 2001
+++ linux-2.4.2-pre3.makefixes/drivers/char/MakefileFri Feb 16 21:54:28 2001
@@ -27,8 +27,6 @@
 
 mod-subdirs:=  joystick ftape drm pcmcia
 
-list-multi :=  
-
 KEYMAP   =defkeymap.o
 KEYBD=pc_keyb.o
 CONSOLE  =console.o
diff -ur linux-2.4.2-pre3/drivers/char/agp/Makefile 
linux-2.4.2-pre3.makefixes/drivers/char/agp/Makefile
--- linux-2.4.2-pre3/drivers/char/agp/Makefile  Fri Dec 29 23:07:21 2000
+++ linux-2.4.2-pre3.makefixes/drivers/char/agp/MakefileFri Feb 16 21:54:28 
+2001
@@ -7,7 +7,7 @@
 
 export-objs := agpgart_be.o
 
-multi-objs := agpgart.o
+list-multi := agpgart.o
 agpgart-objs := agpgart_fe.o agpgart_be.o
 
 obj-$(CONFIG_AGP) += agpgart.o
diff -ur linux-2.4.2-pre3/drivers/char/drm/Makefile 
linux-2.4.2-pre3.makefixes/drivers/char/drm/Makefile
--- linux-2.4.2-pre3/drivers/char/drm/Makefile  Fri Feb 16 21:51:13 2001
+++ linux-2.4.2-pre3.makefixes/drivers/char/drm/MakefileFri Feb 16 21:56:32 
+2001
@@ -3,12 +3,10 @@
 # the Direct Rendering Infrastructure (DRI) in XFree86 4.x.
 #
 
-# drm.o is a fake target -- it is never built
-# The real targets are in the module-list
 O_TARGET   := drm.o
 
-module-list := gamma.o tdfx.o r128.o ffb.o mga.o i810.o
-export-objs := $(patsubst %.o,%_drv.o,$(module-list))
+export-objs := gamma_drv.o tdfx_drv.o r128_drv.o ffb_drv.o mga_drv.o \
+  i810_drv.o
 
 # lib-objs are included in every module so that radical changes to the
 # architecture of the DRM support library can be made at a later time.
@@ -42,6 +40,7 @@
  endif
 endif
 
+list-multi  := gamma.o tdfx.o r128.o ffb.o mga.o i810.o
 gamma-objs  := gamma_drv.o  gamma_dma.o
 tdfx-objs   := tdfx_drv.o tdfx_context.o
 r128-objs   := r128_drv.o   r128_cce.or128_context.o r128_bufs.o r128_state.o
diff -ur linux-2.4.2-pre3/drivers/fc4/Makefile 
linux-2.4.2-pre3.makefixes/drivers/fc4/Makefile
--- linux-2.4.2-pre3/drivers/fc4/Makefile   Fri Dec 29 23:07:21 2000
+++ linux-2.4.2-pre3.makefixes/drivers/fc4/Makefile Fri Feb 16 21:54:28 2001
@@ -14,7 +14,7 @@
 obj-$(CONFIG_FC4_SOC) += soc.o
 obj-$(CONFIG_FC4_SOCAL) += socal.o
 
+include $(TOPDIR)/Rules.make
+
 fc4.o: $(fc4-objs)
$(LD) -r -o $@ $(fc4-objs)
-
-include $(TOPDIR)/Rules.make
diff -ur linux-2.4.2-pre3/drivers/media/radio/Makefile 
linux-2.4.2-pre3.makefixes/drivers/media/radio/Makefile
--- linux-2.4.2-pre3/drivers/media/radio/Makefile   Fri Dec 29 23:07:22 2000
+++ linux-2.4.2-pre3.makefixes/drivers/media/radio/Makefile Fri Feb 16 21:54:28 
+2001
@@ -9,21 +9,12 @@
 # parent makes..
 #
 
-# Object file lists.
-
-obj-y  :=
-obj-m  :=
-obj-n  :=
-obj-   :=
-
 O_TARGET := radio.o
 
 # All of the (potential) objects that 

Re: [kbuild-devel] [PATCH] Makefile fixes

2001-02-28 Thread Peter Samuelson


[Kai Germaschewski]
 +list-multi   := fore_200e
 +fore_200e-objs   := fore200e.o $(FORE200E_FW_OBJS)

   list-multi   := fore_200e.o

Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] Makefile fixes

2001-02-28 Thread Kai Germaschewski


Could people (particularly the affected maintainers) please look over the 
appended patch, which I'm planning to submit to Linus at an appropriate 
time.

It contains a couple of small Makefile fixes, particularly

o $(list-multi) is supposed to list composite modules, i.e. modules
  which are made out of multiple source files.
  Make sure that $(list-multi) is only defined where applicable, and
  that it really lists all composite objects. Some Makefiles forget
  this or use e.g. $(multi-objs) which is wrong. The variable
  $(list-multi) is used in Rules.make, currently only for dependencies,
  that's why most people haven't seen any problems yet.

o For all foo.o listed in $(list-multi) there needs to be a $(foo-objs) 
  which lists the actual parts of the composite module. Currently,
  there also needs to be a link rule for each of the composite objects,
  which looks like

foo.o: $(foo-objs)
$(LD) -r -o $@ $(foo-objs)

  The patch corrects places where this was done incorrectly.

o some cleanup

The reason behind this is that I'm planning to remove the need for the
list-multi and the link rule, and this needs to be done in preparation.
(But it's needed for correctness anyway).

Patch is against 2.4.2-pre3 but still applies cleanly against 2.4.2-final.

--Kai

diff -ur linux-2.4.2-pre3/drivers/atm/Makefile 
linux-2.4.2-pre3.makefixes/drivers/atm/Makefile
--- linux-2.4.2-pre3/drivers/atm/Makefile   Sun Jan 21 01:27:44 2001
+++ linux-2.4.2-pre3.makefixes/drivers/atm/Makefile Fri Feb 16 22:02:02 2001
@@ -50,6 +50,9 @@
 
 EXTRA_CFLAGS=-g
 
+list-multi := fore_200e
+fore_200e-objs := fore200e.o $(FORE200E_FW_OBJS)
+
 include $(TOPDIR)/Rules.make
 
 
@@ -82,9 +85,8 @@
objcopy -Iihex $ -Obinary $@.gz
gzip -df $@.gz
 
-# module build
-fore_200e.o: fore200e.o $(FORE200E_FW_OBJS)
-   $(LD) -r -o $@ $ $(FORE200E_FW_OBJS)
+fore_200e.o: $(fore_200e-objs)
+   $(LD) -r -o $@ $(fore_200e-objs)
 
 # firmware dependency stuff taken from drivers/sound/Makefile
 FORE200E_FW_UP_TO_DATE :=
diff -ur linux-2.4.2-pre3/drivers/char/Makefile 
linux-2.4.2-pre3.makefixes/drivers/char/Makefile
--- linux-2.4.2-pre3/drivers/char/Makefile  Thu Jan  4 22:00:55 2001
+++ linux-2.4.2-pre3.makefixes/drivers/char/MakefileFri Feb 16 21:54:28 2001
@@ -27,8 +27,6 @@
 
 mod-subdirs:=  joystick ftape drm pcmcia
 
-list-multi :=  
-
 KEYMAP   =defkeymap.o
 KEYBD=pc_keyb.o
 CONSOLE  =console.o
diff -ur linux-2.4.2-pre3/drivers/char/agp/Makefile 
linux-2.4.2-pre3.makefixes/drivers/char/agp/Makefile
--- linux-2.4.2-pre3/drivers/char/agp/Makefile  Fri Dec 29 23:07:21 2000
+++ linux-2.4.2-pre3.makefixes/drivers/char/agp/MakefileFri Feb 16 21:54:28 
+2001
@@ -7,7 +7,7 @@
 
 export-objs := agpgart_be.o
 
-multi-objs := agpgart.o
+list-multi := agpgart.o
 agpgart-objs := agpgart_fe.o agpgart_be.o
 
 obj-$(CONFIG_AGP) += agpgart.o
diff -ur linux-2.4.2-pre3/drivers/char/drm/Makefile 
linux-2.4.2-pre3.makefixes/drivers/char/drm/Makefile
--- linux-2.4.2-pre3/drivers/char/drm/Makefile  Fri Feb 16 21:51:13 2001
+++ linux-2.4.2-pre3.makefixes/drivers/char/drm/MakefileFri Feb 16 21:56:32 
+2001
@@ -3,12 +3,10 @@
 # the Direct Rendering Infrastructure (DRI) in XFree86 4.x.
 #
 
-# drm.o is a fake target -- it is never built
-# The real targets are in the module-list
 O_TARGET   := drm.o
 
-module-list := gamma.o tdfx.o r128.o ffb.o mga.o i810.o
-export-objs := $(patsubst %.o,%_drv.o,$(module-list))
+export-objs := gamma_drv.o tdfx_drv.o r128_drv.o ffb_drv.o mga_drv.o \
+  i810_drv.o
 
 # lib-objs are included in every module so that radical changes to the
 # architecture of the DRM support library can be made at a later time.
@@ -42,6 +40,7 @@
  endif
 endif
 
+list-multi  := gamma.o tdfx.o r128.o ffb.o mga.o i810.o
 gamma-objs  := gamma_drv.o  gamma_dma.o
 tdfx-objs   := tdfx_drv.o tdfx_context.o
 r128-objs   := r128_drv.o   r128_cce.or128_context.o r128_bufs.o r128_state.o
diff -ur linux-2.4.2-pre3/drivers/fc4/Makefile 
linux-2.4.2-pre3.makefixes/drivers/fc4/Makefile
--- linux-2.4.2-pre3/drivers/fc4/Makefile   Fri Dec 29 23:07:21 2000
+++ linux-2.4.2-pre3.makefixes/drivers/fc4/Makefile Fri Feb 16 21:54:28 2001
@@ -14,7 +14,7 @@
 obj-$(CONFIG_FC4_SOC) += soc.o
 obj-$(CONFIG_FC4_SOCAL) += socal.o
 
+include $(TOPDIR)/Rules.make
+
 fc4.o: $(fc4-objs)
$(LD) -r -o $@ $(fc4-objs)
-
-include $(TOPDIR)/Rules.make
diff -ur linux-2.4.2-pre3/drivers/media/radio/Makefile 
linux-2.4.2-pre3.makefixes/drivers/media/radio/Makefile
--- linux-2.4.2-pre3/drivers/media/radio/Makefile   Fri Dec 29 23:07:22 2000
+++ linux-2.4.2-pre3.makefixes/drivers/media/radio/Makefile Fri Feb 16 21:54:28 
+2001
@@ -9,21 +9,12 @@
 # parent makes..
 #
 
-# Object file lists.
-
-obj-y  :=
-obj-m  :=
-obj-n  :=
-obj-   :=
-
 O_TARGET := radio.o
 
 # All of the (potential) objects that