summaryrefslogtreecommitdiffstats
path: root/example_avr_double/Makefile
blob: 74300fc6c3c19d597d4aa980ab4ed49cd1f0efe7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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