diff --git a/drivers/Makefile b/drivers/Makefile index a4a3c826de4..33d9c096af5 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -35,8 +35,6 @@ -include $(TOPDIR)/Make.defs -COMPILER = ${shell basename $(CC)} - ifeq ($(CONFIG_NET),y) include net/Make.defs ROOTDEPPATH = --dep-path . @@ -47,13 +45,13 @@ ifeq ($(CONFIG_USBDEV),y) include usbdev/Make.defs ROOTDEPPATH = --dep-path . USBDEVDEPPATH = --dep-path usbdev -CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh "$CC" $(TOPDIR)/drivers/usbdev} +CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh "$(CC)" $(TOPDIR)/drivers/usbdev} endif include mmcsd/Make.defs ROOTDEPPATH = --dep-path . MMCSDDEPPATH = --dep-path mmcsd -CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh "$CC" $(TOPDIR)/drivers/mmcsd} +CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh "$(CC)" $(TOPDIR)/drivers/mmcsd} ASRCS = $(NET_ASRCS) $(USBDEV_ASRCS) $(MMCSD_ASRCS) AOBJS = $(ASRCS:.S=$(OBJEXT)) diff --git a/tools/incdir.sh b/tools/incdir.sh index c23103d23f8..71c87c10e7b 100755 --- a/tools/incdir.sh +++ b/tools/incdir.sh @@ -36,13 +36,13 @@ # $1 : Compiler name as it appears in config/*/*/Make.defs # $2, $3, ...: Include file paths -compiler=$1 +ccpath=$1 shift dirlist=$@ usage="USAGE: $0 [ [ ...]]" -if [ -z "$compiler" ]; then +if [ -z "$ccpath" ]; then echo "Missing compiler path" echo $usage exit 1 @@ -74,13 +74,20 @@ fi # toolchains, we have to use the full windows-style paths to the header # files. -fmt=std -windows=no +os=`uname -o` +if [ "X$os" = "XCygwin" ]; then + windows=yes + compiler=`cygpath -u "$ccpath"` +else + windows=no + compiler="$ccpath" +fi +exefile=`basename "$compiler"` -exefile=`basename $compiler` if [ "X$exefile" = "Xez8cc.exe" -o "X$exefile" = "Xzneocc.exe" -o "X$exefile" = "XeZ80cc.exe" ]; then fmt=userinc - windows=yes +else + fmt=std fi # Now process each directory in the directory list