summaryrefslogtreecommitdiff
path: root/src/app/prototest/Makefile.inc
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-11-13 10:41:05 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-11-13 10:41:05 +0100
commit63d7c555e375a5a6b62809271111fec309ffe2e4 (patch)
tree694a0eef498cfbe3ca7ecc6348702277d1011f39 /src/app/prototest/Makefile.inc
parent9ce1f1ea246d0f3dcee78eaa483e2bf9b0af35f5 (diff)
add NanoPB Protocol Buffers implementation
Diffstat (limited to 'src/app/prototest/Makefile.inc')
-rw-r--r--src/app/prototest/Makefile.inc25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/app/prototest/Makefile.inc b/src/app/prototest/Makefile.inc
index ae7794e..0940fd2 100644
--- a/src/app/prototest/Makefile.inc
+++ b/src/app/prototest/Makefile.inc
@@ -1,2 +1,25 @@
loop ?= 1
-TARGETS += src/os/object/xdrstream.cc src/os/object/xdrinput.cc
+
+ifeq (${prototest_arduinojson}, 1)
+ COMMON_FLAGS += -DPROTOTEST_ARDUINOJSON
+endif
+
+ifeq (${prototest_modernjson}, 1)
+ COMMON_FLAGS += -DPROTOTEST_MODERNJSON
+endif
+
+ifeq (${prototest_nanopb}, 1)
+ COMMON_FLAGS += -DPROTOTEST_NANOPB
+ TARGETS += src/app/prototest/nanopb.pb.cc src/lib/nanopb/pb_common.cc
+ TARGETS += src/lib/nanopb/pb_decode.cc src/lib/nanopb/pb_encode.cc
+ INCLUDES += -Iinclude/lib/nanopb
+endif
+
+ifeq (${prototest_xdr}, 1)
+ COMMON_FLAGS += -DPROTOTEST_XDR
+ TARGETS += src/os/object/xdrstream.cc src/os/object/xdrinput.cc
+endif
+
+%.pb.cc: %.proto
+ protoc --plugin=protoc-gen-nanopb=${HOME}/var/ess/protocol-modeling/nanopb/generator/protoc-gen-nanopb --nanopb_out=. src/app/prototest/nanopb.proto
+ mv src/app/prototest/nanopb.pb.c src/app/prototest/nanopb.pb.cc