aboutsummaryrefslogtreecommitdiff
path: root/externals/build/darwin/makefile
blob: 9fd75f2cde065fa28e508e70908e689ef838a174 (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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145

prefix=$(DESTDIR)/usr/local/lib/pd

EXTERNALS = $(shell ls )

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

.SUFFIXES: .pd_darwin

#PDEXECUTABLE = /usr/local/bin/pd
PDEXECUTABLE = ../../../pd/bin/pd

MACOSXCFLAGS = -DPD -Os  -DUNIX -DMACOSX -Dunix \
    -Wall -W  \
    -Wno-unused -Wno-parentheses -Wno-switch -Wno-shadow 

MACOSXINCLUDE = -I. -I.. -I../include

MACOSXLINKFLAGS = -bundle  -bundle_loader $(PDEXECUTABLE) 

%.pd_darwin: ../src/%.c
	$(CC) $(MACOSXCFLAGS) $(MACOSXINCLUDE) -o "$*.o" -c "../src/$*.c"
	$(CC) $(MACOSXLINKFLAGS) -o "$*.pd_darwin" "$*.o" -lc -lm \
#	`test -f $*.libs && cat $*.libs`
	chmod a-x "$*.pd_darwin"
	rm -f "$*.o" 

clean:
	-rm *.pd_darwin *~ *.c *.o
	-rm -rf root *.pkg
	-rm link.stamp

install-doc:	
	test -d $(prefix)/doc/5.reference || mkdir -p $(prefix)/doc/5.reference
	install -m444 ../../OSCx/doc/*.pd \
			../../ann/examples/*.* \
			../../aenv~/*.pd \
			../../beatpipe/*.pd \
			../../build/*.pd \
			../../chaos/*.pd \
			../../creb/doc/*.pd \
			../../creb/doc/examples/*.pd \
			../../cxc/reference/*.pd \
			../../dfx/*/*.pd \
			../../ext13/doc/*.pd \
			../../ggee/*/*.pd \
			../../gem2pdp/*.pd \
			../../hcs/*.pd \
			../../markex/*.pd \
			../../maxlib/help/*.* \
			../../motex/*.pd \
			../../pdogg/*/*.pd \
			../../plugin~/*.pd \
			../../rhythm_estimator/*.p? \
			../../susloop~/*.pd \
			../../svf~/*.pd \
			../../vbap/*.pd \
			../../vst/*.pd \
			../../zhzxh~/*.pd \
			$(prefix)/doc/5.reference
# [sprinkler]'s help file is generated by ./configure
	cd ../../sprinkler && autoconf && ./configure
	install -m444 ../../sprinkler/sprinkler-help.pd $(prefix)/doc/5.reference

install-abstractions:
	test -d $(prefix)/extra || mkdir -p $(prefix)/extra
	install -m444 \
			../../vbap/graph-to-aziele.pd \
			$(prefix)/extra

install: install-doc
	test -d $(prefix)/extra || mkdir -p $(prefix)/extra
	install -m644 *.pd_darwin $(prefix)/extra

link: link.stamp

link.stamp:
	cp ../src/*.c .
#	rm vst.c 
# MacOSX exceptions that don't work just yet
	-rm ogg* ossmixer.c plugin~.c cdplayer.c promiscous~.c serialctl.c 
	-rm serial_bird.c serial_ms.c proc.c streamin~.c streamout~.c rhythm_*
	touch link.stamp
	make


EXTERNALS_VERSION = $(shell date +20%y.%m.%d)
PACKAGE_PREFIX = pd-externals
PACKAGE_NAME = $(PACKAGE_PREFIX)-$(EXTERNALS_VERSION)

darwin_pkg_license:
  # generate HTML version of License
	echo "<HTML><BODY><FONT SIZE=\"-1\">" > License.html
	cat ../../creb/COPYING | sed -e 's/^$$/\<P\>/g' >> License.html	
	echo "</FONT></BODY></HTML>" >> License.html

darwin_pkg_welcome:
# generate Welcome.html from ../README.txt

darwin_pkg_clean:
	-sudo rm -Rf installroot/ $(PACKAGE_PREFIX)*.pkg/
	-rm -f $(PACKAGE_PREFIX)-*.info 1 License.html Welcome.???*

# install into MSP's default: /usr/local/lib

darwin_pkg: DESTDIR = installroot
darwin_pkg: prefix = $(DESTDIR)/pd
darwin_pkg: all install darwin_pkg_license darwin_pkg_welcome
# set up installroot dir
#  test -d installroot/pd/doc/5.reference/ || mkdir -p installroot/pd/doc/5.reference/
#	test -d installroot/pd/extra || mkdir -p installroot/pd/extra
#	install -m644 --group=staff *.pd_darwin installroot/pd/extra
	cp -f pd-externals.info $(PACKAGE_NAME).info
# delete cruft
	-find installroot -name .DS_Store -delete
	-sudo rm -Rf installroot/*/*/CVS installroot/*/*/*/CVS installroot/*/*/*/*/CVS 
	-rm -f 1
# set proper permissions
	sudo chown -R root:staff installroot
	package installroot $(PACKAGE_NAME).info -d . -ignoreDSStore
# install pkg docs
	install -m 644 License.html $(PACKAGE_NAME).pkg/Contents/Resources
	sudo chown -R root:staff $(PACKAGE_NAME).pkg/Contents/Resources


# install into MacOS X style path: /Library/Pd

darwin_altpkg: all darwin_pkg_clean darwin_pkg_license darwin_pkg_welcome
	test -d installroot/Help || mkdir -p installroot/Help
	cp -r ../doc/* installroot/Help
	test -d installroot/Externals || mkdir -p installroot/Externals
	install -m644 --group=staff *.pd_darwin installroot/Externals
	sed -e 's/\/usr\/local\/lib/\/Library\/Pd/' pd-externals.info \
		 | sed -e 's/MSP standard paths/MacOS X-style Paths/' \
		 > $(PACKAGE_NAME)-alt.info
 # delete cruft
	-sudo find installroot -name .DS_Store -delete
	-sudo rm -Rf installroot/*/*/CVS installroot/*/*/*/CVS installroot/*/*/*/*/CVS 
	-rm -f 1
 # set proper permissions
	sudo chown -R root:staff installroot
	package installroot $(PACKAGE_NAME)-alt.info -d . -ignoreDSStore
 # install pkg docs
	install -m 644 License.html $(PACKAGE_NAME)-alt.pkg/Contents/Resources
	sudo chown -R root:staff $(PACKAGE_NAME)-alt.pkg/Contents/Resources