-
Notifications
You must be signed in to change notification settings - Fork 286
/
Makefile
28 lines (23 loc) · 903 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
CXX=g++
# -std=gnu++17
VERSION=OSPI
CXXFLAGS=-std=gnu++14 -D$(VERSION) -DSMTP_OPENSSL -Wall -include string.h -Iexternal/TinyWebsockets/tiny_websockets_lib/include -Iexternal/OpenThings-Framework-Firmware-Library/
LD=$(CXX)
LIBS=pthread mosquitto ssl crypto
LDFLAGS=$(addprefix -l,$(LIBS))
BINARY=OpenSprinkler
SOURCES=main.cpp OpenSprinkler.cpp program.cpp opensprinkler_server.cpp utils.cpp weather.cpp gpio.cpp mqtt.cpp smtp.c $(wildcard external/TinyWebsockets/tiny_websockets_lib/src/*.cpp) $(wildcard external/OpenThings-Framework-Firmware-Library/*.cpp)
HEADERS=$(wildcard *.h) $(wildcard *.hpp)
OBJECTS=$(addsuffix .o,$(basename $(SOURCES)))
.PHONY: all
all: $(BINARY)
%.o: %.cpp %.c $(HEADERS)
$(CXX) -c -o "$@" $(CXXFLAGS) "$<"
$(BINARY): $(OBJECTS)
$(CXX) -o $(BINARY) $(OBJECTS) $(LDFLAGS)
.PHONY: clean
clean:
rm -f $(OBJECTS) $(BINARY)
.PHONY: container
container:
docker build .