aboutsummaryrefslogtreecommitdiff
path: root/creb.mk
blob: f2085cdb8b4b14c2971b8e72db62867911f5ed99 (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/usr/bin/make -f

# Faster alternative makefile, for development only.
SRC_C:= \
./modules/dwt.c \
./modules/scrollgrid1D~.c \
./modules/diag~.c \
./modules/statwav~.c \
./modules/xfm~.c \
./modules/junction~.c \
./modules/permut~.c \
./modules/dynwav~.c \
./modules/dist~.c \
./modules/setup.c \
./modules/qmult~.c \
./modules/ffpoly.c \
./modules/sawtooth~.c \
./modules/sbosc~.c \
./modules/ratio.c \
./modules/bitsplit~.c \
./modules/fdn~.c \
./modules/eblosc~.c \
./modules/bwin~.c \
./modules/fwarp.c \
./modules/cmath.c \
./modules/cheby~.c \
./modules/blocknorm~.c \
./modules/bdiag~.c \
./modules/ramp~.c \
./modules/tabreadmix~.c \
./modules/ead~.c \
./modules/matrix~.c \
./modules/abs~.c \
./modules/lattice~.c \
./modules/resofilt~.c \
./modules/ear~.c \
./modules/qnorm~.c \
./modules/eadsr~.c \
./modules/bfft~.c \

SRC_CC := \
./modules++/blosc~.cc \
./modules++/biquadseries~.cc \
./modules++/filterortho~.cc \


GCC_CFLAGS := -funroll-loops
CC := gcc $(GCC_CFLAGS)
CPLUSPLUS := g++ $(GCC_CFLAGS)
# CC := clang
# CPLUSPLUS := clang++


CFLAGS := -DPD -DCREB_VERSION=\"0.9.2\" -fPIC -O3 -fomit-frame-pointer -Wall -W -Wno-unused -Wno-parentheses -Wno-switch
BUILD := build
ARCH := pd_linux
LDFLAGS := -rdynamic -shared
OUT := $(BUILD)/creb.$(ARCH)

O := \
	$(patsubst %.c,$(BUILD)/%.o,$(SRC_C)) \
	$(patsubst %.cc,$(BUILD)/%.o,$(SRC_CC))
D := $(O:.o=.d)


.SECONDARY:
.DELETE_ON_ERROR:

.PHONY: all
all: $(OUT)

.PHONY: clean
clean:
	rm -rf build

$(BUILD)/%.d: %.c
	@echo [d] $(notdir $@)
	@mkdir -p $(dir $@)
	@$(CC) -MT $(basename $@).o -MM $(CFLAGS) $< >$@

$(BUILD)/%.d: %.cc
	@echo [d] $(notdir $@)
	@mkdir -p $(dir $@)
	@$(CPLUSPLUS) -MT $(basename $@).o -MM $(CFLAGS) $< >$@

$(BUILD)/%.o: %.c $(BUILD)/%.d
	@echo [o] $(notdir $@)
	@mkdir -p $(dir $@)
	@$(CC) $(CFLAGS) -c $< -o $@

$(BUILD)/%.o: %.cc $(BUILD)/%.d
	@echo [o] $(notdir $@)
	@mkdir -p $(dir $@)
	@$(CPLUSPLUS) $(CFLAGS) -c $< -o $@

$(OUT): $(O)
	@echo [pd_linux] $(notdir $@)
	@$(CPLUSPLUS) $(LDFLAGS) -o $@ $(O) $(LIBS)

-include $(D)