This repository has been archived on 2025-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
controller-hd/Tests/Makefile

62 lines
1.3 KiB
Makefile
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

BIN = run.exe
SO = lib.dll
SRC = \
../User/lib/src/malloc.c \
../User/lib/src/sqqueue.c \
../User/lib/src/mlist.c \
../User/lib/src/debug.c \
../User/lib/src/data_analysis.c \
../User/lib/src/filter.c \
../User/lib/src/clist.c \
../User/lib/src/aes.c \
../User/lib/src/cmac.c \
../User/lib/src/lib.c
EXAMPLE = \
./test_hart.c
CPLUS_INCLUDE_PATH= -I ../User/lib/inc -I ../User/lib/uthash
# 变量CC给定编译器名gcc
# 变量CFLAGS传给编译器的某些编译参数看需求添加
CC = gcc
CFLAGS = -m32 -std=c99
# 变量GDB给定debugger名gdb
# 变量RM给定删除文件方式用于后面删除所有编译所得的.o文件,linux下使用rm -rf
GDB = gdb
RM = rm -rf
# 变量OBJS将变量SRC中所有的.c文件替换成以.o结尾即将.c源文件编译成.o文件
OBJS = $(SRC:%.c=%.o)
EXAPMLES = $(EXAMPLE:%.c=%.o)
$(SO): $(OBJS) $(EXAPMLES)
# pull in dependencies for .o files
-include $(OBJS:.o=.d)
%.o: %.c
$(CC) $(CPLUS_INCLUDE_PATH) $(CFLAGS) -c $< -o $@
.PHONY: all clean clist data_analysis
all: $(SO)
rm:
$(RM) $(OBJS)
hart:$(SO)
$(CC) $(CPLUS_INCLUDE_PATH) $(CFLAGS) $(OBJS) ./test_hart.o -o $(BIN)
$(RM) $(OBJS) $(EXAPMLES)
run
#运行程序
run:
./run.exe
clean:
$(RM) $(OBJS) $(EXAPMLES) $(BIN)