forked from hzeller/rpi-rgb-led-matrix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (27 loc) · 871 Bytes
/
Makefile
File metadata and controls
35 lines (27 loc) · 871 Bytes
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
# Compiler settings
CXX = g++
CXXFLAGS = -Wall -O3 -g -Wextra -Wno-unused-parameter
# Source files and executable
SRCS = src/main.cpp src/display.cpp src/queue-client.cpp
OBJECTS = $(SRCS:.cpp=.o)
BINARIES = rgboard
# Where our RGB library resides
RGB_LIB_DISTRIBUTION = ..
RGB_INCDIR = $(RGB_LIB_DISTRIBUTION)/include
RGB_LIBDIR = $(RGB_LIB_DISTRIBUTION)/lib
RGB_LIBRARY_NAME = rgbmatrix
RGB_LIBRARY = $(RGB_LIBDIR)/lib$(RGB_LIBRARY_NAME).a
# Linker flags: add libcurl and jsoncpp
LDFLAGS += -L$(RGB_LIBDIR) -l$(RGB_LIBRARY_NAME) -lcurl -ljsoncpp -lrt -lm -lpthread
# Default target
all: $(BINARIES)
# Compile .o files
src/%.o: src/%.cpp
$(CXX) $(CXXFLAGS) -Iinclude -I$(RGB_INCDIR) -c -o $@ $<
# Link final binary
rgboard: $(OBJECTS) $(RGB_LIBRARY)
$(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LDFLAGS)
# Clean up
clean:
rm -f src/*.o $(BINARIES)
.PHONY: all clean