本篇文章基于mingw32-make.exe来执行编译Cortex-Arm4内核的工程来编写和测试的,环境Windows10
GCC是什么
参数项 | 功能 | notes |
---|---|---|
-ffunction-sections | 优化 | |
-fdata-sections | 优化 | |
-Wl | 优化 | |
–gc-sections | 优化 | |
-Wall |
CFLAGS += -ffunction-sections -fdata-sections
LDFLAGS += -Wl,--gc-sections
all:main.exe
main.exe:main.c
gcc $(CFLAGS) -c main.c
gcc $(LDFLAGS) -o $@ main.o
clean:
del main.exe main.o