Adding Orange Pi as a platform in the compiling script

This commit is contained in:
Kostadin Popov
2024-09-10 18:12:00 +03:00
parent be0f9041b9
commit cfaf50861b
+29
View File
@@ -150,6 +150,35 @@ elif [ "$OPENPLC_PLATFORM" = "rpi" ]; then
fi
echo "Compilation finished successfully!"
exit 0
elif [ "$OPENPLC_PLATFORM" = "opi" ]; then
WIRINGOP_INC="-I/usr/local/include -L/usr/local/lib -lwiringPi -lwiringPiDev"
echo "Compiling for Orange Pi"
echo "Generating object files..."
g++ -std=gnu++11 -I ./lib -c Config0.c -lasiodnp3 -lasiopal -lopendnp3 -lopenpal -w $WIRINGOP_INC
if [ $? -ne 0 ]; then
echo "Error compiling C files"
echo "Compilation finished with errors!"
exit 1
fi
g++ -std=gnu++11 -I ./lib -c Res0.c -lasiodnp3 -lasiopal -lopendnp3 -lopenpal -w $WIRINGOP_INC
if [ $? -ne 0 ]; then
echo "Error compiling C files"
echo "Compilation finished with errors!"
exit 1
fi
echo "Generating glueVars..."
./glue_generator
echo "Compiling main program..."
g++ -std=gnu++11 *.cpp *.o -o openplc -I ./lib -lrt -lpthread -fpermissive `pkg-config --cflags --libs libmodbus` -lasiodnp3 -lasiopal -lopendnp3 -lopenpal -w $WIRINGOP_INC
if [ $? -ne 0 ]; then
echo "Error compiling C files"
echo "Compilation finished with errors!"
exit 1
fi
echo "Compilation finished successfully!"
exit 0
else
echo "Error: Undefined platform! OpenPLC can only compile for Windows, Linux and Raspberry Pi environments"
echo "Compilation finished with errors!"