1

I feel like this may be a simple one, I have been stuck on it all day though. I am using Cygwin, and WinAVR to compile some files in the arduino library. I want to use a makefile, but I am having problems with spaces in file names (at least i think that is it). I made a link to bypass that, but that is not working either! There are a few SO questions already about spaces in file names but none of them helped me.

My makefile:

#ARDUINO_PATH=/cygdrive/c/Program\ Files\ \(x86\)/Arduino/hardware/arduino/avr/cores/arduino
ARDUINO_PATH=./link_to_arduino_dir
SRC=$(wildcard $(ARDUINO_PATH)/*.c)


all: echo $(SRC)

$(SRC):
    avr-gcc -Os -DF_CPU=16000000UL -mmcu=atmega328p -I $(ARDUINO_PATH) -c -o . $@

echo:
    echo $(SRC)

After the wildcard, $SRC is empty. running this makefile will just have an empty "echo" then return.

Edit:

The link was created with

ln -s /cygdrive/c/Program\ Files\ \(x86\)/Arduino/hardware/arduino/avr/cores/arduino link_to_arduino_dir

Simple commands like 'ls' work with it, which is why I am so confused

riverrun
  • 179
  • 1
  • 9
  • Possible duplicate of [Can GNU make handle filenames with spaces?](http://stackoverflow.com/questions/9838384/can-gnu-make-handle-filenames-with-spaces) – Eugene Sh. Jun 23 '16 at 19:11
  • The other question does not answer why the wildcard did not work with the symlink i created – riverrun Jun 23 '16 at 19:28

1 Answers1

2

How about the old Windows trick of using DOS names (8.3)?

Instead of /c/Program\ Files\ \(x86\)/ use /c/Progra~2/.

Note: On a 64-bit Windows Progra~1 will point to "Program Files" and Progra~2 will point to "Program Files (x86)". If you're running on a 32-bit system, just use Progra~1.

Traveling Tech Guy
  • 27,194
  • 23
  • 111
  • 159
  • Huh thats a neat trick! It works for me in cygwin ("ls /cygdrive/c/Progra~2/Arduino/hardware/arduino/avr/cores/arduino/*.c" gets the correct list of files), but also does not work with wildcard :( – riverrun Jun 23 '16 at 19:37