X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=examples%2Fnetwork_server%2FMakefile;h=2c7639a15dbf418c49d24cc8d2d07b691ac29fc0;hb=c13b3676617131c9449568ddb8ea48ba94717dcc;hp=981f2cf92b5e1268f38e037f96ac1a80a44b8d08;hpb=f47410ea4b8ae43e19facd378be4cf1073e1813b;p=apps%2Fagl-service-can-low-level.git diff --git a/examples/network_server/Makefile b/examples/network_server/Makefile index 981f2cf9..2c7639a1 100644 --- a/examples/network_server/Makefile +++ b/examples/network_server/Makefile @@ -1,19 +1,17 @@ -CFLAGS = -ansi -Wall -Werror -g -O0 +# Include the nanopb provided Makefile rules +include ../../extra/nanopb.mk -# Path to the nanopb root folder -NANOPB_DIR = ../.. -DEPS = $(NANOPB_DIR)/pb_decode.c $(NANOPB_DIR)/pb_decode.h \ - $(NANOPB_DIR)/pb_encode.c $(NANOPB_DIR)/pb_encode.h $(NANOPB_DIR)/pb.h +# Compiler flags to enable all warnings & debug info +CFLAGS = -ansi -Wall -Werror -g -O0 CFLAGS += -I$(NANOPB_DIR) all: server client +.SUFFIXES: + clean: rm -f server client fileproto.pb.c fileproto.pb.h -%: %.c $(DEPS) fileproto.pb.h fileproto.pb.c - $(CC) $(CFLAGS) -o $@ $< $(NANOPB_DIR)/pb_decode.c $(NANOPB_DIR)/pb_encode.c fileproto.pb.c common.c +%: %.c common.c fileproto.pb.c + $(CC) $(CFLAGS) -o $@ $^ $(NANOPB_CORE) -fileproto.pb.c fileproto.pb.h: fileproto.proto $(NANOPB_DIR)/generator/nanopb_generator.py - protoc -ofileproto.pb $< - python $(NANOPB_DIR)/generator/nanopb_generator.py fileproto.pb