Build the Image first and the Buildroot toolchain will be generate at
/Buildroot/output/host/usr/bin/aarch64-nuvoton-linux-gnu-gcc
Refer to UM_MA35D1_Yocto for generating toolchain
After you source the toolchain, it will automatically include to the PATH.
This Makefile for uart_demo shows you how to set up the toolchain.
If you have source the Yocto toolchain, just remove the CC and STRIP, then compile.
Code: Select all
.SUFFIXES : .x .o .c .s
CC := ~/buildroot/MA35D1_Buildroot/output/host/usr/bin/aarch64-nuvoton-linux-gnu-gcc
STRIP := ~/buildroot/MA35D1_Buildroot/output/host/usr/bin/aarch64-nuvoton-linux-gnu-strip
TARGET = uart_demo
SRCS := uart.c
LIBS = -lpthread -lc -lgcc
all:
$(CC) $(SRCS) -o $(TARGET) $(LIBS)
$(STRIP) $(TARGET)
clean:
rm -f *.o
rm -f *.x
rm -f *.flat
rm -f *.map
rm -f temp
rm -f *.img
rm -f $(TARGET)
rm -f *.gdb