aboutsummaryrefslogtreecommitdiff
path: root/externals/build/linux/makefile
blob: 4c3ea9b6688771330f394e6ffc60f37cacb55836 (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

prefix=$(DESTDIR)/usr

EXTERNALS = $(shell ls )

all: link.stamp $(EXTERNALS:.c=.pd_linux)

.SUFFIXES: .pd_linux

LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer \
    -Wall -W -Wshadow -Wstrict-prototypes  \
    -Wno-unused -Wno-parentheses -Wno-switch

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

%.pd_linux: ../src/%.c
	$(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o "$*.o" -c "../src/$*.c"
	ld -export_dynamic  -shared -o "$*.pd_linux" "$*.o" -lc -lm `cat $*.libs`
	chmod a-x "$*.pd_linux"
#	strip --strip-unneeded $*.pd_linux
	rm -f "$*.o" 

clean:
	-rm *.pd_linux *~ *.c
	-rm link.stamp

install-doc:
	@test -d $(prefix)/lib/pd/doc/5.reference || mkdir -p $(prefix)/lib/pd/doc/5.reference
	cp -r ../doc/* $(prefix)/lib/pd/doc/5.reference

install: install-doc
	@test -d $(prefix)/lib/pd/extra || mkdir -p $(prefix)/lib/pd/extra
	install -m644 *.pd_linux $(prefix)/lib/pd/extra


link: link.stamp

link.stamp:
	cp ../src/*.c .
	rm vst.c
	touch link.stamp
	make