Linux-2.2 defines CC to be 'gcc -D__KERNEL__ -I$(HPATH)'. Hack a
authorDavid Schleef <ds@schleef.org>
Sat, 15 Dec 2001 02:23:30 +0000 (02:23 +0000)
committerDavid Schleef <ds@schleef.org>
Sat, 15 Dec 2001 02:23:30 +0000 (02:23 +0000)
workaround.

scripts/linux_flags/Makefile

index 9f02710d8c83afa6051ac5bead666e369a57cb33..c535794a8802219c0bb636263c1111a3ae9bfa02 100644 (file)
@@ -13,7 +13,13 @@ modules:
        echo ARFLAGS="$(ARFLAGS)" >>flags
        echo CROSS_COMPILE="$(CROSS_COMPILE)" >>flags
        echo KERNELRELEASE="$(KERNELRELEASE)" >>flags
+# This is evil Makefile hackery.  Please look the other way.
+ifneq (,$(findstring __KERNEL__,$(CC)))
+       echo CFLAGS="$(wordlist 2,100,$(CC)) $(CFLAGS)" >>flags
+       echo CC=$(word 1,$(CC)) >>flags
+else
        echo CC="$(CC)" >>flags
+endif
        echo LD="$(LD)" >>flags
        echo AS="$(AS)" >>flags