aboutsummaryrefslogtreecommitdiff
path: root/pluginhost~/makefile
blob: b95b51d1732b3a14a7db77f94d4c64d2492b704c (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
NAME=pluginhost~
CSYM=pluginhost~

LIBDIR=/usr/local/lib
PDDIR=$(LIBDIR)/pd
INSTALLPATH=$(PDDIR)/extra/
ARCHITECTURE=i386
DEBUG=0

current: pd_linux


# ----------------------- Linux -----------------------

pd_linux: src/$(NAME).pd_linux

.SUFFIXES: .pd_linux

#LINUXCFLAGS = -DPD -O3 -fPIC -funroll-loops -fomit-frame-pointer \
    -Wall -W -Wshadow -Wstrict-prototypes -Werror \
    -Wno-unused -Wno-parentheses -Wno-switch

# Debug
LINUXCFLAGS = -ggdb -g -DPD -O0 -fPIC -funroll-loops -fomit-frame-pointer \
    -Wall -W -Wshadow -Wstrict-prototypes -Werror \
    -Wno-unused -Wno-parentheses -Wno-switch -DDEBUG=$(DEBUG)

LINUXINCLUDE =  -I/usr/include -I./include

.c.pd_linux:
	$(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/jsearch.c
	$(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/jload.c
	$(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -c src/pluginhost~.c
	gcc --export-dynamic  -shared -o $(NAME).pd_linux pluginhost~.o jload.o jsearch.o -lc -lm -llo
#	strip --strip-unneeded $(NAME).pd_linux
	cp $(NAME).pd_linux ~/pd-externals/
	rm -f *.o

# ----------------------- Mac OSX -----------------------

pd_darwin: src/$(NAME).pd_darwin

.SUFFIXES: .pd_darwin

DARWINCFLAGS = -DPD -arch $(ARCHITECTURE) -O3 -Wall -W -Wshadow -Wstrict-prototypes \
    -Wno-unused -Wno-parentheses -Wno-switch -L/usr/local/lib/ -DDEBUG=$(DEBUG)

DARWININCLUDE = -I ./ -I ../src -I/usr/local/include/ -I ./include -I/usr/local/include/pluginhost/

.c.pd_darwin:
	$(CC) $(DARWINCFLAGS) $(DARWININCLUDE) -c src/jsearch.c
	$(CC) $(DARWINCFLAGS) $(DARWININCLUDE) -c src/jload.c
	$(CC) $(DARWINCFLAGS) $(DARWININCLUDE) -c src/pluginhost~.c
	$(CC) -arch $(ARCHITECTURE) -bundle -undefined suppress -flat_namespace -llo -o $(NAME).pd_darwin pluginhost~.o jload.o jsearch.o 
	rm -f *.o

# ----------------------- Generic -----------------------

clean:
	rm -f *.o *.pd_* so_locations

install:
	cp pluginhost~.pd_* $(INSTALLPATH)
	install -d  $(PDDIR)/doc/5.reference/pluginhost/
	install -m 644 doc/*-help* $(PDDIR)/doc/5.reference/
	install -m 644 doc/output~.pd $(PDDIR)/doc/5.reference/pluginhost/