代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/mqttclient 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
mkdir -p libmqttclient libmqttclient/include libmqttclient/lib
cd libmqttclient
if [ ! -f "Makefile" ]; then
cat <<-EOF > Makefile
CC=\$(CROSS_COMPILE)gcc
SRC = \$(wildcard ../*.c \\
../common/*.c \\
../common/log/*.c \\
../common/log/arch/linux/*.c \\
../network/mbedtls/library/*.c \\
../network/mbedtls/wrapper/*.c \\
../mqtt/*.c \\
../mqttclient/*.c \\
../network/*.c \\
../platform/linux/*.c \\
)
INC = -lpthread \\
-I../common \\
-I../common/log \\
-I../network/mbedtls/include \\
-I../network/mbedtls/include/mbedtls \\
-I../network/mbedtls/wrapper \\
-I../mqtt \\
-I../mqttclient \\
-I../network \\
-I../platform/linux \\
-I../test
OBJS = \$(patsubst %.c, %.o, \$(SRC))
FLAG = -g -fpic -I. -Iinclude \$(INC)
TARGET = libmqttclient.so
EOF
echo -e "\n\$(TARGET):\$(OBJS)" >> Makefile
echo -e "\t\$(CC) -shared \$^ -o \$@" >> Makefile
echo -e "\n%.o:%.c" >> Makefile
echo -e "\t\$(CC) -c \$(FLAG) \$^ -o \$@" >> Makefile
echo -e "\nclean:" >> Makefile
echo -e "\trm -rf \$(TARGET) \$(OBJS)" >> Makefile
echo -e "\ninstall:" >> Makefile
echo -e "\tsudo cp -rdf \$(TARGET) /usr/lib/." >> Makefile
echo -e "\nremove:" >> Makefile
echo -e "\tsudo rm -rdf /usr/lib/\$(TARGET)" >> Makefile
echo -e "\n.PHONY:clean" >> Makefile
fi
cp -r ../test/*.h include/.
cp -r ../mqtt/*.h include/.
cp -r ../common/*.h include/.
cp -r ../network/*.h include/.
cp -r ../mqttclient/*.h include/.
cp -r ../common/log/*.h include/.
cp -r ../platform/linux/*.h include/.
cp -r ../network/mbedtls/include/mbedtls include/.
cp -r ../network/mbedtls/wrapper/*.h include/.
if [ " $1" == " " ]; then
make
make install
mv libmqttclient.so lib/.
make clean
elif [ "$1" == "remove" ]; then
make remove
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。