aboutsummaryrefslogtreecommitdiffstats
path: root/example_avr_double/Makefile
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-01-29 22:10:37 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-01-29 22:10:37 +0200
commite4b55179d1f53c42916f5e62fb83789973bf4b01 (patch)
tree4505321c4c14bdca6362b1e1bb1054c3588a4543 /example_avr_double/Makefile
parent2392d255749715ad337d3f5e23d3de7f2065e3dd (diff)
Add an example of handling doubles on AVR platform.
Diffstat (limited to 'example_avr_double/Makefile')
-rw-r--r--example_avr_double/Makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/example_avr_double/Makefile b/example_avr_double/Makefile
new file mode 100644
index 00000000..74300fc6
--- /dev/null
+++ b/example_avr_double/Makefile
@@ -0,0 +1,22 @@
+CFLAGS=-Wall -Werror -I .. -g -O0
+DEPS=double_conversion.c ../pb_decode.c ../pb_decode.h ../pb_encode.c ../pb_encode.h ../pb.h
+
+all: run_tests
+
+clean:
+ rm -f test_conversions encode_double decode_double doubleproto.pb.c doubleproto.pb.h
+
+test_conversions: test_conversions.c double_conversion.c
+ $(CC) $(CFLAGS) -o $@ $^
+
+%: %.c $(DEPS) doubleproto.pb.h doubleproto.pb.c
+ $(CC) $(CFLAGS) -o $@ $< double_conversion.c ../pb_decode.c ../pb_encode.c doubleproto.pb.c
+
+doubleproto.pb.c doubleproto.pb.h: doubleproto.proto ../generator/nanopb_generator.py
+ protoc -I. -I../generator -I/usr/include -odoubleproto.pb $<
+ python ../generator/nanopb_generator.py doubleproto.pb
+
+run_tests: test_conversions encode_double decode_double
+ ./test_conversions
+ ./encode_double | ./decode_double
+