erpc/makefile

37 lines
547 B
Makefile
Raw Normal View History

2024-11-20 15:03:26 +00:00
# Makefile for the mutex example project
# 指定编译器
CC = gcc
# 指定编译选项
CFLAGS = -Wall -Wextra -std=c11 -g
BUILD_DIR = build
2024-11-20 15:03:26 +00:00
# 源文件
SRCS = erpc_core.c \
port_self.c \
crc16.c\
list.c
# 目标文件
OBJS = $(SRCS:.c=.o)
# 可执行文件
2024-11-20 16:12:48 +00:00
Target = port_self.exe
2024-11-20 15:03:26 +00:00
# 默认目标
2024-11-20 16:12:48 +00:00
all: $(Target)
2024-11-20 15:03:26 +00:00
# 链接目标
2024-11-20 16:12:48 +00:00
$(Target): $(OBJS)
$(CC) -o $@ $(addprefix $(BUILD_DIR)/, $^)
2024-11-20 15:03:26 +00:00
# 编译源文件
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $(BUILD_DIR)/$@
2024-11-20 15:03:26 +00:00
# 清理目标
clean:
rm -f $(OBJS) $(TARGET)
# 伪目标
.PHONY: all clean