1 Star 0 Fork 1

snowingbear/MQTT-C

forked from R-Hang/MQTT-C 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
makefile 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
kimim 提交于 2021-11-09 08:54 +08:00 . reserve trailing speces
UNAME = $(shell uname -o)
CC = gcc
CFLAGS = -Wextra -Wall -std=gnu99 -Iinclude -Wno-unused-parameter -Wno-unused-variable -Wno-duplicate-decl-specifier
ifeq ($(UNAME), Msys)
MSFLAGS = -lws2_32
endif
MQTT_C_SOURCES = src/mqtt.c src/mqtt_pal.c
MQTT_C_EXAMPLES = bin/simple_publisher bin/simple_subscriber bin/reconnect_subscriber bin/bio_publisher bin/openssl_publisher
MQTT_C_UNITTESTS = bin/tests
BINDIR = bin
all: $(BINDIR) $(MQTT_C_UNITTESTS) $(MQTT_C_EXAMPLES)
bin/simple_%: examples/simple_%.c $(MQTT_C_SOURCES)
$(CC) $(CFLAGS) $^ -lpthread $(MSFLAGS) -o $@
bin/reconnect_%: examples/reconnect_%.c $(MQTT_C_SOURCES)
$(CC) $(CFLAGS) $^ -lpthread $(MSFLAGS) -o $@
bin/bio_%: examples/bio_%.c $(MQTT_C_SOURCES)
$(CC) $(CFLAGS) `pkg-config --cflags openssl` -D MQTT_USE_BIO $^ -lpthread $(MSFLAGS) `pkg-config --libs openssl` -o $@
bin/openssl_%: examples/openssl_%.c $(MQTT_C_SOURCES)
$(CC) $(CFLAGS) `pkg-config --cflags openssl` -D MQTT_USE_BIO $^ -lpthread $(MSFLAGS) `pkg-config --libs openssl` -o $@
$(BINDIR):
mkdir -p $(BINDIR)
$(MQTT_C_UNITTESTS): tests.c $(MQTT_C_SOURCES)
$(CC) $(CFLAGS) $^ -lcmocka $(MSFLAGS) -o $@
clean:
rm -rf $(BINDIR)
check: all
./$(MQTT_C_UNITTESTS)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/snowingbear/MQTT-C.git
git@gitee.com:snowingbear/MQTT-C.git
snowingbear
MQTT-C
MQTT-C
master

搜索帮助