forked from adafruit/rpi-rgb-led-matrix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (33 loc) · 1.31 KB
/
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
39
40
41
42
43
44
45
CXXFLAGS=-Wall -O3 -g -std=c++11
#BINARIES=led-matrix minimal-example text-example rgbmatrix.so
BINARIES=partypole led-matrix minimal-example text-example
# Where our library resides. It is split between includes and the binary
# library in lib
RGB_INCDIR=include
RGB_LIBDIR=lib
RGB_LIBRARY_NAME=rgbmatrix
RGB_LIBRARY=$(RGB_LIBDIR)/lib$(RGB_LIBRARY_NAME).a
GIFLIB_DIR=giflib-5.1.3/lib
GIFLIB_OBJS=$(GIFLIB_DIR)/dgif_lib.o \
$(GIFLIB_DIR)/gifalloc.o \
$(GIFLIB_DIR)/openbsd-reallocarray.o \
LDFLAGS+=-L$(RGB_LIBDIR) -l$(RGB_LIBRARY_NAME) -lrt -lm -lpthread
all : $(BINARIES)
$(RGB_LIBRARY):
$(MAKE) -C $(RGB_LIBDIR)
partypole : partypole.o $(GIFLIB_OBJS) $(RGB_LIBRARY)
$(CXX) $(CXXFLAGS) -o $@ partypole.o $(GIFLIB_OBJS) $(LDFLAGS)
led-matrix : demo-main.o $(RGB_LIBRARY)
$(CXX) $(CXXFLAGS) demo-main.o -o $@ $(LDFLAGS)
minimal-example : minimal-example.o $(RGB_LIBRARY)
$(CXX) $(CXXFLAGS) minimal-example.o -o $@ $(LDFLAGS)
text-example : text-example.o $(RGB_LIBRARY)
$(CXX) $(CXXFLAGS) text-example.o -o $@ $(LDFLAGS)
# Python module
rgbmatrix.so: rgbmatrix.o $(RGB_LIBRARY)
$(CXX) -s -shared -lstdc++ -Wl,-soname,librgbmatrix.so -o $@ $< $(LDFLAGS)
%.o : %.cc
$(CXX) -I$(RGB_INCDIR) -I$(GIFLIB_DIR) $(CXXFLAGS) -DADAFRUIT_RGBMATRIX_HAT -c -o $@ $<
clean:
rm -f *.o $(GIFLIB_OBJS) $(BINARIES)
$(MAKE) -C lib clean