1 CFLAGS = -ansi -Wall -Werror -g -O0
3 # Path to the nanopb root folder
5 DEPS = $(NANOPB_DIR)/pb_decode.c $(NANOPB_DIR)/pb_decode.h \
6 $(NANOPB_DIR)/pb_encode.c $(NANOPB_DIR)/pb_encode.h $(NANOPB_DIR)/pb.h
7 CFLAGS += -I$(NANOPB_DIR)
12 rm -f server client fileproto.pb.c fileproto.pb.h
14 %: %.c $(DEPS) fileproto.pb.h fileproto.pb.c
15 $(CC) $(CFLAGS) -o $@ $< $(NANOPB_DIR)/pb_decode.c $(NANOPB_DIR)/pb_encode.c fileproto.pb.c common.c
17 fileproto.pb.c fileproto.pb.h: fileproto.proto $(NANOPB_DIR)/generator/nanopb_generator.py
18 protoc -ofileproto.pb $<
19 python $(NANOPB_DIR)/generator/nanopb_generator.py fileproto.pb