From: David Schleef Date: Sat, 15 Dec 2001 02:23:30 +0000 (+0000) Subject: Linux-2.2 defines CC to be 'gcc -D__KERNEL__ -I$(HPATH)'. Hack a X-Git-Tag: r0_7_62~42 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=20aeac4c9cfd08d50f04bbe6ef3fc2206b42f351;p=comedi.git Linux-2.2 defines CC to be 'gcc -D__KERNEL__ -I$(HPATH)'. Hack a workaround. --- diff --git a/scripts/linux_flags/Makefile b/scripts/linux_flags/Makefile index 9f02710d..c535794a 100644 --- a/scripts/linux_flags/Makefile +++ b/scripts/linux_flags/Makefile @@ -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