forked from MuvikLabs/runt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (35 loc) · 991 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.PHONY: default install clean plugin
CFLAGS += -g -Wall -std=c89 -pedantic -I. -fPIC
SPORTH_LIBS = -lsporth -lsoundpipe -lsndfile -lm
LDFLAGS += -ldl -L/usr/local/lib
OBJ += runt.o basic.o irunt.o
CONFIG?=config.mk
include $(CONFIG)
default: irunt librunt.a
ifdef ALIGNED_MALLOC
CFLAGS += -DALIGNED_MALLOC
endif
ifdef RUNT_PLUGINS
CFLAGS +=-DRUNT_PLUGINS
endif
playground: playground.c $(OBJ) plugin.so
$(CC) $(CFLAGS) playground.c $(OBJ) -o $@ $(LDFLAGS)
irunt: main.c $(OBJ)
$(CC) $(CFLAGS) main.c $(OBJ) -o $@ $(LDFLAGS)
librunt.a: $(OBJ)
$(AR) rcs $@ $(OBJ)
plugin: plugin.so
plugin.so: plugin.c
$(CC) plugin.c -shared -fPIC -o $@ librunt.a
%.o: %.c
$(CC) $(CFLAGS) -c $^ -o $@
install: default
mkdir -p $(HOME)/.runt/lib
mkdir -p $(HOME)/.runt/bin
mkdir -p $(HOME)/.runt/include
install irunt $(HOME)/.runt/bin
install librunt.a $(HOME)/.runt/lib
install runt.h $(HOME)/.runt/include
clean:
rm -rf playground runt.o plugin.so irunt librunt.a
rm -rf $(OBJ)