xcode makefile cannot find avr-gcc in Macos Ventura

35 views Asked by At

I am using xcode for embedded programming with avr-gcc and the makefile of Eric B. Weddington, Joerg Wunsch, et al. for many years. Now in macos 13 with the same code (TWI_Slave), that does not work as before. The compiler executes the Makefile line:

avr-gcc -c -mmcu=atmega8 -I. -gstabs -DF_CPU=4000000UL   -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=TWI_Slave.lst  -std=gnu99 -MD -MP -MF .dep/TWI_Slave.o.d TWI_Slave.c -o TWI_Slave.o 

and returns error:

 sh: avr-gcc: command not found
 *** [TWI_Slave.o] Error 127

Shell is zsc.

I installed gcc with homebrew.

which gcc

gives

/opt/homebrew/bin/gcc-13.



gcc -v

gives Apple clang version 15.0.0

gcc-13 -v

gives

Using built-in specs.
COLLECT_GCC=gcc-13
COLLECT_LTO_WRAPPER=/opt/homebrew/Cellar/gcc/13.2.0/bin/../libexec/gcc/aarch64-        apple-darwin22/13/lto-wrapper
Target: aarch64-apple-darwin22
Configured with: ../configure --prefix=/opt/homebrew/opt/gcc --libdir=/opt/homebrew/opt/gcc/lib/gcc/current --disable-nls --enable-checking=release --with-gcc-major-version-only --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-13 --with-gmp=/opt/homebrew/opt/gmp --with-mpfr=/opt/homebrew/opt/mpfr --with-mpc=/opt/homebrew/opt/libmpc --with-isl=/opt/homebrew/opt/isl --with-zstd=/opt/homebrew/opt/zstd --with-pkgversion='Homebrew GCC 13.2.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --with-system-zlib --build=aarch64-apple-darwin22 --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.0 (Homebrew GCC 13.2.0) 

Is that a PATH problem for the compiler not finding avr-gcc? The defines in the makefile are

# Define programs and commands.
SHELL = sh
CC = avr-gcc
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
SIZE = avr-size
NM = avr-nm
AVRDUDE = avrdude
REMOVE = rm -f
COPY = cp
WINSHELL = cmd

How can I tell the compiler to use avr-gcc-13?

0

There are 0 answers