-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
92 lines (67 loc) · 3.49 KB
/
Makefile
File metadata and controls
92 lines (67 loc) · 3.49 KB
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
# @region:erosion_pd.utils Utilities
CC = gcc
CFLAGS = -Wall -O2
PD_INCLUDE = /usr/local/include/pd
# Determine OS and set extension
UNAME := $(shell uname -s)
ifeq ($(UNAME),Linux)
EXT = pd_linux
CFLAGS += -fPIC
LDFLAGS = -shared -lm
endif
ifeq ($(UNAME),Darwin)
EXT = pd_darwin
LDFLAGS = -dynamiclib -undefined dynamic_lookup
PD_INCLUDE = /Applications/Pd-0.53-2.app/Contents/Resources/src
endif
TARGET = ligase~.$(EXT)
SOURCES = src/ligase~.c src/envelope.c src/grain.c src/grain_delay.c src/grain_delay_stut.c src/grain_delay_bencina.c src/grain_distortion.c src/grain_moogladder.c src/grain_fog.c src/kiss_fft.c src/kiss_fftr.c src/reel.c src/splice.c src/perlin.c src/sphere.c
OBJECTS = $(SOURCES:.c=.o)
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) -o $@ $(OBJECTS)
%.o: %.c
$(CC) $(CFLAGS) -I$(PD_INCLUDE) -c $< -o $@
clean:
rm -f $(OBJECTS) $(TARGET) erosion_query_test.o erosion_query_test.$(EXT)
install: $(TARGET)
mkdir -p ~/Documents/Pd/externals
cp $(TARGET) ~/Documents/Pd/externals/
cp ligase~-help.pd ~/Documents/Pd/externals/
# Test random sources
test_random_sources: test_random_sources.c src/grain.o src/perlin.o src/envelope.o src/grain_distortion.o src/grain_delay.o
$(CC) $(CFLAGS) -o test_random_sources test_random_sources.c src/grain.o src/perlin.o src/envelope.o src/grain_distortion.o src/grain_delay.o -lm
test_random: test_random_sources
./test_random_sources
# Test pitch scale mode
test_pitch_scale: test_pitch_scale.c src/grain.o src/perlin.o src/envelope.o src/grain_distortion.o src/grain_delay.o
$(CC) $(CFLAGS) -o test_pitch_scale test_pitch_scale.c src/grain.o src/perlin.o src/envelope.o src/grain_distortion.o src/grain_delay.o -lm
test_pitch: test_pitch_scale
./test_pitch_scale
# Test tanh distortion with all noise sources
test_distortion: test_distortion.c src/grain.o src/perlin.o src/envelope.o src/grain_distortion.o src/grain_delay.o src/reel.o src/splice.o
$(CC) $(CFLAGS) -o test_distortion test_distortion.c src/grain.o src/perlin.o src/envelope.o src/grain_distortion.o src/grain_delay.o src/reel.o src/splice.o -lm
test_dist: test_distortion
./test_distortion
# Test splice markers (Morphagene compatibility test)
test_splice_markers.o: test_splice_markers.c src/types.h
$(CC) $(CFLAGS) -I$(PD_INCLUDE) -c test_splice_markers.c -o test_splice_markers.o
test_splice_markers~.$(EXT): test_splice_markers.o src/reel.o src/splice.o src/envelope.o src/grain.o src/grain_delay.o src/grain_distortion.o src/perlin.o
$(CC) $(LDFLAGS) -o test_splice_markers~.$(EXT) test_splice_markers.o src/reel.o src/splice.o src/envelope.o src/grain.o src/grain_delay.o src/grain_distortion.o src/perlin.o
test_splice: test_splice_markers~.$(EXT)
@echo "Test external built. Create a Pd patch to test it."
# Test query system
erosion_query_test.o: erosion_query_test.c
$(CC) $(CFLAGS) -I$(PD_INCLUDE) -c erosion_query_test.c -o erosion_query_test.o
erosion_query_test.$(EXT): erosion_query_test.o
$(CC) $(LDFLAGS) -o erosion_query_test.$(EXT) erosion_query_test.o
test_query: erosion_query_test.$(EXT)
@echo "Query test external built: erosion_query_test.$(EXT)"
@echo "Open test_query_system.pd to run tests"
# Test fog bypass/passthrough (FFT->IFFT roundtrip)
test_fog_build: test_fog.c src/grain_fog.o src/kiss_fft.o src/kiss_fftr.o
$(CC) $(CFLAGS) -o test_fog test_fog.c src/grain_fog.o src/kiss_fft.o src/kiss_fftr.o -lm
test_fog: test_fog_build
./test_fog
.PHONY: all clean install test_random test_pitch test_dist test_splice test_query test_fog
# @endregion:erosion_pd.utils