mirror of
https://github.com/thiagoralves/OpenPLC_v3.git
synced 2026-09-25 08:44:06 +08:00
Adding Orange Pi as a platform in the compiling script
This commit is contained in:
@@ -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!"
|
||||
|
||||
Reference in New Issue
Block a user