packetizer: hxxx: fix DirectTV extraction
[vlc.git] / extras / package / win32 / package.mak
blobb42c53341d5fafec1f1bfa7b5868bfcb59a1252a
1 if HAVE_WIN32
2 BUILT_SOURCES_distclean += \
3 extras/package/win32/NSIS/vlc.win32.nsi extras/package/win32/NSIS/spad.nsi
4 endif
6 win32_destdir=$(abs_top_builddir)/vlc-$(VERSION)
7 win32_debugdir=$(abs_top_builddir)/symbols-$(VERSION)
8 win32_xpi_destdir=$(abs_top_builddir)/vlc-plugin-$(VERSION)
10 7Z_OPTS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on
13 if HAVE_WIN32
14 include extras/package/npapi.am
16 build-npapi: package-win-install
17 endif
19 if HAVE_WIN64
20 WINVERSION=vlc-$(VERSION)-win64
21 else
22 WINVERSION=vlc-$(VERSION)-win32
23 endif
25 package-win-install:
26 $(MAKE) install
27 touch $@
29 package-win-common: package-win-install
30 mkdir -p "$(win32_destdir)"/
32 # Executables, major libs
33 find $(prefix) -maxdepth 4 \( -name "*$(LIBEXT)" -o -name "*$(EXEEXT)" \) -exec cp {} "$(win32_destdir)/" \;
35 # Text files, clean them from mail addresses
36 for file in AUTHORS THANKS ; \
37 do sed 's/@/_AT_/' < "$(srcdir)/$$file" > "$(win32_destdir)/$${file}.txt"; \
38 done
39 for file in NEWS COPYING README; \
40 do cp "$(srcdir)/$$file" "$(win32_destdir)/$${file}.txt"; \
41 done
43 cp $(srcdir)/share/icons/vlc.ico $(win32_destdir)
44 mkdir -p "$(win32_destdir)"/plugins
45 (cd $(prefix)/lib/vlc/plugins/ && find . -type f \( -not -name '*.la' -and -not -name '*.a' \) -exec cp -v --parents "{}" "$(win32_destdir)/plugins/" \;)
46 -cp -r $(prefix)/share/locale $(win32_destdir)
48 # BD-J JAR
49 -cp $(CONTRIB_DIR)/share/java/*.jar $(win32_destdir)/plugins/access/
51 if BUILD_LUA
52 mkdir -p $(win32_destdir)/lua/
53 cp -r $(prefix)/share/vlc/lua/* $(win32_destdir)/lua/
54 endif
56 if BUILD_SKINS
57 rm -fr $(win32_destdir)/skins
58 cp -r $(prefix)/share/vlc/skins2 $(win32_destdir)/skins
59 endif
61 # HRTF
62 cp -r $(srcdir)/share/hrtfs $(win32_destdir)/
64 # SDK
65 mkdir -p "$(win32_destdir)/sdk/lib/"
66 cp -r $(prefix)/include "$(win32_destdir)/sdk"
67 cp -r $(prefix)/lib/pkgconfig "$(win32_destdir)/sdk/lib"
68 cd $(prefix)/lib && cp -rv libvlc.la libvlccore.la "$(win32_destdir)/sdk/lib/"
69 cd $(prefix)/lib && cp -rv libvlc.dll.a "$(win32_destdir)/sdk/lib/libvlc.lib"
70 cd $(prefix)/lib && cp -rv libvlccore.dll.a "$(win32_destdir)/sdk/lib/libvlccore.lib"
71 $(DLLTOOL) -D libvlc.dll -l "$(win32_destdir)/sdk/lib/libvlc.lib" -d "$(top_builddir)/lib/.libs/libvlc.dll.def" "$(prefix)/bin/libvlc.dll"
72 echo "INPUT(libvlc.lib)" > "$(win32_destdir)/sdk/lib/vlc.lib"
73 $(DLLTOOL) -D libvlccore.dll -l "$(win32_destdir)/sdk/lib/libvlccore.lib" -d "$(top_builddir)/src/.libs/libvlccore.dll.def" "$(prefix)/bin/libvlccore.dll"
74 echo "INPUT(libvlccore.lib)" > "$(win32_destdir)/sdk/lib/vlccore.lib"
76 # Convert to DOS line endings
77 find $(win32_destdir) -type f \( -name "*xml" -or -name "*html" -or -name '*js' -or -name '*css' -or -name '*hosts' -or -iname '*txt' -or -name '*.cfg' -or -name '*.lua' \) -exec $(U2D) -q {} \;
79 package-win-npapi: build-npapi
80 cp "$(top_builddir)/npapi-vlc/installed/lib/axvlc.dll" "$(win32_destdir)/"
81 cp "$(top_builddir)/npapi-vlc/installed/lib/npvlc.dll" "$(win32_destdir)/"
82 mkdir -p "$(win32_destdir)/sdk/activex/"
83 cd $(top_builddir)/npapi-vlc && cp activex/README.TXT share/test/test.html $(win32_destdir)/sdk/activex/
85 package-win-strip: package-win-common package-win-npapi
86 mkdir -p "$(win32_debugdir)"/
87 cd $(win32_destdir); find . -type f \( -name '*$(LIBEXT)' -or -name '*$(EXEEXT)' \) | while read i; \
88 do if test -n "$$i" ; then \
89 $(OBJCOPY) --only-keep-debug "$$i" "$(win32_debugdir)/`basename $$i.dbg`"; \
90 $(OBJCOPY) --strip-all "$$i" ; \
91 $(OBJCOPY) --add-gnu-debuglink="$(win32_debugdir)/`basename $$i.dbg`" "$$i" ; \
92 fi ; \
93 done
94 if test -n "$(SIGNATURE)"; then \
95 cd $(win32_destdir); find . -type f \( -name '*$(LIBEXT)' -or -name '*$(EXEEXT)' \) | while read i; \
96 do if test -n "$$i" ; then \
97 osslsigncode sign -certs $(SIGNATURE)/cert.cer -key $(SIGNATURE)/videolan.key -n "VLC media player" -i http://www.videolan.org/ -t http://timestamp.verisign.com/scripts/timstamp.dll -h sha1 -in "$$i" -out "$$i.sign"; \
98 mv "$$i.sign" "$$i" ; \
99 osslsigncode sign -certs $(SIGNATURE)/cert.cer -key $(SIGNATURE)/videolan.key -n "VLC media player" -i http://www.videolan.org/ -t http://timestamp.verisign.com/scripts/timstamp.dll -nest -h sha2 -in "$$i" -out "$$i.sign"; \
100 mv "$$i.sign" "$$i" ; \
101 fi ; \
102 done \
106 package-win32-webplugin-common: package-win-strip
107 mkdir -p "$(win32_xpi_destdir)/plugins/"
108 cp -r $(win32_destdir)/plugins/ "$(win32_xpi_destdir)/plugins/"
109 cp "$(win32_destdir)/libvlc.dll" "$(win32_destdir)/libvlccore.dll" "$(win32_destdir)/npvlc.dll" "$(win32_xpi_destdir)/plugins/"
110 rm -rf "$(win32_xpi_destdir)/plugins/plugins/gui/"
113 package-win32-xpi: package-win32-webplugin-common
114 cp $(top_builddir)/npapi-vlc/npapi/package/install.rdf "$(win32_xpi_destdir)/"
115 cd $(win32_xpi_destdir) && zip -r -9 "../$(WINVERSION).xpi" install.rdf plugins
118 package-win32-crx: package-win32-webplugin-common
119 cp $(top_builddir)/npapi-vlc/npapi/package/manifest.json "$(win32_xpi_destdir)/"
120 crxmake --pack-extension "$(win32_xpi_destdir)" \
121 --extension-output "$(win32_destdir)/$(WINVERSION).crx" --ignore-file install.rdf
124 # nsis is a 32-bits installer, we need to build a 32bits DLL
125 $(win32_destdir)/NSIS/UAC.dll: extras/package/win32/NSIS/UAC/runas.cpp extras/package/win32/NSIS/UAC/uac.cpp
126 mkdir -p "$(win32_destdir)/NSIS/"
127 if HAVE_WIN64
128 i686-w64-mingw32-g++ $^ -shared -o $@ -lole32 -static-libstdc++ -static-libgcc
129 i686-w64-mingw32-strip $@
130 else
131 $(CXX) $^ -D_WIN32_IE=0x0601 -D__forceinline=inline -shared -o $@ -lole32 -static-libstdc++ -static-libgcc
132 $(STRIP) $@
133 endif
134 $(win32_destdir)/NSIS/nsProcess.dll: extras/package/win32/NSIS/nsProcess/nsProcess.c extras/package/win32/NSIS/nsProcess/pluginapi.c
135 mkdir -p "$(win32_destdir)/NSIS/"
136 if HAVE_WIN64
137 i686-w64-mingw32-gcc $^ -shared -o $@ -lole32 -static-libgcc
138 i686-w64-mingw32-strip $@
139 else
140 $(CC) $^ -D_WIN32_IE=0x0601 -shared -o $@ -lole32 -static-libgcc
141 $(STRIP) $@
142 endif
145 package-win32-exe: package-win-strip $(win32_destdir)/NSIS/UAC.dll $(win32_destdir)/NSIS/nsProcess.dll extras/package/win32/NSIS/vlc.win32.nsi
146 # Script installer
147 cp $(top_builddir)/extras/package/win32/NSIS/vlc.win32.nsi "$(win32_destdir)/"
148 cp $(top_builddir)/extras/package/win32/NSIS/spad.nsi "$(win32_destdir)/"
149 cp -r $(srcdir)/extras/package/win32/NSIS/languages "$(win32_destdir)/"
150 cp -r $(srcdir)/extras/package/win32/NSIS/helpers "$(win32_destdir)/"
151 mkdir -p "$(win32_destdir)/NSIS/"
152 cp "$(top_srcdir)/extras/package/win32/NSIS/UAC.nsh" "$(win32_destdir)/NSIS/"
153 cp "$(top_srcdir)/extras/package/win32/NSIS/nsProcess.nsh" "$(win32_destdir)/NSIS/"
155 # Create package
156 if makensis -VERSION >/dev/null 2>&1; then \
157 MAKENSIS="makensis"; \
158 elif [ -x "/cygdrive/c/Program Files/NSIS/makensis" ]; then \
159 MAKENSIS="/cygdrive/c/Program\ Files/NSIS/makensis"; \
160 elif [ -x "$(PROGRAMFILES)/NSIS/makensis" ]; then \
161 MAKENSIS="$(PROGRAMFILES)/NSIS/makensis"; \
162 elif wine --version >/dev/null 2>&1; then \
163 MAKENSIS="wine C:/Program\ Files/NSIS/makensis.exe"; \
164 else \
165 echo 'Error: cannot locate makensis tool'; exit 1; \
166 fi; \
167 eval "$$MAKENSIS $(win32_destdir)/spad.nsi"; \
168 eval "$$MAKENSIS $(win32_destdir)/vlc.win32.nsi"
169 if test -n "$(SIGNATURE)"; then \
170 osslsigncode sign -certs $(SIGNATURE)/cert.cer -key $(SIGNATURE)/videolan.key -n "VLC media player" -i http://www.videolan.org/ -t http://timestamp.verisign.com/scripts/timstamp.dll -h sha1 -in "$(WINVERSION).exe" -out "$(WINVERSION).exe.sign"; \
171 mv "$(WINVERSION).exe.sign" "$(WINVERSION).exe" ; \
172 osslsigncode sign -certs $(SIGNATURE)/cert.cer -key $(SIGNATURE)/videolan.key -n "VLC media player" -i http://www.videolan.org/ -t http://timestamp.verisign.com/scripts/timstamp.dll -nest -h sha2 -in "$(WINVERSION).exe" -out "$(WINVERSION).exe.sign"; \
173 mv "$(WINVERSION).exe.sign" "$(WINVERSION).exe" ; \
176 package-win32-zip: package-win-strip
177 rm -f -- $(WINVERSION).zip
178 zip -r -9 $(WINVERSION).zip vlc-$(VERSION) --exclude \*.nsi \*NSIS\* \*languages\* \*sdk\* \*helpers\* spad\*
180 package-win32-debug-zip: package-win-common
181 rm -f -- $(WINVERSION)-debug.zip
182 zip -r -9 $(WINVERSION)-debug.zip vlc-$(VERSION)
184 package-win32-7zip: package-win-strip
185 7z a $(7Z_OPTS) $(WINVERSION).7z vlc-$(VERSION)
187 package-win32-debug-7zip: package-win-common
188 7z a $(7Z_OPTS) $(WINVERSION)-debug.7z vlc-$(VERSION)
190 package-win32-cleanup:
191 rm -Rf $(win32_destdir) $(win32_debugdir) $(win32_xpi_destdir)
193 package-win32: package-win32-zip package-win32-7zip package-win32-exe package-win32-xpi
195 package-win32-debug: package-win32-debug-zip package-win32-debug-7zip
198 #######
199 # WinCE
200 #######
201 package-wince: package-win-strip
202 rm -f -- vlc-$(VERSION)-wince.zip
203 zip -r -9 vlc-$(VERSION)-wince.zip vlc-$(VERSION)
205 .PHONY: package-win-install package-win-common package-win-strip package-win32-webplugin-common package-win32-xpi package-win32-crx package-win32-exe package-win32-zip package-win32-debug-zip package-win32-7zip package-win32-debug-7zip package-win32-cleanup package-win32 package-win32-debug package-wince
207 EXTRA_DIST += \
208 extras/package/win32/vlc.exe.manifest \
209 extras/package/win32/libvlc.dll.manifest \
210 extras/package/win32/configure.sh \
211 extras/package/win32/NSIS/vlc.win32.nsi.in \
212 extras/package/win32/NSIS/spad.nsi.in \
213 extras/package/win32/NSIS/UAC/examples \
214 extras/package/win32/NSIS/UAC/examples/UAC_AllowLUA.nsi \
215 extras/package/win32/NSIS/UAC/examples/UAC_AdminOnly.nsi \
216 extras/package/win32/NSIS/UAC/examples/UAC_Uninstaller.nsi \
217 extras/package/win32/NSIS/UAC/examples/UAC.nsh \
218 extras/package/win32/NSIS/UAC/examples/UAC_GetUserShellFolderPath.nsi \
219 extras/package/win32/NSIS/UAC/examples/UAC_RealWorldFullyLoadedDualModeExample.nsi \
220 extras/package/win32/NSIS/UAC/History.txt \
221 extras/package/win32/NSIS/UAC/License.txt \
222 extras/package/win32/NSIS/UAC/nsisutil.h \
223 extras/package/win32/NSIS/UAC/resource.h \
224 extras/package/win32/NSIS/UAC/resource.rc \
225 extras/package/win32/NSIS/UAC/runas.cpp \
226 extras/package/win32/NSIS/UAC/uac.cpp \
227 extras/package/win32/NSIS/UAC/uac.h \
228 extras/package/win32/NSIS/UAC/Readme.html \
229 extras/package/win32/NSIS/UAC.nsh \
230 extras/package/win32/NSIS/languages/declaration.nsh \
231 extras/package/win32/NSIS/languages/bengali.nsh \
232 extras/package/win32/NSIS/languages/basque.nsh \
233 extras/package/win32/NSIS/languages/brazilian_portuguese.nsh \
234 extras/package/win32/NSIS/languages/bulgarian.nsh \
235 extras/package/win32/NSIS/languages/catalan.nsh \
236 extras/package/win32/NSIS/languages/danish.nsh \
237 extras/package/win32/NSIS/languages/dutch.nsh \
238 extras/package/win32/NSIS/languages/english.nsh \
239 extras/package/win32/NSIS/languages/estonian.nsh \
240 extras/package/win32/NSIS/languages/finnish.nsh \
241 extras/package/win32/NSIS/languages/french.nsh \
242 extras/package/win32/NSIS/languages/galician.nsh \
243 extras/package/win32/NSIS/languages/german.nsh \
244 extras/package/win32/NSIS/languages/hebrew.nsh \
245 extras/package/win32/NSIS/languages/hungarian.nsh \
246 extras/package/win32/NSIS/languages/italian.nsh \
247 extras/package/win32/NSIS/languages/japanese.nsh \
248 extras/package/win32/NSIS/languages/lithuanian.nsh \
249 extras/package/win32/NSIS/languages/occitan.nsh \
250 extras/package/win32/NSIS/languages/polish.nsh \
251 extras/package/win32/NSIS/languages/punjabi.nsh \
252 extras/package/win32/NSIS/languages/russian.nsh \
253 extras/package/win32/NSIS/languages/romanian.nsh \
254 extras/package/win32/NSIS/languages/schinese.nsh \
255 extras/package/win32/NSIS/languages/slovak.nsh \
256 extras/package/win32/NSIS/languages/slovenian.nsh \
257 extras/package/win32/NSIS/languages/sorani.nsh \
258 extras/package/win32/NSIS/languages/spanish.nsh \
259 extras/package/win32/NSIS/languages/swedish.nsh