-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (23 loc) · 679 Bytes
/
Makefile
File metadata and controls
31 lines (23 loc) · 679 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
TARGET = unicorn-fft
LIBS = -lm -lws2811 -lfftw3
INCLUDES = -Iunicorn-hat/python/rpi-ws281x/lib
LFLAGS = -Lunicorn-hat/python/rpi-ws281x/lib
CC = gcc
CFLAGS = -g -Wall -O2
SOURCE = src
.PHONY: default all clean
default: $(TARGET)
all: lib default
OBJECTS = $(patsubst %.c, %.o, $(wildcard $(SOURCE)/*.c))
HEADERS = $(wildcard $(SOURCE)/*.h)
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
.PRECIOUS: $(TARGET) $(OBJECTS)
$(TARGET): $(OBJECTS)
$(CC) $(CFLAGS) $(INCLUDES) -o $@ $(OBJECTS) $(LFLAGS) $(LIBS)
lib:
make -C unicorn-hat/python/rpi-ws281x/lib/ lib
clean:
-rm -f $(SOURCE)/*.o
-rm -f $(TARGET)
make -C unicorn-hat/python/rpi-ws281x/lib/ clean