-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathMakefile
69 lines (47 loc) · 1.62 KB
/
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
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
#default: hash stacks func
#default: func
default: sporth
MASTER_MAKEFILE=1
CFLAGS += -O3
ifdef DEBUG_MODE
CFLAGS += -DDEBUG_MODE
endif
UGENS = basic metro tenv fm revsc gen_sine osc gen_vals tseq in port \
nsmp prop noise dcblock butlp buthp maygate randi rpt reverse \
samphold delay switch mode clip p count f gen_sinesum gen_line \
dmetro gbuzz jitter diskin pluck tin
BIN = sporth examples/parse examples/user_function util/jack_wrapper util/val
OBJ += $(addprefix ugens/, $(addsuffix .o, $(UGENS)))
OBJ += func.o plumber.o stack.o parse.o hash.o
%.o: %.c h/ugens.h
gcc $(CFLAGS) -g -c -Ih $< -o $@
ugens/%.o: ugens/%.c
gcc $(CFLAGS) -g -Ih -c $< -o $@
util/jack_wrapper: util/jack_wrapper.c
gcc $< -lsoundpipe -lsndfile -ljack -o jack_wrapper -lm
val: util/val
util/val: util/val.c
gcc $< -o $@
sporth: sporth.c $(OBJ) h/ugens.h
gcc sporth.c $(CFLAGS) -g -Ih -o $@ $(OBJ) -lsoundpipe -lsndfile -lm
libsporth.a: $(OBJ) tmp.h
ar rcs libsporth.a $(OBJ)
tmp.h: $(OBJ)
sh util/header_gen.sh
examples/parse: examples/parse.c libsporth.a h/ugens.h
gcc $< $(CFLAGS) -g -Ih -o $@ libsporth.a -lsoundpipe -lsndfile -lm
examples/user_function: examples/user_function.c libsporth.a h/ugens.h
gcc $< $(CFLAGS) -g -Ih -o $@ libsporth.a -lsoundpipe -lsndfile -lm
include util/luasporth/Makefile
install: libsporth.a sporth tmp.h
install sporth /usr/local/bin
install tmp.h /usr/local/include/sporth.h
install libsporth.a /usr/local/lib
mkdir -p /usr/local/share/sporth
install ugen_reference.txt /usr/local/share/sporth
install util/ugen_lookup /usr/local/bin
clean:
rm -rf $(OBJ)
rm -rf $(BIN)
rm -rf tmp.h
rm -rf libsporth.a