forked from lampeh/libflipdot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (28 loc) · 930 Bytes
/
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
CPPFLAGS=-I.
CFLAGS=-g -O3 -flto -Wall -std=gnu99 -pedantic -funroll-loops -fno-common -ffunction-sections
LDFLAGS=-flto -Wl,--relax,--gc-sections -L . -lflipdot -lbcm2835
LIB=libflipdot.a
LIB_SOURCES=flipdot.c
LIB_OBJECTS=$(LIB_SOURCES:.c=.o)
LIB_DEP=$(LIB_SOURCES:.c=.dep)
LIB_CFLAGS=$(CFLAGS) -DNOSLEEP -DGPIO_MULTI
LIB_CPPFLAGS=$(CPPFLAGS)
SOURCES=$(wildcard examples/*.c)
OBJECTS=$(SOURCES:.c=.o)
DEP=$(SOURCES:.c=.dep)
EXECUTABLES=$(SOURCES:.c=)
all: $(LIB) $(EXECUTABLES)
clean:
-rm $(LIB) $(LIB_OBJECTS) $(LIB_DEP) $(EXECUTABLES) $(OBJECTS) $(DEP)
$(LIB): $(LIB_OBJECTS)
$(AR) rcs $@ $^
$(EXECUTABLES): % : %.o $(LIB)
$(CC) -o $@ $< $(LDFLAGS)
examples/flipspect_record: % : %.o $(LIB)
#$(CC) -o $@ $< $(LDFLAGS) -lasound -lfftw3 -lm
$(LIB_OBJECTS): %.o : %.c
$(CC) $(LIB_CFLAGS) $(LIB_CPPFLAGS) -c -o $@ $<
%.dep: %.c
$(CC) $(CPPFLAGS) -MM -MT $(<:.c=.o) -MP -MF $@ $<
-include $(DEP)
-include $(LIB_DEP)