From 45c1a32e5046fe9323d4fd0213b474a554b2bbed Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Sun, 17 Nov 2013 20:04:29 +0200 Subject: Rework the Makefiles to be compatible with binary packages. --- examples/using_double_on_avr/Makefile | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'examples/using_double_on_avr') diff --git a/examples/using_double_on_avr/Makefile b/examples/using_double_on_avr/Makefile index 0b5383fa..6f2203ae 100644 --- a/examples/using_double_on_avr/Makefile +++ b/examples/using_double_on_avr/Makefile @@ -1,10 +1,8 @@ -CFLAGS = -Wall -Werror -g -O0 +# Include the nanopb provided Makefile rules +include ../../extra/nanopb.mk -# Path to the nanopb root directory -NANOPB_DIR = ../.. -DEPS = double_conversion.c $(NANOPB_DIR)/pb.h \ - $(NANOPB_DIR)/pb_decode.c $(NANOPB_DIR)/pb_decode.h \ - $(NANOPB_DIR)/pb_encode.c $(NANOPB_DIR)/pb_encode.h +# Compiler flags to enable all warnings & debug info +CFLAGS = -Wall -Werror -g -O0 CFLAGS += -I$(NANOPB_DIR) all: run_tests @@ -15,13 +13,8 @@ clean: 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 \ - $(NANOPB_DIR)/pb_decode.c $(NANOPB_DIR)/pb_encode.c doubleproto.pb.c - -doubleproto.pb.c doubleproto.pb.h: doubleproto.proto $(NANOPB_DIR)/generator/nanopb_generator.py - protoc -odoubleproto.pb $< - python $(NANOPB_DIR)/generator/nanopb_generator.py doubleproto.pb +%: %.c double_conversion.c doubleproto.pb.c + $(CC) $(CFLAGS) -o $@ $^ $(NANOPB_CORE) run_tests: test_conversions encode_double decode_double ./test_conversions -- cgit 1.2.3-korg