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