gateway-old/Makefile
2020-02-17 14:17:23 -08:00

29 lines
703 B
Makefile

# dragino lora testing
# Single lora testing app
CC=g++
CFLAGS=-c -Wall `pkg-config --cflags 'libprotobuf-c >= 1.0.0'`
LIBS=-lwiringPi -lprotobuf-c
all: dragino_lora_app
dragino_lora_app: main.o protobuf.o message.pb-c.o
$(CC) main.o protobuf.o message.pb-c.o $(LIBS) -o dragino_lora_app
main.o: main.c protobuf.h
$(CC) $(CFLAGS) main.c
protobuf.o: message.pb-c.h protobuf.c protobuf.h
$(CC) $(CFLAGS) protobuf.c -o protobuf.o
protobuf.h: message.pb-c.h
message.pb-c.o: message.pb-c.h message.pb-c.c
$(CC) $(CFLAGS) message.pb-c.c -o message.pb-c.o
message.pb-c.h message.pb-c.c: message.proto
protoc-c --c_out=. message.proto
clean:
rm *.o dragino_lora_app message.pb-c.c message.pb-c.h