代码拉取完成,页面将自动刷新
#!/bin/bash
if [ "$1" == "install" ]; then
echo "Build Started with Bazel ..."
echo "Building Emulator library ..."
bazel build :pc_emulator_lib
echo "Building Python Proto libs ..."
bazel build :py_access_service_proto
echo "Building LibModbus extensions ..."
cd contrib/libmodbus && ./autogen.sh && ./configure && make install
cd ../../
sudo ldconfig
echo "Building GRPC extensions ..."
bazel build :grpc_ext_lib
echo "Building GRPC server ..."
bazel build :pc_grpc_server
sudo cp bazel-bin/pc_grpc_server /usr/bin
echo "Building Modbus comm module ..."
bazel build :modbus_comm_module
sudo cp bazel-bin/modbus_comm_module /usr/bin
echo "Building PLC Runnable ..."
bazel build :plc_runner
sudo cp bazel-bin/plc_runner /usr/bin
echo "Building Example HMI ..."
bazel build :example_hmi
sudo cp bazel-bin/example_hmi /usr/bin
sudo cp bazel-genfiles/py_access_service_proto_pb/src/pc_emulator/proto/*.py src/pc_emulator/proto
sudo chmod 777 src/pc_emulator/proto/*.py
echo "Build and Install finished ..."
else
if [ "$1" == "uninstall" ]; then
echo "Cleaning up installation ..."
bazel clean
rm /usr/bin/pc_grpc_server || true
rm /usr/bin/modbus_comm_module || true
rm /usr/bin/plc_runner || true
rm /usr/bin/example_hmi || true
rm src/pc_emulator/proto/*.py
cd contrib/libmodbus && make uninstall
cd ../../
echo "Cleanup finished ..."
fi
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。