42 lines
940 B
Makefile
42 lines
940 B
Makefile
.PHONY: default all clean
|
|
|
|
RGB_LIB_DISTRIBUTION=../../rpi-rgb-led-matrix
|
|
RGB_INCDIR=$(RGB_LIB_DISTRIBUTION)/include
|
|
RGB_LIBDIR=$(RGB_LIB_DISTRIBUTION)/lib
|
|
RGB_LIBRARY_NAME=librgbmatrix
|
|
RGB_LIBRARY=$(RGB_LIBDIR)/lib$(RGB_LIBRARY_NAME).a
|
|
LDFLAGS+=-L$(RGB_LIBDIR) -l$(RGB_LIBRARY_NAME) -lrt -lm -lpthread
|
|
|
|
CC = gcc
|
|
CFLAGS = -Wall -pthread
|
|
LIBS = -levent -levent_pthreads -lrt -lGL -lGLEW -lglfw $(RGB_LIBRARY_NAME).a -lrt -lm -lpthread -lstdc++
|
|
TARGET = pixelnuke
|
|
|
|
|
|
|
|
default: CFLAGS += -O2 -flto
|
|
default: $(TARGET)
|
|
all: default
|
|
|
|
debug: CFLAGS += -DDEBUG -g
|
|
debug: $(TARGET)
|
|
|
|
OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c))
|
|
HEADERS = $(wildcard *.h)
|
|
|
|
%.o: %.c $(HEADERS)
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
% : %.o $(RGB_LIBRARY)
|
|
$(CXX) $< -o $@ $(LDFLAGS)
|
|
|
|
%.o : %.c
|
|
$(CC) -I$(RGB_INCDIR) $(CFLAGS) -c -o $@ $<
|
|
|
|
.PRECIOUS: $(TARGET) $(OBJECTS)
|
|
|
|
$(TARGET): $(OBJECTS)
|
|
$(CC) $(CFLAGS) $(OBJECTS) -Wall $(LIBS) -o $@
|
|
|
|
clean:
|
|
-rm -f *.o $(TARGET)
|