From e4b55179d1f53c42916f5e62fb83789973bf4b01 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Tue, 29 Jan 2013 22:10:37 +0200 Subject: Add an example of handling doubles on AVR platform. --- example_avr_double/Makefile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 example_avr_double/Makefile (limited to 'example_avr_double/Makefile') 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 + -- cgit 1.2.3-korg