mirror of
https://github.com/Hopiu/rpi-rgb-led-matrix.git
synced 2026-03-16 22:10:27 +00:00
36 lines
1 KiB
Makefile
36 lines
1 KiB
Makefile
CXXFLAGS=-Wall -O3 -g
|
|
OBJECTS=led-image-viewer.o
|
|
BINARIES=led-image-viewer
|
|
|
|
# Where our library resides. You mostly only need to change the
|
|
# RGB_LIB_DISTRIBUTION, this is where the library is checked out.
|
|
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
|
|
LDFLAGS+=-L$(RGB_LIBDIR) -l$(RGB_LIBRARY_NAME) -lrt -lm -lpthread
|
|
|
|
# Imagemagic flags, only needed if actually compiled.
|
|
MAGICK_CXXFLAGS=`GraphicsMagick++-config --cppflags --cxxflags`
|
|
MAGICK_LDFLAGS=`GraphicsMagick++-config --ldflags --libs`
|
|
|
|
all : $(BINARIES)
|
|
|
|
$(RGB_LIBRARY): FORCE
|
|
$(MAKE) -C $(RGB_LIBDIR)
|
|
|
|
led-image-viewer: led-image-viewer.o $(RGB_LIBRARY)
|
|
$(CXX) $(CXXFLAGS) led-image-viewer.o -o $@ $(LDFLAGS) $(MAGICK_LDFLAGS)
|
|
|
|
%.o : %.cc
|
|
$(CXX) -I$(RGB_INCDIR) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
led-image-viewer.o : led-image-viewer.cc
|
|
$(CXX) -I$(RGB_INCDIR) $(CXXFLAGS) $(MAGICK_CXXFLAGS) -c -o $@ $<
|
|
|
|
clean:
|
|
rm -f $(OBJECTS) $(BINARIES)
|
|
|
|
FORCE:
|
|
.PHONY: FORCE
|