[PATCH] $(CC) vs. $(CPPFLAGS)

Peter Samuelson (peter@wire.cadcamlab.org)
Thu, 28 Oct 1999 04:24:16 -0500 (CDT)


--/cQ4xfuGJl
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello, world\n

Last week on the linux-kbuild list I threw out a patch to clean up
Linux kernel makefile $(CC) handling, basically to allow me to say

make CC='gcc -V2.7.2.3' zImage

I've tested it with various i386 and ppc targets, gotten a little
feedback from linux-kbuild, and fixed the Last Few Bugs[tm].
Unfortunately that list of the Last Few Bugs may not take into account
any architectures but Intel and PowerPC, or any weird configurations.
That's where all of you come in.

If anyone has anything bad to say about this patch, speak now. If not
I will ask Michael Chastain to send it Upstream for 2.3.x. The patch
lives in http://peter.cadcamlab.org/linux/ and is against 2.3.2[34].

-- 
Peter Samuelson
<sampo.creighton.edu!psamuels>

--/cQ4xfuGJl Content-Type: text/plain Content-Disposition: inline; filename="makefile-CC-2.3.24-1.diff" Content-Transfer-Encoding: 7bit

diff -urN linux-2.3.24/patchdesc.CC linux-2.3.24-CC/patchdesc.CC --- linux-2.3.24/patchdesc.CC Wed Dec 31 18:00:00 1969 +++ linux-2.3.24-CC/patchdesc.CC Thu Oct 28 02:31:12 1999 @@ -0,0 +1,4 @@ +CC: clean up $(CC) handling - Peter Samuelson <peter@cadcamlab.org> + +This little patch moves compile flags out of $(CC) into $(CPPFLAGS), +which allows "make CC=mygcc" etc. diff -urN linux-2.3.24/Makefile linux-2.3.24-CC/Makefile --- linux-2.3.24/Makefile Thu Oct 28 02:29:42 1999 +++ linux-2.3.24-CC/Makefile Thu Oct 28 02:31:12 1999 @@ -22,7 +22,7 @@ AS =$(CROSS_COMPILE)as LD =$(CROSS_COMPILE)ld -CC =$(CROSS_COMPILE)gcc -D__KERNEL__ -I$(HPATH) +CC =$(CROSS_COMPILE)gcc CPP =$(CC) -E AR =$(CROSS_COMPILE)ar NM =$(CROSS_COMPILE)nm @@ -86,14 +86,15 @@ # standard CFLAGS # -CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer +CPPFLAGS = -D__KERNEL__ -I$(HPATH) +CFLAGS = $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer +AFLAGS = $(CPPFLAGS) # 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) ifdef CONFIG_SMP -CFLAGS += -D__SMP__ -AFLAGS += -D__SMP__ +CPPFLAGS += -D__SMP__ endif # diff -urN linux-2.3.24/arch/alpha/boot/Makefile linux-2.3.24-CC/arch/alpha/boot/Makefile --- linux-2.3.24/arch/alpha/boot/Makefile Mon Oct 12 13:40:12 1998 +++ linux-2.3.24-CC/arch/alpha/boot/Makefile Thu Oct 28 02:31:12 1999 @@ -11,9 +11,9 @@ LINKFLAGS = -static -T bootloader.lds #-N -relax .S.s: - $(CC) -D__ASSEMBLY__ -traditional -E -o $*.o $< + $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -E -o $*.o $< .S.o: - $(CC) -D__ASSEMBLY__ -traditional -c -o $*.o $< + $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $< OBJECTS = head.o main.o BPOBJECTS = head.o bootp.o diff -urN linux-2.3.24/arch/alpha/lib/Makefile linux-2.3.24-CC/arch/alpha/lib/Makefile --- linux-2.3.24/arch/alpha/lib/Makefile Fri Aug 6 12:41:47 1999 +++ linux-2.3.24-CC/arch/alpha/lib/Makefile Thu Oct 28 02:31:12 1999 @@ -14,16 +14,16 @@ $(AR) rcs lib.a $(OBJS) __divqu.o: divide.S - $(CC) -DDIV -c -o __divqu.o divide.S + $(CC) $(AFLAGS) -DDIV -c -o __divqu.o divide.S __remqu.o: divide.S - $(CC) -DREM -c -o __remqu.o divide.S + $(CC) $(AFLAGS) -DREM -c -o __remqu.o divide.S __divlu.o: divide.S - $(CC) -DDIV -DINTSIZE -c -o __divlu.o divide.S + $(CC) $(AFLAGS) -DDIV -DINTSIZE -c -o __divlu.o divide.S __remlu.o: divide.S - $(CC) -DREM -DINTSIZE -c -o __remlu.o divide.S + $(CC) $(AFLAGS) -DREM -DINTSIZE -c -o __remlu.o divide.S dep: diff -urN linux-2.3.24/arch/arm/boot/compressed/Makefile linux-2.3.24-CC/arch/arm/boot/compressed/Makefile --- linux-2.3.24/arch/arm/boot/compressed/Makefile Sat Oct 23 05:45:55 1999 +++ linux-2.3.24-CC/arch/arm/boot/compressed/Makefile Thu Oct 28 02:31:12 1999 @@ -6,7 +6,7 @@ HEAD = head.o OBJS = misc.o SYSTEM = $(TOPDIR)/vmlinux -CFLAGS = -O2 -DSTDC_HEADERS $(CFLAGS_PROC) +CFLAGS = $(CPPFLAGS) -O2 -DSTDC_HEADERS $(CFLAGS_PROC) FONTC = $(TOPDIR)/drivers/video/font_acorn_8x8.c ZLDFLAGS = -X -T vmlinux.lds @@ -77,7 +77,7 @@ $(LD) $(ZLDFLAGS) $(HEAD) $(OBJS) piggy.o $(GCCLIB) -o vmlinux $(HEAD): $(HEAD:.o=.S) - $(CC) -traditional -c $(HEAD:.o=.S) + $(CC) $(AFLAGS) -traditional -c $(HEAD:.o=.S) piggy.o: $(SYSTEM) $(OBJCOPY) $(SYSTEM) piggy @@ -86,7 +86,7 @@ rm -f piggy piggy.gz font.o: $(FONTC) - $(CC) -Dstatic= -c -o $@ $(FONTC) + $(CC) $(CFLAGS) -Dstatic= -c -o $@ $(FONTC) vmlinux.lds: vmlinux.lds.in @sed "$(SEDFLAGS)" < vmlinux.lds.in > $@ diff -urN linux-2.3.24/arch/arm/kernel/Makefile linux-2.3.24-CC/arch/arm/kernel/Makefile --- linux-2.3.24/arch/arm/kernel/Makefile Sat Oct 23 05:45:55 1999 +++ linux-2.3.24-CC/arch/arm/kernel/Makefile Thu Oct 28 02:31:12 1999 @@ -75,7 +75,7 @@ endif $(HEAD_OBJ): $(HEAD_OBJ:.o=.S) - $(CC) -D__ASSEMBLY__ -DTEXTADDR=$(TEXTADDR) -traditional -c $(HEAD_OBJ:.o=.S) -o $@ + $(CC) -D__ASSEMBLY__ $(AFLAGS) -DTEXTADDR=$(TEXTADDR) -traditional -c $(HEAD_OBJ:.o=.S) -o $@ include $(TOPDIR)/Rules.make diff -urN linux-2.3.24/arch/i386/boot/Makefile linux-2.3.24-CC/arch/i386/boot/Makefile --- linux-2.3.24/arch/i386/boot/Makefile Sat Oct 23 05:45:55 1999 +++ linux-2.3.24-CC/arch/i386/boot/Makefile Thu Oct 28 02:31:12 1999 @@ -49,7 +49,7 @@ $(AS) -o $@ $< bootsect.s: bootsect.S Makefile $(BOOT_INCL) - $(CPP) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@ + $(CPP) $(CPPFLAGS) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@ bbootsect: bbootsect.o $(LD) -Ttext 0x0 -s -oformat binary $< -o $@ @@ -58,7 +58,7 @@ $(AS) --defsym bootsect_kludge=0x220 -o $@ $< bbootsect.s: bootsect.S Makefile $(BOOT_INCL) - $(CPP) -D__BIG_KERNEL__ -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@ + $(CPP) $(CPPFLAGS) -D__BIG_KERNEL__ -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@ setup: setup.o $(LD) -Ttext 0x0 -s -oformat binary -e begtext -o $@ $< @@ -67,7 +67,7 @@ $(AS) -o $@ $< setup.s: setup.S video.S Makefile $(BOOT_INCL) $(TOPDIR)/include/linux/version.h $(TOPDIR)/include/linux/compile.h - $(CPP) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@ + $(CPP) $(CPPFLAGS) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@ bsetup: bsetup.o $(LD) -Ttext 0x0 -s -oformat binary -e begtext -o $@ $< @@ -76,7 +76,7 @@ $(AS) -o $@ $< bsetup.s: setup.S video.S Makefile $(BOOT_INCL) $(TOPDIR)/include/linux/version.h $(TOPDIR)/include/linux/compile.h - $(CPP) -D__BIG_KERNEL__ -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@ + $(CPP) $(CPPFLAGS) -D__BIG_KERNEL__ -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@ dep: diff -urN linux-2.3.24/arch/i386/boot/compressed/Makefile linux-2.3.24-CC/arch/i386/boot/compressed/Makefile --- linux-2.3.24/arch/i386/boot/compressed/Makefile Mon Oct 11 16:06:10 1999 +++ linux-2.3.24-CC/arch/i386/boot/compressed/Makefile Thu Oct 28 02:31:12 1999 @@ -9,7 +9,7 @@ OBJECTS = $(HEAD) misc.o -CFLAGS = -O2 -DSTDC_HEADERS +CFLAGS = $(CPPFLAGS) -O2 -DSTDC_HEADERS ZLDFLAGS = -e startup_32 # diff -urN linux-2.3.24/arch/i386/math-emu/Makefile linux-2.3.24-CC/arch/i386/math-emu/Makefile --- linux-2.3.24/arch/i386/math-emu/Makefile Tue Dec 9 19:57:09 1997 +++ linux-2.3.24-CC/arch/i386/math-emu/Makefile Thu Oct 28 02:31:12 1999 @@ -10,7 +10,7 @@ CFLAGS := $(CFLAGS) $(PARANOID) $(DEBUG) -fno-builtin $(MATH_EMULATION) .S.o: - $(CC) -D__ASSEMBLY__ $(PARANOID) -c $< + $(CC) -D__ASSEMBLY__ $(AFLAGS) $(PARANOID) -c $< # From 'C' language sources: C_OBJS =fpu_entry.o errors.o \ diff -urN linux-2.3.24/arch/m68k/fpsp040/Makefile linux-2.3.24-CC/arch/m68k/fpsp040/Makefile --- linux-2.3.24/arch/m68k/fpsp040/Makefile Fri Dec 20 03:19:58 1996 +++ linux-2.3.24-CC/arch/m68k/fpsp040/Makefile Thu Oct 28 02:31:12 1999 @@ -8,7 +8,7 @@ # Note 2! The CFLAGS definitions are now in the main makefile... .S.o: - $(CC) -D__ASSEMBLY__ -traditional -c -o $*.o $< + $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $< OS_TARGET := fpsp.o diff -urN linux-2.3.24/arch/m68k/ifpsp060/Makefile linux-2.3.24-CC/arch/m68k/ifpsp060/Makefile --- linux-2.3.24/arch/m68k/ifpsp060/Makefile Fri Dec 20 03:19:58 1996 +++ linux-2.3.24-CC/arch/m68k/ifpsp060/Makefile Thu Oct 28 02:31:12 1999 @@ -5,7 +5,7 @@ # for more details. .S.o: - $(CC) -D__ASSEMBLY__ -traditional -c -o $*.o $< + $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $< OS_TARGET := ifpsp.o diff -urN linux-2.3.24/arch/m68k/kernel/Makefile linux-2.3.24-CC/arch/m68k/kernel/Makefile --- linux-2.3.24/arch/m68k/kernel/Makefile Sat Sep 4 15:06:41 1999 +++ linux-2.3.24-CC/arch/m68k/kernel/Makefile Thu Oct 28 02:31:12 1999 @@ -8,7 +8,7 @@ # Note 2! The CFLAGS definitions are now in the main makefile... .S.o: - $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o + $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $*.o ifndef CONFIG_SUN3 all: head.o kernel.o diff -urN linux-2.3.24/arch/m68k/lib/Makefile linux-2.3.24-CC/arch/m68k/lib/Makefile --- linux-2.3.24/arch/m68k/lib/Makefile Wed Sep 25 02:47:40 1996 +++ linux-2.3.24-CC/arch/m68k/lib/Makefile Thu Oct 28 02:31:12 1999 @@ -3,7 +3,7 @@ # .S.o: - $(CC) -D__ASSEMBLY__ -traditional -c $< -o $@ + $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $@ L_TARGET = lib.a L_OBJS = ashrdi3.o checksum.o memcpy.o memcmp.o memset.o semaphore.o diff -urN linux-2.3.24/arch/m68k/math-emu/Makefile linux-2.3.24-CC/arch/m68k/math-emu/Makefile --- linux-2.3.24/arch/m68k/math-emu/Makefile Sun Aug 15 13:47:29 1999 +++ linux-2.3.24-CC/arch/m68k/math-emu/Makefile Thu Oct 28 02:31:12 1999 @@ -8,7 +8,7 @@ # Note 2! The CFLAGS definitions are now in the main makefile... .S.o: - $(CC) $(EXTRA_CFLAGS) -D__ASSEMBLY__ -traditional -c $< -o $*.o + $(CC) $(EXTRA_CFLAGS) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $*.o #EXTRA_CFLAGS=-DFPU_EMU_DEBUG diff -urN linux-2.3.24/arch/m68k/sun3/Makefile linux-2.3.24-CC/arch/m68k/sun3/Makefile --- linux-2.3.24/arch/m68k/sun3/Makefile Sat Sep 4 15:06:41 1999 +++ linux-2.3.24-CC/arch/m68k/sun3/Makefile Thu Oct 28 02:31:12 1999 @@ -8,7 +8,7 @@ # Note 2! The CFLAGS definitions are now in the main makefile... .S.o: - $(CC) -D__ASSEMBLY__ -traditional -Wa,-m68020 -c $< -o $*.o + $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -Wa,-m68020 -c $< -o $*.o O_TARGET := sun3.o O_OBJS := config.o idprom.o mmu_emu.o sun3ints.o leds.o dvma.o sbus.o diff -urN linux-2.3.24/arch/m68k/sun3/prom/Makefile linux-2.3.24-CC/arch/m68k/sun3/prom/Makefile --- linux-2.3.24/arch/m68k/sun3/prom/Makefile Sat Sep 4 15:06:41 1999 +++ linux-2.3.24-CC/arch/m68k/sun3/prom/Makefile Thu Oct 28 02:31:12 1999 @@ -17,6 +17,6 @@ sync dep: - $(CPP) -M *.c > .depend + $(CPP) $(CPPFLAGS) -M *.c > .depend include $(TOPDIR)/Rules.make diff -urN linux-2.3.24/arch/mips/arc/Makefile linux-2.3.24-CC/arch/mips/arc/Makefile --- linux-2.3.24/arch/mips/arc/Makefile Fri Jun 25 19:40:12 1999 +++ linux-2.3.24-CC/arch/mips/arc/Makefile Thu Oct 28 02:31:12 1999 @@ -18,6 +18,6 @@ sync dep: - $(CPP) -M *.c > .depend + $(CPP) $(CPPFLAGS) -M *.c > .depend include $(TOPDIR)/Rules.make diff -urN linux-2.3.24/arch/mips/dec/prom/Makefile linux-2.3.24-CC/arch/mips/dec/prom/Makefile --- linux-2.3.24/arch/mips/dec/prom/Makefile Fri Jun 25 19:40:12 1999 +++ linux-2.3.24-CC/arch/mips/dec/prom/Makefile Thu Oct 28 02:31:12 1999 @@ -24,6 +24,6 @@ locore.o: locore.S dep: - $(CPP) -M *.c > .depend + $(CPP) $(CPPFLAGS) -M *.c > .depend include $(TOPDIR)/Rules.make diff -urN linux-2.3.24/arch/mips/sgi/kernel/Makefile linux-2.3.24-CC/arch/mips/sgi/kernel/Makefile --- linux-2.3.24/arch/mips/sgi/kernel/Makefile Fri Jun 25 19:40:13 1999 +++ linux-2.3.24-CC/arch/mips/sgi/kernel/Makefile Thu Oct 28 02:31:12 1999 @@ -28,6 +28,6 @@ indyIRQ.o: indyIRQ.S dep: - $(CPP) -M *.c > .depend + $(CPP) $(CPPFLAGS) -M *.c > .depend include $(TOPDIR)/Rules.make diff -urN linux-2.3.24/arch/ppc/Makefile linux-2.3.24-CC/arch/ppc/Makefile --- linux-2.3.24/arch/ppc/Makefile Tue Oct 12 12:00:58 1999 +++ linux-2.3.24-CC/arch/ppc/Makefile Thu Oct 28 02:31:12 1999 @@ -21,7 +21,8 @@ ASFLAGS = LINKFLAGS = -T arch/ppc/vmlinux.lds -Ttext $(KERNELLOAD) -Bstatic CFLAGSINC = -D__KERNEL__ -I$(TOPDIR)/include -D__powerpc__ -CFLAGS := $(CFLAGS) -I$(HPATH) -D__powerpc__ -fsigned-char -msoft-float \ +CPPFLAGS := $(CPPFLAGS) -D__powerpc__ +CFLAGS := $(CFLAGS) -fsigned-char -msoft-float \ -pipe -fno-builtin -ffixed-r2 -Wno-uninitialized -mmultiple \ -mstring CPP = $(CC) -E $(CFLAGS) diff -urN linux-2.3.24/arch/ppc/boot/Makefile linux-2.3.24-CC/arch/ppc/boot/Makefile --- linux-2.3.24/arch/ppc/boot/Makefile Tue Oct 12 12:00:58 1999 +++ linux-2.3.24-CC/arch/ppc/boot/Makefile Thu Oct 28 02:31:12 1999 @@ -16,9 +16,9 @@ .c.o: $(CC) $(CFLAGS) -DINITRD_OFFSET=$(IOFF) -DINITRD_SIZE=$(ISZ) -DZIMAGE_OFFSET=$(ZOFF) -DZIMAGE_SIZE=$(ZSZ) -c -o $*.o $< .S.s: - $(CC) -D__ASSEMBLY__ -traditional -E -o $*.o $< + $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -E -o $*.o $< .S.o: - $(CC) -D__ASSEMBLY__ -traditional -c -o $*.o $< + $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $< ZOFF = 0 ZSZ = 0 @@ -52,7 +52,7 @@ GZIP_FLAGS = -v9 OBJECTS := head.o misc.o ../coffboot/zlib.o -CFLAGS = -O2 -DSTDC_HEADERS -fno-builtin -I$(TOPDIR)/include +CFLAGS = $(CPPFLAGS) -O2 -DSTDC_HEADERS -fno-builtin OBJCOPY = $(CROSS_COMPILE)objcopy OBJCOPY_ARGS = -O elf32-powerpc @@ -140,7 +140,7 @@ $(TOPDIR)/scripts/mkdep *.[Sch] > .depend dep: - $(CPP) -M *.S *.c > .depend + $(CPP) $(CPPFLAGS) -M *.S *.c > .depend # just here to match coffboot/Makefile vmlinux.coff: diff -urN linux-2.3.24/arch/ppc/chrpboot/Makefile linux-2.3.24-CC/arch/ppc/chrpboot/Makefile --- linux-2.3.24/arch/ppc/chrpboot/Makefile Tue Aug 31 13:36:43 1999 +++ linux-2.3.24-CC/arch/ppc/chrpboot/Makefile Thu Oct 28 02:31:12 1999 @@ -12,11 +12,11 @@ .c.o: $(CC) $(CFLAGS) -DKERNELBASE=$(KERNELBASE) -c -o $*.o $< .S.s: - $(CC) -D__ASSEMBLY__ -traditional -E -o $*.o $< + $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -E -o $*.o $< .S.o: - $(CC) -D__ASSEMBLY__ -traditional -c -o $*.o $< + $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $< -CFLAGS = -O -fno-builtin -DSTDC_HEADERS -I$(TOPDIR)/include +CFLAGS = $(CPPFLAGS) -O -fno-builtin -DSTDC_HEADERS LD_ARGS = -Ttext 0x00400000 OBJCOPY = $(CROSS_COMPILE)objcopy @@ -102,5 +102,5 @@ $(TOPDIR)/scripts/mkdep *.[Sch] > .depend dep: - $(CPP) -M *.S *.c > .depend + $(CPP) $(CPPFLAGS) -M *.S *.c > .depend diff -urN linux-2.3.24/arch/ppc/coffboot/Makefile linux-2.3.24-CC/arch/ppc/coffboot/Makefile --- linux-2.3.24/arch/ppc/coffboot/Makefile Mon Jun 28 15:40:39 1999 +++ linux-2.3.24-CC/arch/ppc/coffboot/Makefile Thu Oct 28 02:31:12 1999 @@ -7,7 +7,7 @@ CC = $(CROSS_COMPILE)gcc LD = $(CROSS_COMPILE)ld -CFLAGS = -O -fno-builtin -I$(TOPDIR)/include +CFLAGS = $(CPPFLAGS) -O -fno-builtin OBJCOPY = $(CROSS_COMPILE)objcopy OBJCOPY_ARGS = -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment \ --add-section=image=vmlinux.gz diff -urN linux-2.3.24/arch/ppc/lib/Makefile linux-2.3.24-CC/arch/ppc/lib/Makefile --- linux-2.3.24/arch/ppc/lib/Makefile Wed Dec 23 09:34:11 1998 +++ linux-2.3.24-CC/arch/ppc/lib/Makefile Thu Oct 28 02:31:12 1999 @@ -3,7 +3,7 @@ # .S.o: - $(CC) -D__ASSEMBLY__ -c $< -o $*.o + $(CC) -D__ASSEMBLY__ $(AFLAGS) -c $< -o $*.o O_TARGET = lib.o O_OBJS = checksum.o string.o strcase.o diff -urN linux-2.3.24/arch/ppc/mbxboot/Makefile linux-2.3.24-CC/arch/ppc/mbxboot/Makefile --- linux-2.3.24/arch/ppc/mbxboot/Makefile Thu Oct 7 12:17:08 1999 +++ linux-2.3.24-CC/arch/ppc/mbxboot/Makefile Thu Oct 28 02:31:12 1999 @@ -16,9 +16,9 @@ .c.o: $(CC) $(CFLAGS) -DINITRD_OFFSET=$(IOFF) -DINITRD_SIZE=$(ISZ) -DZIMAGE_OFFSET=$(ZOFF) -DZIMAGE_SIZE=$(ZSZ) -c -o $*.o $< .S.s: - $(CC) -D__ASSEMBLY__ -traditional -E -o $*.o $< + $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -E -o $*.o $< .S.o: - $(CC) -D__ASSEMBLY__ -traditional -c -o $*.o $< + $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c -o $*.o $< ZOFF = 0 ZSZ = 0 @@ -30,7 +30,7 @@ GZIP_FLAGS = -v9 OBJECTS := head.o misc.o ../coffboot/zlib.o m8xx_tty.o -CFLAGS = -O2 -DSTDC_HEADERS -fno-builtin -I$(TOPDIR)/include -DCONFIG_8xx +CFLAGS = $(CPPFLAGS) -O2 -DSTDC_HEADERS -fno-builtin -DCONFIG_8xx OBJCOPY = $(CROSS_COMPILE)objcopy OBJCOPY_ARGS = -O elf32-powerpc @@ -109,7 +109,7 @@ $(TOPDIR)/scripts/mkdep *.[Sch] > .depend dep: - $(CPP) -M *.S *.c > .depend + $(CPP) $(CPPFLAGS) -M *.S *.c > .depend # just here to match coffboot/Makefile vmlinux.coff: diff -urN linux-2.3.24/arch/sparc/ap1000/Makefile linux-2.3.24-CC/arch/sparc/ap1000/Makefile --- linux-2.3.24/arch/sparc/ap1000/Makefile Sun Jan 26 04:07:06 1997 +++ linux-2.3.24-CC/arch/sparc/ap1000/Makefile Thu Oct 28 02:31:12 1999 @@ -6,9 +6,9 @@ # .S.s: - $(CPP) -D__ASSEMBLY__ -ansi $< -o $*.s + $(CPP) -D__ASSEMBLY__ $(AFLAGS) -ansi $< -o $*.s .S.o: - $(CC) -D__ASSEMBLY__ -ansi -c $< -o $*.o + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c $< -o $*.o all: ap1000lib.o diff -urN linux-2.3.24/arch/sparc/kernel/Makefile linux-2.3.24-CC/arch/sparc/kernel/Makefile --- linux-2.3.24/arch/sparc/kernel/Makefile Tue Aug 31 13:23:29 1999 +++ linux-2.3.24-CC/arch/sparc/kernel/Makefile Thu Oct 28 02:31:12 1999 @@ -55,11 +55,13 @@ @echo "#ifndef CONFIG_SMP" >> asm_offsets.h @echo "" >> asm_offsets.h @echo "#include <linux/config.h>" > tmp.c + @echo "#undef __SMP__" >> tmp.c @echo "#undef CONFIG_SMP" >> tmp.c @echo "#include <linux/sched.h>" >> tmp.c - $(CC) -E tmp.c -o tmp.i + $(CC) $(CPPFLAGS) -E tmp.c -o tmp.i @echo "/* Automatically generated. Do not edit. */" > check_asm.c @echo "#include <linux/config.h>" >> check_asm.c + @echo "#undef __SMP__" >> check_asm.c @echo "#undef CONFIG_SMP" >> check_asm.c @echo "#include <linux/sched.h>" >> check_asm.c @echo 'struct task_struct _task;' >> check_asm.c @@ -71,7 +73,7 @@ $(SH) ./check_asm.sh thread tmp.i check_asm.c @echo 'return 0; }' >> check_asm.c @rm -f tmp.[ci] - $(CC) -o check_asm check_asm.c + $(CC) $(CFLAGS) -o check_asm check_asm.c ./check_asm >> asm_offsets.h @rm -f check_asm check_asm.c @echo "" >> asm_offsets.h @@ -81,7 +83,7 @@ @echo "#undef CONFIG_SMP" >> tmp.c @echo "#define CONFIG_SMP 1" >> tmp.c @echo "#include <linux/sched.h>" >> tmp.c - $(CC) -D__SMP__ -E tmp.c -o tmp.i + $(CC) $(CPPFLAGS) -D__SMP__ -E tmp.c -o tmp.i @echo "/* Automatically generated. Do not edit. */" > check_asm.c @echo "#include <linux/config.h>" >> check_asm.c @echo "#undef CONFIG_SMP" >> check_asm.c @@ -96,7 +98,7 @@ $(SH) ./check_asm.sh thread tmp.i check_asm.c @echo 'return 0; }' >> check_asm.c @rm -f tmp.[ci] - $(CC) -D__SMP__ -o check_asm check_asm.c + $(CC) $(CFLAGS) -D__SMP__ -o check_asm check_asm.c ./check_asm >> asm_offsets.h @rm -f check_asm check_asm.c @echo "" >> asm_offsets.h diff -urN linux-2.3.24/arch/sparc/lib/Makefile linux-2.3.24-CC/arch/sparc/lib/Makefile --- linux-2.3.24/arch/sparc/lib/Makefile Sun Mar 21 09:23:38 1999 +++ linux-2.3.24-CC/arch/sparc/lib/Makefile Thu Oct 28 02:31:12 1999 @@ -16,34 +16,34 @@ sync checksum.o: checksum.S - $(CC) -D__ASSEMBLY__ -ansi -c -o checksum.o checksum.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o checksum.o checksum.S memcpy.o: memcpy.S - $(CC) -D__ASSEMBLY__ -ansi -c -o memcpy.o memcpy.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o memcpy.o memcpy.S memcmp.o: memcmp.S - $(CC) -D__ASSEMBLY__ -ansi -c -o memcmp.o memcmp.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o memcmp.o memcmp.S memscan.o: memscan.S - $(CC) -D__ASSEMBLY__ -ansi -c -o memscan.o memscan.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o memscan.o memscan.S strncmp.o: strncmp.S - $(CC) -D__ASSEMBLY__ -ansi -c -o strncmp.o strncmp.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o strncmp.o strncmp.S strncpy_from_user.o: strncpy_from_user.S - $(CC) -D__ASSEMBLY__ -ansi -c -o strncpy_from_user.o strncpy_from_user.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o strncpy_from_user.o strncpy_from_user.S strlen_user.o: strlen_user.S - $(CC) -D__ASSEMBLY__ -ansi -c -o strlen_user.o strlen_user.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o strlen_user.o strlen_user.S copy_user.o: copy_user.S - $(CC) -D__ASSEMBLY__ -ansi -c -o copy_user.o copy_user.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o copy_user.o copy_user.S blockops.o: blockops.S - $(CC) -D__ASSEMBLY__ -ansi -c -o blockops.o blockops.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o blockops.o blockops.S memset.o: memset.S - $(CC) -D__ASSEMBLY__ -ansi -c -o memset.o memset.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o memset.o memset.S locks.o: locks.S $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o locks.o locks.S @@ -60,37 +60,37 @@ endif strlen.o: strlen.S - $(CC) -D__ASSEMBLY__ -ansi -c -o strlen.o strlen.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o strlen.o strlen.S divdi3.o: divdi3.S - $(CC) -D__ASSEMBLY__ -ansi -c -o divdi3.o divdi3.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o divdi3.o divdi3.S udivdi3.o: udivdi3.S - $(CC) -D__ASSEMBLY__ -ansi -c -o udivdi3.o udivdi3.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o udivdi3.o udivdi3.S mul.o: mul.S - $(CC) -D__ASSEMBLY__ -c -o mul.o mul.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o mul.o mul.S rem.o: rem.S - $(CC) -D__ASSEMBLY__ -DST_DIV0=0x2 -c -o rem.o rem.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -DST_DIV0=0x2 -c -o rem.o rem.S sdiv.o: sdiv.S - $(CC) -D__ASSEMBLY__ -DST_DIV0=0x2 -c -o sdiv.o sdiv.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -DST_DIV0=0x2 -c -o sdiv.o sdiv.S udiv.o: udiv.S - $(CC) -D__ASSEMBLY__ -DST_DIV0=0x2 -c -o udiv.o udiv.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -DST_DIV0=0x2 -c -o udiv.o udiv.S umul.o: umul.S - $(CC) -D__ASSEMBLY__ -c -o umul.o umul.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o umul.o umul.S urem.o: urem.S - $(CC) -D__ASSEMBLY__ -DST_DIV0=0x2 -c -o urem.o urem.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -DST_DIV0=0x2 -c -o urem.o urem.S ashrdi3.o: ashrdi3.S - $(CC) -D__ASSEMBLY__ -c -o ashrdi3.o ashrdi3.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o ashrdi3.o ashrdi3.S lshrdi3.o: lshrdi3.S - $(CC) -D__ASSEMBLY__ -c -o lshrdi3.o lshrdi3.S + $(CC) -D__ASSEMBLY__ $(AFLAGS) -c -o lshrdi3.o lshrdi3.S dep: diff -urN linux-2.3.24/arch/sparc/math-emu/Makefile linux-2.3.24-CC/arch/sparc/math-emu/Makefile --- linux-2.3.24/arch/sparc/math-emu/Makefile Tue Aug 31 13:23:30 1999 +++ linux-2.3.24-CC/arch/sparc/math-emu/Makefile Thu Oct 28 02:31:12 1999 @@ -11,10 +11,10 @@ O_OBJS := math.o ashldi3.o .S.s: - $(CPP) -D__ASSEMBLY__ -ansi $< -o $*.s + $(CPP) -D__ASSEMBLY__ $(AFLAGS) -ansi $< -o $*.s .S.o: - $(CC) -D__ASSEMBLY__ -ansi -c $< -o $*.o + $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c $< -o $*.o CFLAGS += -I. -I$(TOPDIR)/include/math-emu -w diff -urN linux-2.3.24/arch/sparc/prom/Makefile linux-2.3.24-CC/arch/sparc/prom/Makefile --- linux-2.3.24/arch/sparc/prom/Makefile Tue Apr 14 19:44:20 1998 +++ linux-2.3.24-CC/arch/sparc/prom/Makefile Thu Oct 28 02:31:12 1999 @@ -22,6 +22,6 @@ sync dep: - $(CPP) -M *.c > .depend + $(CPP) $(CPPFLAGS) -M *.c > .depend include $(TOPDIR)/Rules.make diff -urN linux-2.3.24/arch/sparc64/Makefile linux-2.3.24-CC/arch/sparc64/Makefile --- linux-2.3.24/arch/sparc64/Makefile Tue Aug 31 13:23:30 1999 +++ linux-2.3.24-CC/arch/sparc64/Makefile Thu Oct 28 02:31:12 1999 @@ -12,16 +12,10 @@ # line... SHELL =/bin/bash -CC := sparc64-linux-gcc -D__KERNEL__ -I$(TOPDIR)/include +CC := sparc64-linux-gcc -CC_HAS_ARGS := $(shell if echo "$(CC)" | grep '\(__KERNEL__\| \)' > /dev/null; then echo y; else echo n; fi) IS_EGCS := $(shell if $(CC) -m64 -mcmodel=medlow -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo y; else echo n; fi; ) NEW_GAS := $(shell if $(LD) --version 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi) - -ifneq ($(CC_HAS_ARGS),y) -MAKEOVERRIDES := $(shell echo "$(MAKEOVERRIDES)" | sed 's CC=$(CC) CC=$(CC)\\\ -D__KERNEL__\\\ -I$(TOPDIR)/include ') -override CC := $(CC) -D__KERNEL__ -I$(TOPDIR)/include -endif ifneq ($(NEW_GAS),y) AS = sparc64-linux-as diff -urN linux-2.3.24/arch/sparc64/kernel/Makefile linux-2.3.24-CC/arch/sparc64/kernel/Makefile --- linux-2.3.24/arch/sparc64/kernel/Makefile Tue Aug 31 13:23:30 1999 +++ linux-2.3.24-CC/arch/sparc64/kernel/Makefile Thu Oct 28 02:31:12 1999 @@ -74,11 +74,13 @@ @echo -e "# error Please issue 'make check_asm' in linux top-level directory first\n# endif\n#endif\n" >> asm_offsets.h @echo -e "#ifndef CONFIG_SMP\n" >> asm_offsets.h @echo "#include <linux/config.h>" > tmp.c + @echo "#undef __SMP__" >> tmp.c @echo "#undef CONFIG_SMP" >> tmp.c @echo "#include <linux/sched.h>" >> tmp.c - $(CC) -E tmp.c -o tmp.i + $(CC) $(CPPFLAGS) -E tmp.c -o tmp.i @echo "/* Automatically generated. Do not edit. */" > check_asm.c @echo "#include <linux/config.h>" >> check_asm.c + @echo "#undef __SMP__" >> check_asm.c @echo "#undef CONFIG_SMP" >> check_asm.c @echo "#include <linux/sched.h>" >> check_asm.c @echo 'struct task_struct _task;' >> check_asm.c @@ -92,7 +94,7 @@ @rm -f tmp.[ci] #$(CC) -o check_asm check_asm.c # <hack> Until we can do this natively, a hack has to take place - $(CC) $(CMODEL_CFLAG) -ffixed-g4 -S -o check_asm.s check_asm.c + $(CC) $(CPPFLAGS) $(CMODEL_CFLAG) -ffixed-g4 -S -o check_asm.s check_asm.c $(HOSTCC) -Wa,-Av9a -o check_asm check_asm.s @rm -f check_asm.s # </hack> @@ -104,7 +106,7 @@ @echo "#undef CONFIG_SMP" >> tmp.c @echo "#define CONFIG_SMP 1" >> tmp.c @echo "#include <linux/sched.h>" >> tmp.c - $(CC) -D__SMP__ -E tmp.c -o tmp.i + $(CC) $(CPPFLAGS) -D__SMP__ -E tmp.c -o tmp.i @echo "/* Automatically generated. Do not edit. */" > check_asm.c @echo "#include <linux/config.h>" >> check_asm.c @echo "#undef CONFIG_SMP" >> check_asm.c @@ -121,7 +123,7 @@ @rm -f tmp.[ci] #$(CC) -D__SMP__ -o check_asm check_asm.c # <hack> Until we can do this natively, a hack has to take place - $(CC) -D__SMP__ $(CMODEL_CFLAG) -ffixed-g4 -S -o check_asm.s check_asm.c + $(CC) $(CPPFLAGS) -D__SMP__ $(CMODEL_CFLAG) -ffixed-g4 -S -o check_asm.s check_asm.c $(HOSTCC) -Wa,-Av9a -o check_asm check_asm.s @rm -f check_asm.s # </hack> @@ -129,7 +131,7 @@ @rm -f check_asm check_asm.c @echo -e "\n#else /* SPIN_LOCK_DEBUG */\n" >> asm_offsets.h @echo "#include <linux/sched.h>" > tmp.c - $(CC) -D__SMP__ -DSPIN_LOCK_DEBUG -E tmp.c -o tmp.i + $(CC) $(CPPFLAGS) -D__SMP__ -DSPIN_LOCK_DEBUG -E tmp.c -o tmp.i @echo "/* Automatically generated. Do not edit. */" > check_asm.c @echo "#include <linux/config.h>" >> check_asm.c @echo "#undef CONFIG_SMP" >> check_asm.c @@ -146,7 +148,7 @@ @rm -f tmp.[ci] #$(CC) -D__SMP__ -DSPIN_LOCK_DEBUG -o check_asm check_asm.c # <hack> Until we can do this natively, a hack has to take place - $(CC) -D__SMP__ -DSPIN_LOCK_DEBUG $(CMODEL_CFLAG) -ffixed-g4 -S -o check_asm.s check_asm.c + $(CC) $(CPPFLAGS) -D__SMP__ -DSPIN_LOCK_DEBUG $(CMODEL_CFLAG) -ffixed-g4 -S -o check_asm.s check_asm.c $(HOSTCC) -Wa,-Av9a -o check_asm check_asm.s @rm -f check_asm.s # </hack> diff -urN linux-2.3.24/arch/sparc64/prom/Makefile linux-2.3.24-CC/arch/sparc64/prom/Makefile --- linux-2.3.24/arch/sparc64/prom/Makefile Mon Mar 17 16:54:23 1997 +++ linux-2.3.24-CC/arch/sparc64/prom/Makefile Thu Oct 28 02:31:12 1999 @@ -18,6 +18,6 @@ sync dep: - $(CPP) -M *.c > .depend + $(CPP) $(CPPFLAGS) -M *.c > .depend include $(TOPDIR)/Rules.make diff -urN linux-2.3.24/drivers/scsi/Makefile linux-2.3.24-CC/drivers/scsi/Makefile --- linux-2.3.24/drivers/scsi/Makefile Thu Oct 7 12:17:09 1999 +++ linux-2.3.24-CC/drivers/scsi/Makefile Thu Oct 28 02:31:12 1999 @@ -671,7 +671,7 @@ 53c8xx_d.h: 53c7,8xx.scr script_asm.pl ln -sf 53c7,8xx.scr fake8.c - $(CPP) -traditional -DCHIP=810 fake8.c | grep -v '^#' | perl script_asm.pl + $(CPP) $(CPPFLAGS) -traditional -DCHIP=810 fake8.c | grep -v '^#' | perl script_asm.pl mv script.h 53c8xx_d.h mv scriptu.h 53c8xx_u.h rm fake8.c @@ -680,7 +680,7 @@ 53c7xx_d.h: 53c7xx.scr script_asm.pl ln -sf 53c7xx.scr fake7.c - $(CPP) -traditional -DCHIP=710 fake7.c | grep -v '^#' | perl -s script_asm.pl -ncr7x0_family + $(CPP) $(CPPFLAGS) -traditional -DCHIP=710 fake7.c | grep -v '^#' | perl -s script_asm.pl -ncr7x0_family mv script.h 53c7xx_d.h mv scriptu.h 53c7xx_u.h rm fake7.c @@ -691,7 +691,7 @@ sim710_d.h: sim710.scr script_asm.pl ln -sf sim710.scr fake7.c - $(CPP) -traditional -DCHIP=710 fake7.c | grep -v '^#' | perl -s script_asm.pl -ncr7x0_family + $(CPP) $(CPPFLAGS) -traditional -DCHIP=710 fake7.c | grep -v '^#' | perl -s script_asm.pl -ncr7x0_family mv script.h sim710_d.h mv scriptu.h sim710_u.h rm fake7.c diff -urN linux-2.3.24/kernel/Makefile linux-2.3.24-CC/kernel/Makefile --- linux-2.3.24/kernel/Makefile Sun Jul 4 15:41:08 1999 +++ linux-2.3.24-CC/kernel/Makefile Thu Oct 28 02:31:12 1999 @@ -8,7 +8,7 @@ # Note 2! The CFLAGS definitions are now in the main makefile... .S.s: - $(CPP) -traditional $< -o $*.s + $(CPP) $(CPPFLAGS) -traditional $< -o $*.s O_TARGET := kernel.o O_OBJS = sched.o dma.o fork.o exec_domain.o panic.o printk.o sys.o \ diff -urN linux-2.3.24/scripts/lxdialog/Makefile linux-2.3.24-CC/scripts/lxdialog/Makefile --- linux-2.3.24/scripts/lxdialog/Makefile Sat Oct 2 09:49:30 1999 +++ linux-2.3.24-CC/scripts/lxdialog/Makefile Thu Oct 28 02:31:12 1999 @@ -1,6 +1,7 @@ CC = $(HOSTCC) CPP = $(HOSTCC) -E +CPPFLAGS = CFLAGS = $(HOSTCFLAGS) -DLOCALE LDFLAGS = -s -L . LDLIBS = -lncurses

--/cQ4xfuGJl--

- 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/