2020-02-17 13:12:34 -08:00
|
|
|
# dragino lora testing
|
|
|
|
# Single lora testing app
|
|
|
|
|
|
|
|
CC=g++
|
2020-02-17 15:51:44 -08:00
|
|
|
CFLAGS=-c -Wall `pkg-config --cflags sqlite3 'libprotobuf-c >= 1.0.0'`
|
|
|
|
LIBS=-lwiringPi -lprotobuf-c -lsqlite3
|
2020-02-17 13:12:34 -08:00
|
|
|
|
|
|
|
all: dragino_lora_app
|
|
|
|
|
2020-02-17 15:51:44 -08:00
|
|
|
dragino_lora_app: main.o protobuf.o message.pb-c.o database.o
|
|
|
|
$(CC) main.o protobuf.o database.o message.pb-c.o $(LIBS) -o dragino_lora_app
|
2020-02-17 13:12:34 -08:00
|
|
|
|
2020-02-17 14:17:23 -08:00
|
|
|
main.o: main.c protobuf.h
|
2020-02-17 13:12:34 -08:00
|
|
|
$(CC) $(CFLAGS) main.c
|
|
|
|
|
2020-02-17 14:17:23 -08:00
|
|
|
protobuf.o: message.pb-c.h protobuf.c protobuf.h
|
|
|
|
$(CC) $(CFLAGS) protobuf.c -o protobuf.o
|
|
|
|
|
|
|
|
protobuf.h: message.pb-c.h
|
|
|
|
|
2020-02-17 15:51:44 -08:00
|
|
|
database.o: database.c database.h
|
|
|
|
$(CC) $(CFLAGS) database.c -o database.o
|
|
|
|
|
2020-02-17 14:17:23 -08:00
|
|
|
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
|
|
|
|
|
2020-02-17 13:12:34 -08:00
|
|
|
clean:
|
2020-02-17 14:17:23 -08:00
|
|
|
rm *.o dragino_lora_app message.pb-c.c message.pb-c.h
|