lkml.org 
[lkml]   [2000]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] Additional patch for toplevel Makefile driver lists
Linus Torvalds wrote:
>
> On Sat, 18 Mar 2000, Brian Gerst wrote:
> >
> > Linus, this is a resend of the patch to you. I'm not certain it made it
> > to you the first time.
>
> I don't much like this.
>
> It smells too much like working around a real misfeature, the same way
> we're working around the xargs bug.
>
> Maybe the correct thing is to just get rid of .EXPORT_ALL_SYMBOLS and
> instead try to make us better at exporting the real stuff only to the
> places we want them?
>
> Linus

How does this look as a first stab? The magic is in the MAKEFILES
variable. It causes the sub-makes to read in .config before the rest of
the Makefile instead of having to add it to every single file. I do not
know if this is specific to GNU make or not. I tested it with i386, and
I checked the rest of the arches for variables that needed to be
exported.

--

Brian Gerstdiff -urN linux-2.3.99p2-5/Makefile linux/Makefile
--- linux-2.3.99p2-5/Makefile Sat Mar 18 17:40:35 2000
+++ linux/Makefile Sun Mar 19 00:51:34 2000
@@ -3,9 +3,9 @@
SUBLEVEL = 99
EXTRAVERSION = -pre2

-ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
+KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)

-.EXPORT_ALL_VARIABLES:
+ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)

CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
@@ -20,17 +20,24 @@

CROSS_COMPILE =

-AS =$(CROSS_COMPILE)as
-LD =$(CROSS_COMPILE)ld
-CC =$(CROSS_COMPILE)gcc
-CPP =$(CC) -E
-AR =$(CROSS_COMPILE)ar
-NM =$(CROSS_COMPILE)nm
-STRIP =$(CROSS_COMPILE)strip
-OBJCOPY =$(CROSS_COMPILE)objcopy
-OBJDUMP =$(CROSS_COMPILE)objdump
-MAKE =make
-GENKSYMS=/sbin/genksyms
+AS = $(CROSS_COMPILE)as
+LD = $(CROSS_COMPILE)ld
+CC = $(CROSS_COMPILE)gcc
+CPP = $(CC) -E
+AR = $(CROSS_COMPILE)ar
+NM = $(CROSS_COMPILE)nm
+STRIP = $(CROSS_COMPILE)strip
+OBJCOPY = $(CROSS_COMPILE)objcopy
+OBJDUMP = $(CROSS_COMPILE)objdump
+MAKE = make
+MAKEFILES = $(TOPDIR)/.config
+GENKSYMS = /sbin/genksyms
+MODFLAGS = -DMODULE
+PERL = perl
+
+export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH CONFIG_SHELL TOPDIR HPATH \
+ FINDHPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP MAKE \
+ MAKEFILES GENKSYMS MODFLAGS PERL

all: do-it-all

@@ -53,20 +60,10 @@
endif

#
-# 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
-
-KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-
-#
# INSTALL_PATH specifies where to place the updated kernel and system map
# images. Uncomment if you want to place them anywhere other than root.

-#INSTALL_PATH=/boot
+#export INSTALL_PATH=/boot

#
# INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
@@ -74,34 +71,47 @@
# makefile but the arguement can be passed to make if needed.
#

+CPPFLAGS := -D__KERNEL__ -I$(HPATH)
+
+ifdef CONFIG_SMP
+CPPFLAGS += -D__SMP__
+endif
+
+CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+AFLAGS := $(CPPFLAGS)
+
+export CPPFLAGS CFLAGS AFLAGS
+
+#
+# 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.
#

-SVGA_MODE= -DSVGA_MODE=NORMAL_VGA
+export SVGA_MODE = -DSVGA_MODE=NORMAL_VGA

#
# standard CFLAGS
#

-CPPFLAGS := -D__KERNEL__ -I$(HPATH)
-
-ifdef CONFIG_SMP
-CPPFLAGS += -D__SMP__
-endif
-
-CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
-AFLAGS := $(CPPFLAGS)
-
#
# if you want the RAM disk device, define this to be the
# size in blocks.
+# This is i386 specific.
#

-#RAMDISK = -DRAMDISK=512
+#export RAMDISK = -DRAMDISK=512

# Include the make variables (CC, etc...)
#
@@ -166,6 +176,8 @@

include arch/$(ARCH)/Makefile

+export CORE_FILES NETWORKS DRIVERS LIBS HEAD LDFLAGS LIBS LINKFLAGS MAKEBOOT ASFLAGS
+
# use '-fno-strict-aliasing', but only if the compiler can take it
CFLAGS += $(shell if $(CC) -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-fno-strict-aliasing"; fi)

@@ -276,7 +288,6 @@
find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \
find $(SUBDIRS) init -name '*.c' | xargs ctags $$CTAGSF -a

-MODFLAGS += -DMODULE
ifdef CONFIG_MODULES
ifdef CONFIG_MODVERSIONS
MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h
@@ -405,11 +416,12 @@
scripts/mkdep `find $(FINDHPATH) -follow -name \*.h ! -name modversions.h -print` > .hdepend
$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)"

-MODVERFILE :=
-
ifdef CONFIG_MODVERSIONS
MODVERFILE := $(TOPDIR)/include/linux/modversions.h
+else
+MODVERFILE :=
endif
+export MODVERFILE

depend dep: dep-files $(MODVERFILE)

diff -urN linux-2.3.99p2-5/arch/arm/Makefile linux/arch/arm/Makefile
--- linux-2.3.99p2-5/arch/arm/Makefile Wed Mar 15 00:25:16 2000
+++ linux/arch/arm/Makefile Sun Mar 19 01:00:55 2000
@@ -14,7 +14,6 @@

OBJCOPY := $(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
CPP := $(CC) -E
-PERL := perl
LINKFLAGS := -p -X -T arch/arm/vmlinux.lds
ARCHCC := $(word 1,$(CC))

diff -urN linux-2.3.99p2-5/arch/sparc/Makefile linux/arch/sparc/Makefile
--- linux-2.3.99p2-5/arch/sparc/Makefile Wed Mar 8 20:15:52 2000
+++ linux/arch/sparc/Makefile Sun Mar 19 00:11:45 2000
@@ -49,6 +49,8 @@
CORE_FILES_NO_BTFIX := $(CORE_FILES)
CORE_FILES += arch/sparc/boot/btfix.o

+export CORE_FILES_NO_BTFIX
+
archclean:
rm -f $(TOPDIR)/vmlinux.aout
-$(MAKE) -C arch/sparc/boot clean
\
 
 \ /
  Last update: 2005-03-22 13:57    [from the cache]
©2003-2011 Jasper Spaans