-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
40 lines (30 loc) · 834 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
29
30
31
32
33
34
35
36
37
38
OBJECTS=led-mqtt.o
BINARIES=led-mqtt
PAHO_C_HEADERS ?= /usr/local/include
PAHO_C_LIB ?= /usr/local/lib
RGB_INCDIR=matrix/include
RGB_LIBDIR=matrix/lib
RGB_LIBRARY_NAME=rgbmatrix
RGB_LIBRARY=$(RGB_LIBDIR)/lib$(RGB_LIBRARY_NAME).a
LDFLAGS+=-L$(PAHO_C_LIB) -L$(RGB_LIBDIR) -l$(RGB_LIBRARY_NAME) -ljsoncpp -lpaho-mqtt3a -lpaho-mqttpp3 -lrt -lm -lpthread
CPPFLAGS += -I$(PAHO_C_HEADERS)
CXXFLAGS=-Wall -std=c++0x
ifdef DEBUG
CPPFLAGS += -DDEBUG
CXXFLAGS += -g -O0
else
CPPFLAGS += -D_NDEBUG
CXXFLAGS += -O3
endif
all : led-mqtt
led-mqtt : $(OBJECTS) $(RGB_LIBRARY)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(OBJECTS) -o $@ $(LDFLAGS)
$(RGB_LIBRARY): FORCE
$(MAKE) -C $(RGB_LIBDIR)
%.o : %.cc
$(CXX) -I$(RGB_INCDIR) $(CXXFLAGS) -c -o $@ $<
clean:
rm -f $(OBJECTS) $(BINARIES)
$(MAKE) -C $(RGB_LIBDIR) clean
FORCE:
.PHONY: FORCE