2 Star 5 Fork 1

Ryan-CW/RyanMqtt

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 858 Bytes
一键复制 编辑 原始数据 按行查看 历史
Ryan-CW 提交于 2024-12-24 20:30 +08:00 . test: 测试程序消除警告
# 设置编译器
CC = gcc
# 设置包含路径
CFLAGS += -I common \
-I pahoMqtt \
-I mqttclient \
-I platform/linux \
-I platform/linux/valloc
# 设置编译选项
CFLAGS += -Wall -Wno-unused-parameter -Wformat=2
# 搜索所有C源文件
SRCS = $(wildcard ./test/*.c)
SRCS += $(wildcard ./common/*.c)
SRCS += $(wildcard ./platform/linux/*.c)
SRCS += $(wildcard ./platform/linux/valloc/*.c)
SRCS += $(wildcard ./pahoMqtt/*.c)
SRCS += $(wildcard ./mqttclient/*.c)
# 定义目标文件和输出文件
OBJS = $(patsubst %.c,%.o,$(SRCS))
TARGET = app.o
# 默认目标
all: $(TARGET)
# 链接所有对象文件生成最终二进制文件
$(TARGET): $(OBJS)
$(CC) $(OBJS) -o $@ -lm -lpthread
# 编译规则
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# 清理生成的文件
.PHONY: clean
clean:
rm -f $(OBJS) $(TARGET)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/taamo/RyanMqtt.git
git@gitee.com:taamo/RyanMqtt.git
taamo
RyanMqtt
RyanMqtt
main

搜索帮助