28 lines
552 B
Makefile
28 lines
552 B
Makefile
CC := gcc
|
|
CFLAGS := -Wall -g -D_DEBUG
|
|
LDFLAGS := -lwiringPi -lasound -lfftw3 -lpthread -lm
|
|
|
|
SRC := src
|
|
OBJ := obj
|
|
BIN := bin/pixled
|
|
|
|
SOURCES := $(shell find $(SRC) -type f -name "*.c")
|
|
OBJECTS := $(patsubst $(SRC)/%.c, $(OBJ)/%.o, $(SOURCES))
|
|
|
|
|
|
|
|
all: $(BIN)
|
|
|
|
$(OBJ)/%.o: $(SRC)/%.c
|
|
if [ ! -d "$(dir $@)" ]; then mkdir -p "$(dir $@)"; fi
|
|
$(CC) -I$(SRC) -c $< -o $@ $(CFLAGS)
|
|
|
|
$(BIN) : $(OBJECTS)
|
|
if [ ! -d "$(dir $(BIN))" ]; then mkdir -p "$(dir $(BIN))"; fi
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
|
|
|
liblog.a: log.o
|
|
ar $(ARFLAGS) $@ $^
|
|
|
|
clean:
|
|
rm -rf $(OBJ)
|