Update changelog
[apps/agl-service-can-low-level.git] / examples / simple / Makefile
1 # Compiler flags to enable all warnings & debug info
2 CFLAGS = -Wall -Werror -g -O0
3
4 # Path to the nanopb root folder
5 NANOPB_DIR = ../..
6 CFLAGS += -I$(NANOPB_DIR)
7
8 # C source code files that are required
9 CSRC  = simple.c                   # The main program
10 CSRC += simple.pb.c                # The compiled protocol definition
11 CSRC += $(NANOPB_DIR)/pb_encode.c  # The nanopb encoder
12 CSRC += $(NANOPB_DIR)/pb_decode.c  # The nanopb decoder
13
14 # Build rule for the main program
15 simple: $(CSRC)
16         $(CC) $(CFLAGS) -osimple $(CSRC)
17
18 # Build rule for the protocol
19 simple.pb.c: simple.proto
20         protoc -osimple.pb simple.proto
21         python $(NANOPB_DIR)/generator/nanopb_generator.py simple.pb
22