37 lines
486 B
Makefile
37 lines
486 B
Makefile
|
# Makefile for the mutex example project
|
||
|
|
||
|
# 指定编译器
|
||
|
CC = gcc
|
||
|
# 指定编译选项
|
||
|
CFLAGS = -Wall -Wextra -std=c11
|
||
|
|
||
|
# 源文件
|
||
|
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 $@ $^
|
||
|
|
||
|
# 编译源文件
|
||
|
%.o: %.c
|
||
|
$(CC) $(CFLAGS) -c $< -o $@
|
||
|
|
||
|
# 清理目标
|
||
|
clean:
|
||
|
rm -f $(OBJS) $(TARGET)
|
||
|
|
||
|
# 伪目标
|
||
|
.PHONY: all clean
|