This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MCU-PLUS-SDK-AM243X: MCU-PLUS-SDK-AM243X

Part Number: MCU-PLUS-SDK-AM243X

Is there a solution to compiling a series of C files without the main function into executable files using the compilation chain of ti arm clang?

As shown in the following figure, an error will now be reported with no main function definition. 

error with no main function definition

The makefile is as follows:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
SRC = $(wildcard ../*.c ../interface/*.c)
LIB = $(wildcard ../lib/*.a)
OBJ = $(notdir $(patsubst %.c, %.o, $(SRC)))
CC = tiarmclang
LD = tiarmclang
OBJDUMP = tiarmobjdump
OBJCOPY = tiarmobjcopy
ALL:task.hex
$(OBJ): $(SRC)
@echo $(SRC)
@echo $(OBJ)
$(CC) -c $(SRC) -mthumb -mcpu=cortex-r5 -mlittle-endian -mfloat-abi=hard -mfpu=vfpv3-d16 -specs=nosys.specs
task.out:$(OBJ)
$(LD) $(OBJ) $(LIB) -o task.out -l../interface/lnkme.cmd -nostartfiles
task.hex:task.out
$(OBJDUMP) -D -S task.out >> taskdump.txt
$(OBJCOPY) -O binary task.out task.hex
clean:
del $(OBJ) task.out task.hex task.out taskdump.txt
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX