Updated Makefile.rules, kernel compiler flags extraction and build script.
[lincan.git] / omk / rules / linux / kernelcfg2mk
index c18a497..8459118 100755 (executable)
@@ -151,9 +151,9 @@ flags:
        @echo LINUX_CROSS_COMPILE="\$(CROSS_COMPILE)" >>\$(obj)/flags
        @echo LINUX_KERNELRELEASE="\$(KERNELRELEASE)" >>\$(obj)/flags
 ifdef KBUILD_CFLAGS
-       @echo LINUX_CPPFLAGS="\$(KBUILD_CPPFLAGS)" | sed 's#Iinclude#I"\$(LINUXDIR)/include"#g'>>\$(obj)/flags
-       @echo LINUX_AFLAGS="\$(KBUILD_AFLAGS)" | sed 's#Iinclude#I"\$(OMK_LINUX_SRC)/include"#g'>>\$(obj)/flags
-       @echo LINUX_CFLAGS="\$(KBUILD_CFLAGS)" | sed 's#Iinclude#I"\$(OMK_LINUX_SRC)/include"#g'>>\$(obj)/flags
+       @echo LINUX_CPPFLAGS="\$(KBUILD_CPPFLAGS)" | sed 's#-I\(include\|arch\)#-I"\$(LINUXDIR)/\1"#g'>>\$(obj)/flags
+       @echo LINUX_AFLAGS="\$(KBUILD_AFLAGS)" | sed 's#-I\(include\|arch\)#-I"\$(OMK_LINUX_SRC)/\1"#g'>>\$(obj)/flags
+       @echo LINUX_CFLAGS="\$(KBUILD_CFLAGS)" | sed 's#-I\(include\|arch\)#-I"\$(OMK_LINUX_SRC)/\1"#g'>>\$(obj)/flags
 else
        @echo LINUX_CPPFLAGS="\$(CPPFLAGS)" | sed 's#Iinclude#I"\$(LINUXDIR)/include"#g'>>\$(obj)/flags
        @echo LINUX_AFLAGS="\$(AFLAGS)" | sed 's#Iinclude#I"\$(OMK_LINUX_SRC)/include"#g'>>\$(obj)/flags