2018-12-20 21:26:14 +00:00
|
|
|
SYSROOT?=../02-extract/raspbian9/arm-raspbian9-linux-gnueabihf
|
|
|
|
COMPILER?=../02-extract/raspbian9/bin/arm-raspbian9-linux-gnueabihf-
|
2018-12-30 10:07:22 +00:00
|
|
|
WPILIB_SRC?=../allwpilib
|
|
|
|
WPILIB_BUILD?=../03-build/allwpilib-build
|
|
|
|
WPILIB_STATIC_BUILD?=../03-build/allwpilib-static
|
2018-12-20 21:26:14 +00:00
|
|
|
OPENCV_INSTALL?=../03-build/opencv-build/install
|
2018-12-20 21:36:38 +00:00
|
|
|
EXEC_HOME?=/home/pi
|
|
|
|
FRC_JSON?=/boot/frc.json
|
|
|
|
DHCPCD_CONF?=/boot/dhcpcd.conf
|
2018-12-30 08:13:52 +00:00
|
|
|
APP_UID?=1000
|
|
|
|
APP_GID?=1000
|
2018-12-02 08:21:42 +00:00
|
|
|
|
2018-12-12 04:04:00 +00:00
|
|
|
.PHONY: all
|
|
|
|
.SUFFIXES:
|
|
|
|
|
|
|
|
all: setuidgids _cscore.so rpiConfigServer
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f setuidgids
|
|
|
|
rm -f _cscore.so
|
|
|
|
rm -f rpiConfigServer
|
2018-12-20 21:26:14 +00:00
|
|
|
rm -f rpiConfigServer_src/*.o
|
|
|
|
rm -f rpiConfigServer_src/resources/*.o
|
2018-12-02 08:21:42 +00:00
|
|
|
|
|
|
|
setuidgids: setuidgids.c
|
|
|
|
${COMPILER}gcc -O -Wall -D_GNU_SOURCE -o $@ $<
|
|
|
|
|
|
|
|
_cscore.so: ../robotpy-cscore/src/_cscore.cpp ../robotpy-cscore/src/ndarray_converter.cpp
|
2018-12-30 10:07:22 +00:00
|
|
|
${COMPILER}g++ -g -O -Wall -fvisibility=hidden -shared -fPIC -o $@ \
|
2018-12-20 21:26:14 +00:00
|
|
|
-I${OPENCV_INSTALL}/include \
|
2018-12-30 10:07:22 +00:00
|
|
|
-I${WPILIB_SRC}/wpiutil/src/main/native/include \
|
|
|
|
-I${WPILIB_SRC}/cscore/src/main/native/include \
|
2018-12-20 21:26:14 +00:00
|
|
|
-I${SYSROOT}/usr/include/python3.5 \
|
2018-12-30 10:07:22 +00:00
|
|
|
-L${WPILIB_BUILD}/lib \
|
2018-12-20 21:26:14 +00:00
|
|
|
-L${OPENCV_INSTALL}/lib \
|
2018-12-02 08:21:42 +00:00
|
|
|
../robotpy-cscore/src/_cscore.cpp \
|
|
|
|
../robotpy-cscore/src/ndarray_converter.cpp \
|
|
|
|
-lcscore \
|
|
|
|
-lwpiutil \
|
|
|
|
-lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_core
|
2018-12-30 10:07:22 +00:00
|
|
|
${COMPILER}objcopy --only-keep-debug $@ $@.debug
|
|
|
|
${COMPILER}strip -g $@
|
|
|
|
${COMPILER}objcopy --add-gnu-debuglink=$@.debug $@
|
2018-12-12 04:04:00 +00:00
|
|
|
|
|
|
|
RPICONFIGSERVER_OBJS= \
|
|
|
|
rpiConfigServer_src/main.o \
|
2018-12-21 08:08:34 +00:00
|
|
|
rpiConfigServer_src/Application.o \
|
2018-12-12 04:04:00 +00:00
|
|
|
rpiConfigServer_src/MyHttpConnection.o \
|
2018-12-17 08:54:25 +00:00
|
|
|
rpiConfigServer_src/NetworkSettings.o \
|
2018-12-12 04:04:00 +00:00
|
|
|
rpiConfigServer_src/SystemStatus.o \
|
2018-12-20 21:26:14 +00:00
|
|
|
rpiConfigServer_src/VisionSettings.o \
|
2018-12-12 04:04:00 +00:00
|
|
|
rpiConfigServer_src/VisionStatus.o \
|
|
|
|
rpiConfigServer_src/WebSocketHandlers.o \
|
|
|
|
rpiConfigServer_src/resources/index.html.o \
|
|
|
|
rpiConfigServer_src/resources/frcvision.css.o \
|
|
|
|
rpiConfigServer_src/resources/frcvision.js.o
|
|
|
|
|
|
|
|
rpiConfigServer: ${RPICONFIGSERVER_OBJS}
|
2018-12-30 10:07:22 +00:00
|
|
|
${COMPILER}g++ -pthread -g -o $@ \
|
2018-12-12 04:04:00 +00:00
|
|
|
${RPICONFIGSERVER_OBJS} \
|
2018-12-30 10:07:22 +00:00
|
|
|
-L${WPILIB_STATIC_BUILD}/lib \
|
2018-12-12 04:04:00 +00:00
|
|
|
-lwpiutil
|
2018-12-17 08:54:25 +00:00
|
|
|
${COMPILER}objcopy --only-keep-debug $@ $@.debug
|
|
|
|
${COMPILER}strip -g $@
|
2018-12-17 09:54:20 +00:00
|
|
|
${COMPILER}objcopy --add-gnu-debuglink=$@.debug $@
|
2018-12-12 04:04:00 +00:00
|
|
|
|
|
|
|
%.o: %.cpp
|
2018-12-30 10:07:22 +00:00
|
|
|
${COMPILER}g++ -g -O -Wall -c -o $@ \
|
|
|
|
-I${WPILIB_SRC}/wpiutil/src/main/native/include \
|
2018-12-20 21:36:38 +00:00
|
|
|
'-DEXEC_HOME="${EXEC_HOME}"' \
|
|
|
|
'-DFRC_JSON="${FRC_JSON}"' \
|
|
|
|
'-DDHCPCD_CONF="${DHCPCD_CONF}"' \
|
2018-12-30 08:13:52 +00:00
|
|
|
'-DAPP_UID=${APP_UID}' \
|
|
|
|
'-DAPP_GID=${APP_GID}' \
|
2018-12-12 04:04:00 +00:00
|
|
|
$<
|
|
|
|
|
|
|
|
%.html.cpp: %.html
|
|
|
|
./gen_resource.py $@ $<
|
|
|
|
|
|
|
|
%.css.cpp: %.css
|
|
|
|
./gen_resource.py $@ $<
|
|
|
|
|
|
|
|
%.js.cpp: %.js
|
|
|
|
./gen_resource.py $@ $<
|
|
|
|
|