makefile windows or wsl, parentheses in path

phb

Member
Getting to know audio library, and timing - attempting to update audiostream.h

Code:
#ifndef AUDIO_BLOCK_SAMPLES
/*#define AUDIO_BLOCK_SAMPLES  128*/
#define AUDIO_BLOCK_SAMPLES  32

#endif

Using wsl, install libraries
Code:
 sudo apt-get install make git gcc-avr binutils-avr gdb-avr avr-libc avrdude

Then attempt make
Code:
:/mnt/c/Program Files (x86)/Arduino/hardware/teensy/avr/cores/teensy4$ make
/mnt/c/Program Files (x86)/Arduino/hardware/tools/arm/bin/arm-none-eabi-gcc  -Wall -g -O2 -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -mthumb -MMD -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -DUSING_MAKEFILE -D__IMXRT1062__ -DARDUINO=10813 -DTEENSYDUINO=154 -DARDUINO_TEENSY40 -I. -ffunction-sections -fdata-sections  -c -o sm_alloc_valid.o sm_alloc_valid.c
/bin/sh: 1: Syntax error: "(" unexpected
make: *** [<builtin>: sm_alloc_valid.o] Error 2

I believe that the error is related to the (x86) in the path name.
Any suggestions on how to compile the teensy arduino libraries on windows ?

Thank you.
 
I think the problem is caused by the spaces in the pathname. The name /mnt/c/Program Files (x86)/Arduino/hardware/tools/arm/bin/arm-none-eabi-gcc will be parsed as three strings.
Try putting quotes around any path that contains Program Files (x86)
Code:
make "/mnt/c/Program Files (x86)/Arduino/hardware/tools/arm/bin/arm-none-eabi-gcc"  -Wall -g -O2 -mcpu=cortex-m7 -mf

Pete
 
Yes - thanks - it required some explicit makefile definitions - in the end it compiled on windows, not wsl.

Code:
# Those that specify a NO_ARDUINO environment variable will
# be able to use this Makefile with no Arduino dependency.
# Please note that if ARDUINOPATH was set, it will override
# the NO_ARDUINO behaviour.
ifndef NO_ARDUINO
# Path to your arduino installation
ARDUINOPATH ?= "../../../../.."
endif

ifdef ARDUINOPATH

# path location for Teensy Loader, teensy_post_compile and teensy_reboot (on Linux)
#TOOLSPATH = $(abspath $(ARDUINOPATH)/hardware/tools)
#TOOLSPATH = "/mnt/c/Program Files (x86)/Arduino/hardware/tools"
TOOLSPATH = "C:\Program Files (x86)\Arduino\hardware\tools"
# path location for Arduino libraries (currently not used)
#LIBRARYPATH = $(abspath $(ARDUINOPATH)/libraries)
#LIBRARYPATH = "/mnt/c/Program Files (x86)/Arduino/libraries"
LIBRARYPATH = "C:\Program Files (x86)\Arduino\libraries"

# path location for the arm-none-eabi compiler
#OMPILERPATH = $(abspath $(ARDUINOPATH)/hardware/tools/arm/bin)
#COMPILERPATH = "/mnt/c/Program Files (x86)/hardware/tools/arm/bin"
COMPILERPATH = "C:\Program Files (x86)\Arduino\hardware\tools\arm\bin"


else
# Default to the normal GNU/Linux compiler path if NO_ARDUINO
# and ARDUINOPATH was not set.
COMPILERPATH ?= /usr/bin

endif
 
Should mention that for Arduino IDE 2.0, the paths are

Code:
ifdef ARDUINOPATH

# path location for Teensy Loader, teensy_post_compile and teensy_reboot (on Linux)
#TOOLSPATH = $(abspath $(ARDUINOPATH)/hardware/tools)
TOOLSPATH = C:\Users\pbede\AppData\Local\Arduino15\packages\teensy\tools\teensy-tools\1.58.0-beta2
# path location for Arduino libraries (currently not used)
#LIBRARYPATH = $(abspath $(ARDUINOPATH)/libraries)
LIBRARYPATH =C:\Users\pbede\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.58.0-beta2\libraries
# path location for the arm-none-eabi compiler
#COMPILERPATH = $(abspath $(ARDUINOPATH)/hardware/tools/arm/bin)
COMPILERPATH = C:\Users\pbede\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1-beta1\arm\bin
else
# Default to the normal GNU/Linux compiler path if NO_ARDUINO
# and ARDUINOPATH was not set.
COMPILERPATH ?= /usr/bin

endif
 
Back
Top