aboutsummaryrefslogtreecommitdiff
path: root/packages/win32_inno/Makefile
blob: 4bc89a2732e5475f3d5b6ad6ed4689086b23bef4 (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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
#
# This is a grand unifying Makefile for compiling Pd-extended under MinGW
#
all: install

export CC = gcc
CWD := $(shell pwd)

DESTDIR = $(CWD)/build
cvs_root_dir := $(shell cd $(CWD)/../.. && pwd)
BUILDLAYOUT_DIR = $(cvs_root_dir)/packages


include $(BUILDLAYOUT_DIR)/Makefile.buildlayout

# to control whether the debug symbols are kept
#STRIP = strip --strip-unneeded -R .note -R .comment
STRIP = echo

DEBUG_CFLAGS = -g -fno-inline-functions -fno-omit-frame-pointer -DDEBUG_SOUNDFILE -Wstrict-aliasing=2
OPT_CFLAGS = -O2

# compile for pentium4 so we can use SSE2
OPT_CFLAGS += -march=pentium4 -msse2 -mfpmath=sse
OPT_CFLAGS += -ftree-vectorize -ftree-vectorizer-verbose=1

OPT_CFLAGS += $(DEBUG_CFLAGS)

# these are sent to all of the various Makefiles so that they all copy their
# output to the same directory tree
DEST_PATHS = BUILDLAYOUT_DIR=$(BUILDLAYOUT_DIR) \
				cvs_root_dir=$(cvs_root_dir) \
				DESTDIR=$(DESTDIR) \
				prefix=$(prefix) \
				OPT_CFLAGS="$(OPT_CFLAGS)" \
				UNAME=$(UNAME) \
				STRIP="$(STRIP)"

PD_INNO_SETUP = pd-inno.iss

package: installer zip

installer:  $(PD_INNO_SETUP)
## this pops up the GUI app
#	start $(PD_INNO_SETUP)
## this compiles the package on the command line
	"$(PROGRAMFILES)/Inno Setup 5/ISCC.exe" "$(PD_INNO_SETUP)"

zipfolder = $(packages_src)/win32_inno/zip
zippackage = Pd-$(PD_VERSION)
zippackagefolder = $(zipfolder)/$(zippackage)
zip:
# this fake installs the above into a folder to be zipped up
	install -d "$(zipfolder)"
	cp "$(packages_src)/win32_inno/Output/Pd-$(PD_VERSION).exe" "$(zipfolder)"
# test the inno exe
	innounp -v -t -b -y zip/$(zippackage).exe -d"$(zipfolder)"
# extract the inno exe
	innounp -v -x -b -y zip/$(zippackage).exe -d"$(zipfolder)"
	cd "$(zipfolder)" && \
		mv \{app\} $(zippackagefolder) && \
		mv \{fonts\} $(zippackagefolder)/fonts && \
		install -p \{sys\}/*.dll $(zippackagefolder)/bin/ && \
		install -p \{sys\}/*.exe $(zippackagefolder)/bin/ && \
		zip -9r --no-wild "$(zippackage).zip" "$(zippackage)"
	@echo " "
	@echo "win32_inno install succeeded!"

$(pd_src)/asio/ASIOSDK2: $(HOME)/asiosdk2.2.zip
	unzip $(HOME)/asiosdk2.2.zip -d $(pd_src)/asio/

build_pd: $(pd_src)/asio/ASIOSDK2
	$(MAKE) -C $(pd_src)/src -f makefile.mingw MORECFLAGS="-O2 -g -fno-tree-vectorize -fno-strict-aliasing"

# use autoconf setup to install the translation files
pd_po_msg_install:
	cd $(pd_src) && ./autogen.sh && ./configure
	make -C $(pd_src)/po $(DEST_PATHS) libpdpodir=$(libpddir)/po install

PD_NAME=Pd
pd_install: build_pd pd_po_msg_install
# the autoconf/MinGW setup doesn't compile the extras yet
#	$(MAKE) -C $(pd_src)/src $(DEST_PATHS) bin
#	-$(MAKE) -C $(pd_src)/src $(DEST_PATHS) install
	$(MAKE) -C $(pd_src)/src -f makefile.mingw $(DEST_PATHS) install
# make the Pd headers available in the standard locations
	install -d $(DESTDIR)/include/pd
	install -p $(DESTDIR)/include/pdextended/*.h $(DESTDIR)/include/pd
# install notes.txt into the help browser
	install -d $(DESTDIR)$(manualsdir)/$(PD_NAME)
	install -p $(pd_src)/src/notes.txt $(DESTDIR)$(manualsdir)/$(PD_NAME)

install: pd_install prebuilt_install lib_install exe_install
	@echo " "
	@echo "win32_inno install succeeded!"


prebuilt_install:
	$(MAKE) -C $(packages_src) $(DEST_PATHS) extended_install
	$(MAKE) -C $(packages_src) $(DEST_PATHS) doc_format
	install -p pd-settings.reg $(DESTDIR)$(prefix)/bin
	install -p pd-extended.bat $(DESTDIR)$(prefix)


#==============================================================================#
#
## setup Pd binaries
#
#==============================================================================#

bin_src = /usr/local/bin
system32 = /c/WINDOWS/system32
lib_install:
# ultimately, the DLLs should be installed in %SystemRoot%\system32 by
# InnoSetup since they are 'officially' named and versioned DLLs, and can be
# shared between apps
	install -d $(DESTDIR)$(prefix)/
	install -p \
		$(bin_src)/libbz2-2.dll \
		$(bin_src)/libcurl-4.dll \
		$(bin_src)/libdca-0.dll \
		$(bin_src)/libdl.dll \
		$(bin_src)/libfftw3-3.dll \
		$(bin_src)/libfftw3f-3.dll \
		$(bin_src)/libfreetype-6.dll \
		$(bin_src)/libgavl-1.dll \
		$(bin_src)/libgcc_s_dw2-1.dll \
		$(bin_src)/libgnurx-0.dll \
		$(bin_src)/libjpeg.dll \
		$(bin_src)/libmp3lame-0.dll \
		$(bin_src)/libogg-0.dll \
		$(bin_src)/libopenjpeg-2.dll \
		$(bin_src)/libpng-3.dll \
		$(bin_src)/libpng12-0.dll \
		$(bin_src)/libsndfile-1.dll \
		$(bin_src)/libstdc++-6.dll \
		$(bin_src)/libtheora-0.dll \
		$(bin_src)/libtheoradec-1.dll \
		$(bin_src)/libtheoraenc-1.dll \
		$(bin_src)/libtiff-3.dll \
		$(bin_src)/libtiffxx-3.dll \
		$(bin_src)/libvorbis-0.dll \
		$(bin_src)/libvorbisenc-2.dll \
		$(bin_src)/libvorbisfile-3.dll \
		$(bin_src)/libx264-116.dll \
		$(bin_src)/libz-1.dll \
		$(bin_src)/lua51.dll \
		$(bin_src)/pthreadGC2.dll \
		$(bin_src)/xvidcore.dll \
		$(DESTDIR)$(prefix)/
# very old pthread lib from pd-vanilla
	install -d $(DESTDIR)$(bindir)
	install -p pthreadVC.dll $(DESTDIR)$(bindir)
# these stay with pd.exe
	install -p \
		$(bin_src)/tcl85.dll \
		$(bin_src)/tclpip85.dll \
		$(bin_src)/tk85.dll \
		$(DESTDIR)$(bindir)
# if these are installed, include them in the build root
	-install -p $(system32)/msvcp71.dll   $(DESTDIR)$(bindir)
	-install -p $(system32)/msvcr71.dll   $(DESTDIR)$(bindir)
# these go into the Pd package's lib dir
	install -d $(DESTDIR)$(libdir)/
	rsync -axv --cvs-exclude \
		/usr/local/lib/tcl8 \
		/usr/local/lib/tcl8.5 \
		/usr/local/lib/tk8.5 \
		/usr/local/lib/dde1.3 \
		/usr/local/lib/reg1.2 \
		/usr/local/lib/tkdnd2.6 \
		/usr/local/lib/tcllib1.13 \
		$(DESTDIR)$(libdir)/


# tcllib install
# tcllib is an old standard lib for Tcl written in Tcl, it includes things we
# need, like base64, so include it in the package on all platforms
tcllib_install:
	install -d $(DESTDIR)$(libdir)
	cp -a /usr/local/lib/tcllib1.13 $(DESTDIR)$(libdir)/tcllib1.13

exe_install:
	install -d $(DESTDIR)$(bindir)
	install -p $(bin_src)/wish85.exe  $(DESTDIR)$(bindir)
	install -p $(bin_src)/tclsh85.exe  $(DESTDIR)$(bindir)


$(PD_INNO_SETUP): $(PD_INNO_SETUP).in
	@echo "Making Inno Setup file: $(PD_INNO_SETUP)"
	cat "$(PD_INNO_SETUP).in" | \
		sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/g' | \
		sed 's/PD_VERSION/$(PD_VERSION)/g' | \
		sed 's/PD-EXTENDED_VERSION/$(PD-EXTENDED_VERSION)/g' > \
		$(PD_INNO_SETUP)
#	start $(PD_INNO_SETUP)


#==============================================================================#
#
## CLEAN TARGETS
#
#==============================================================================#

distclean: package_clean
	$(MAKE) -C $(packages_src) $(DEST_PATHS) distclean


package_clean: 	
	-rm $(PD_INNO_SETUP)
	-rm -rf $(DESTDIR)
	-rm -rf Output


clean: package_clean
	$(MAKE) -C $(packages_src) $(DEST_PATHS) clean

#==============================================================================#
#
## TEST TARGETS
#
#==============================================================================#

test_package:
	echo "No tests here yet"


test_locations:
	@echo --------------------------------------------------
	@echo "PD_VERSION: $(PD_VERSION)"
	@echo "PD-EXTENDED_VERSION: $(PD-EXTENDED_VERSION)"
	@echo "CWD $(CWD)"
	@echo "DESTDIR $(DESTDIR)"
	@echo "PREFIX $(prefix)"
	@echo "BINDIR  $(bindir)"
	@echo "LIBDIR  $(libdir)"
	@echo "OBJECTSDIR  $(objectsdir)"
	@echo "PDDOCDIR  $(pddocdir)"
	@echo "LIBPDDIR  $(libpddir)"
	@echo "LIBPDBINDIR  $(libpdbindir)"
	@echo "HELPDIR  $(helpdir)"
	@echo "MANUALSDIR  $(manualsdir)"
	@echo "EXAMPLESDIR  $(examplesdir)"
	@echo --------------------------------------------------
	autoconf --version
	@echo --------------------------------------------------
	make --version
	@echo --------------------------------------------------
	gcc --version


.PHONY: all install package clean distclean test_locations test_package exe_install