From 1e0976068820904ac1da6cf98c92bc684b8e8271 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 20 Dec 2018 13:36:38 -0800 Subject: [PATCH] Move FRC_JSON and DHCPCD_CONF to Makefile --- deps/tools/Makefile | 6 ++++++ deps/tools/rpiConfigServer_src/NetworkSettings.cpp | 6 ------ deps/tools/rpiConfigServer_src/VisionSettings.cpp | 6 ------ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/deps/tools/Makefile b/deps/tools/Makefile index bb7fb28..6a76f86 100644 --- a/deps/tools/Makefile +++ b/deps/tools/Makefile @@ -3,6 +3,9 @@ COMPILER?=../02-extract/raspbian9/bin/arm-raspbian9-linux-gnueabihf- WPILIB?=../allwpilib WPILIB_PLATFORM?=. OPENCV_INSTALL?=../03-build/opencv-build/install +EXEC_HOME?=/home/pi +FRC_JSON?=/boot/frc.json +DHCPCD_CONF?=/boot/dhcpcd.conf .PHONY: all .SUFFIXES: @@ -58,6 +61,9 @@ rpiConfigServer: ${RPICONFIGSERVER_OBJS} %.o: %.cpp ${COMPILER}g++ -O -Wall -c -o $@ \ -I${WPILIB}/wpiutil/src/main/native/include \ + '-DEXEC_HOME="${EXEC_HOME}"' \ + '-DFRC_JSON="${FRC_JSON}"' \ + '-DDHCPCD_CONF="${DHCPCD_CONF}"' \ $< %.html.cpp: %.html diff --git a/deps/tools/rpiConfigServer_src/NetworkSettings.cpp b/deps/tools/rpiConfigServer_src/NetworkSettings.cpp index 5255564..658cbde 100644 --- a/deps/tools/rpiConfigServer_src/NetworkSettings.cpp +++ b/deps/tools/rpiConfigServer_src/NetworkSettings.cpp @@ -21,12 +21,6 @@ namespace uv = wpi::uv; -#ifdef __RASPBIAN9__ -#define DHCPCD_CONF "/boot/dhcpcd.conf" -#else -#define DHCPCD_CONF "dhcpcd.conf" -#endif - #define GEN_MARKER "###### BELOW THIS LINE EDITED BY RPICONFIGSERVER ######" /* diff --git a/deps/tools/rpiConfigServer_src/VisionSettings.cpp b/deps/tools/rpiConfigServer_src/VisionSettings.cpp index c6ae093..2fcf8dc 100644 --- a/deps/tools/rpiConfigServer_src/VisionSettings.cpp +++ b/deps/tools/rpiConfigServer_src/VisionSettings.cpp @@ -14,12 +14,6 @@ #include "VisionStatus.h" -#ifdef __RASPBIAN9__ -#define FRC_JSON "/boot/frc.json" -#else -#define FRC_JSON "frc.json" -#endif - std::shared_ptr VisionSettings::GetInstance() { static auto inst = std::make_shared(private_init{}); return inst;