Remove Kleowrap and Gpgwrap
[gpg4win.git] / src / Makefile.am
1 # Makefile.am - Installer for GnuPG 4 Windows Makefile.
2 # Copyright (C) 2005, 2006, 2007, 2008, 2009 g10 Code GmbH
3 #
4 # This file is part of Gpg4win.
5 #
6 # Gpg4win is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # Gpg4win is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
18
19
20 EXTRA_DIST = pkg-config gpg4win.nsi gpg4win-src.nsi \
21         config.site config.nsi.in \
22         installer-options.ini.in libiconv.def libintl.def loreley.mid \
23         gpg4win-splash.wav exdll.h g4wihelp.c g4wihelp.nsi \
24         inst-sections.nsi installer.nsi installer-finish.nsi  \
25         zlib.pc sha1sum.c mkportable.c     \
26         mkportable-vanilla.h mkportable-light.h mkportable-full.h \
27         potomo Memento.nsh \
28         inst-gpg4win.nsi           uninst-gpg4win.nsi         \
29         inst-atk.nsi               uninst-atk.nsi             \
30         inst-expat.nsi             uninst-expat.nsi           \
31         inst-freetype.nsi          uninst-freetype.nsi        \
32         inst-fontconfig.nsi        uninst-fontconfig.nsi      \
33         inst-cairo.nsi             uninst-cairo.nsi           \
34         inst-gettext.nsi           uninst-gettext.nsi         \
35         inst-libffi.nsi            uninst-libffi.nsi          \
36         inst-glib.nsi              uninst-glib.nsi            \
37         inst-gnupg-w32.nsi         uninst-gnupg-w32.nsi       \
38         inst-gpa.nsi               uninst-gpa.nsi             \
39         inst-gpgme.nsi             uninst-gpgme.nsi           \
40         inst-paperkey.nsi          uninst-paperkey.nsi        \
41         inst-gpgol.nsi             uninst-gpgol.nsi           \
42         inst-gpgex.nsi             uninst-gpgex.nsi           \
43         inst-gdk-pixbuf.nsi        uninst-gdk-pixbuf.nsi      \
44         inst-gtk+.nsi              uninst-gtk+.nsi            \
45         inst-libassuan.nsi         uninst-libassuan.nsi       \
46         inst-libgpg-error.nsi      uninst-libgpg-error.nsi    \
47         inst-libiconv.nsi          uninst-libiconv.nsi        \
48         inst-libpng.nsi            uninst-libpng.nsi          \
49         inst-compendium.nsi        uninst-compendium.nsi   \
50         inst-man_advanced_de.nsi   uninst-man_advanced_de.nsi \
51         inst-man_advanced_en.nsi   uninst-man_advanced_en.nsi \
52         inst-man_novice_de.nsi     uninst-man_novice_de.nsi   \
53         inst-man_novice_en.nsi     uninst-man_novice_en.nsi   \
54         inst-pango.nsi             uninst-pango.nsi           \
55         inst-pinentry.nsi          uninst-pinentry.nsi        \
56         inst-pkgconfig.nsi         uninst-pkgconfig.nsi       \
57         inst-w32pth.nsi            uninst-w32pth.nsi          \
58         inst-zlib.nsi              uninst-zlib.nsi            \
59         inst-qtbase.nsi            uninst-qtbase.nsi              \
60         inst-dbus.nsi              uninst-dbus.nsi      \
61         inst-oxygen-icons.nsi      uninst-oxygen-icons.nsi    \
62         inst-kleopatra.nsi         uninst-kleopatra.nsi       \
63         uninst-claws-mail.nsi uninst-claws-mail-cmds.nsi \
64         inst-final.nsi
65
66 SUBDIRS = dictionaries
67
68 gpg4win_readme_ll = en de ar es fr ru pt
69
70 README_files = $(addsuffix .txt,$(addprefix README.,$(gpg4win_readme_ll)))
71
72 gpg4win_howto_smime_ll = en de
73
74 HOWTO_files = $(addsuffix .txt, \
75                 $(addprefix HOWTO-SMIME.,$(gpg4win_howto_smime_ll)))
76
77 foosum_exe = sha1sum.exe md5sum.exe sha256sum.exe mkportable.exe
78
79 # Need to clean the dll because we bypassed automake.
80 CLEANFILES = g4wihelp.dll versioninfo.txt $(README_files) $(HOWTO_files) \
81              installer-options.ini NEWS.tmp COMPONENTS-list.tmp \
82              license.blurb cdversioninfo.tmp \
83              $(foosum_exe)
84
85 # Supported source packages.
86 gpg4win_spkgs = glib libffi gdk-pixbuf gtk+ \
87                 libgpg-error gpgme gpgol gpgex libpng \
88                 gpa opencdk \
89                 pinentry libassuan \
90                 w32pth paperkey regex libiconv gettext \
91                 qtbase
92
93 # Supported source packages to build in an additional architecture
94 gpg4win_expkgs = libgpg-error libassuan libiconv gettext w32pth gpgex gpgol \
95                  gpgme
96
97 # Extra options to configure for individual packages.
98 # We can use $(idir) here for the installation prefix.
99
100 gpg4win_pkg_libiconv_ex_configure = \
101         --enable-shared=no --enable-static=yes
102
103 gpg4win_pkg_gettext_configure = \
104   --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
105   CPPFLAGS=-I$(idir)/include CFLAGS=-O2 LDFLAGS=-L$(idir)/lib
106
107 gpg4win_pkg_gettext_ex_configure = \
108   --with-lib-prefix=$(ex_idir) --with-libiconv-prefix=$(ex_idir) \
109   CPPFLAGS=-I$(ex_idir)/include CFLAGS=-O2 LDFLAGS=-L$(ex_idir)/lib
110
111 # We only need gettext-runtime and there is sadly no top level
112 # configure option for this
113 gpg4win_pkg_gettext_make_dir = gettext-runtime
114 gpg4win_pkg_gettext_make_dir_inst = gettext-runtime
115 gpg4win_pkg_gettext_ex_make_dir = gettext-runtime
116 gpg4win_pkg_gettext_ex_make_dir_inst = gettext-runtime
117
118 gpg4win_pkg_glib_configure = \
119   --disable-modular-tests \
120   --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
121   CPPFLAGS=-I$(idir)/include LDFLAGS=-L$(idir)/lib CCC=$(host)-g++
122 gpg4win_pkg_glib_extracflags = -march=i486
123
124 gpg4win_pkg_gdk_pixbuf_configure = \
125   --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
126   --with-included-loaders=yes \
127   CPPFLAGS=-I$(idir)/include LDFLAGS=-L$(idir)/lib
128
129 gpg4win_pkg_gtk__configure = \
130   CPPFLAGS=-I$(idir)/include LDFLAGS=-L$(idir)/lib --disable-cups
131
132 # The GnuPG package provides man pages which we have to convert.
133 # We also create the MO files here.
134 define gpg4win_pkg_gnupg2_post_install
135 (for i in gpg2 gpgv2 gpgsm gpg-agent scdaemon gpg-connect-agent gpgconf ; \
136   do man -Tlatin1 -l $$$${pkgidir}/share/man/man1/$$$${i}.1 | \
137     sed `printf "s/_\b//g;s/\b.//g"` | \
138     sed -e 's/$$$$/\r/' > $$$${pkgidir}/share/man/man1/$$$${i}.man ; \
139  done ; \
140  for i in `$(tsdir)/src/potomo --get-linguas $$$${pkgsdir}/po` ; do \
141      $(mkdir_p) $$$${pkgidir}/share/locale/$$$${i}/LC_MESSAGES || true; \
142      rm $$$${pkgidir}/share/locale/$$$${i}/LC_MESSAGES/gnupg2.mo 2>/dev/null \
143        || true; \
144      $(tsdir)/src/potomo $$$${pkgsdir}/po/$$$${i}.po \
145               $$$${pkgidir}/share/locale/$$$${i}/LC_MESSAGES/gnupg2.mo; \
146  done)
147 endef
148
149 # Paperkey comes with a man pages which we have to convert.
150 define gpg4win_pkg_paperkey_post_install
151 (for i in paperkey ; \
152   do man -Tlatin1 -l $$$${pkgidir}/share/man/man1/$$$${i}.1 | \
153     sed `printf "s/_\b//g;s/\b.//g"` | \
154     sed -e 's/$$$$/\r/' > $$$${pkgidir}/share/man/man1/$$$${i}.man ; \
155  done)
156 endef
157
158
159
160 # Build the reference manual.
161 define gpg4win_pkg_gpgol_post_install
162 ( cd $$$${pkgndir}/doc; make pdf )
163 endef
164
165 # We would like to use --with-libiconv-prefix and
166 # --with-libintl-prefix, but these don't work with the cheesy
167 # non-"libfoo.la" versions of iconv and gettext that we are using.
168 #gpg4win_pkg_libgpg_error_configure = \
169 #  --with-libiconv-prefix=$(idir) --with-libintl-prefix=$(idir)
170 gpg4win_pkg_libgpg_error_configure = --silent \
171   CPPFLAGS=-I$(idir)/include LDFLAGS=-L$(idir)/lib \
172   --enable-static
173
174 gpg4win_pkg_libgpg_error_ex_configure = --silent \
175   --enable-static
176
177 # We convert the PO files to UTF-8.  FIXME: This should be done in
178 # libgpg-error proper.
179 define gpg4win_pkg_libgpg_error_post_install
180 (for i in `$(tsdir)/src/potomo --get-linguas $$$${pkgsdir}/po` ; do \
181    rm $$$${pkgidir}/share/locale/$$$${i}/LC_MESSAGES/libgpg-error.mo \
182        2>/dev/null|| true; \
183    $(tsdir)/src/potomo $$$${pkgsdir}/po/$$$${i}.po \
184              $$$${pkgidir}/share/locale/$$$${i}/LC_MESSAGES/libgpg-error.mo; \
185  done)
186 endef
187
188 gpg4win_pkg_libassuan_configure =  --silent --enable-static
189
190 gpg4win_pkg_libassuan_ex_configure =  --silent --enable-static
191
192 gpg4win_pkg_libpng_configure = HAVE_SOLARIS_LD_FALSE=yes CPPFLAGS=\"-I$(idir)/include -DPNG_BUILD_DLL\" LDFLAGS=\"-L$(idir)/lib\" LIBPNG_DEFINES=\"-DPNG_BUILD_DLL\"
193
194 # We would like to use --with-libiconv-prefix and
195 # --with-libintl-prefix, but these don't work with the cheesy
196 # non-"libfoo.la" versions of iconv and gettext that we are using.
197 if BUILD_FULL_INSTALLER
198 pinentry_enable_disable= --enable-pinentry-qt
199 endif
200 gpg4win_pkg_pinentry_configure = \
201   $(pinentry_enable_disable) \
202   --enable-pinentry-gtk2 \
203   CPPFLAGS=-I$(idir)/include LDFLAGS=-L$(idir)/lib
204 #  --with-libiconv-prefix=$(idir) --with-libintl-prefix=$(idir)
205
206 # The LDFLAGS is needed for -lintl for glib.  The QT4 variables work
207 # around the lack of cross compilation support in qt-dev.
208 gpg4win_pkg_gpgme_configure = --silent \
209   --with-gpg-error-prefix=$(idir) --enable-static \
210   `test -n "@HAVE_PKG_GLIB@" && echo "--enable-w32-glib"` \
211   --disable-w32-qt LDFLAGS=-L$(idir)/lib
212
213 gpg4win_pkg_gpgme_ex_configure = --silent \
214   --with-gpg-error-prefix=$(ex_idir) --enable-static \
215   --with-libassuan-prefix=$(ex_idir) \
216   LDFLAGS=-L$(ex_idir)/lib
217
218 gpg4win_pkg_gpa_configure = --silent \
219   --with-libiconv-prefix=$(idir) --with-libintl-prefix=$(idir) \
220   --with-gpgme-prefix=$(idir) --with-zlib=$(idir) \
221   --with-libassuan-prefix=$(idir) --with-gpg-error-prefix=$(idir)
222
223 gpg4win_pkg_gpgol_configure = --silent \
224   --with-gpgme-prefix=$(idir) --with-gpg-error-prefix=$(idir) \
225   --with-libassuan-prefix=$(idir) --enable-mime-send \
226   --enable-gpg4win-3-reg-keys
227
228 gpg4win_pkg_gpgol_ex_configure = --silent \
229   --with-gpgme-prefix=$(ex_idir) --with-gpg-error-prefix=$(ex_idir) \
230   --with-libassuan-prefix=$(ex_idir) --enable-mime-send \
231   --enable-gpg4win-3-reg-keys
232
233 gpg4win_pkg_gpgex_configure = --silent \
234   --with-gpg-error-prefix=$(idir) \
235   --with-libassuan-prefix=$(idir)
236
237 gpg4win_pkg_paperkey_configure = --silent
238
239 gpg4win_pkg_qtbase_configure = -opensource \
240             -confirm-license \
241             -xplatform win32-g++ \
242             -device-option CROSS_COMPILE=$(host)- \
243             -device-option PKG_CONFIG='$(host)-pkg-config' \
244             -force-pkg-config \
245             -no-use-gold-linker \
246             -release \
247             -shared \
248             -prefix $$$${pkgidir} \
249             -I '$(idir)/include' \
250             -L '$(idir)/lib' \
251             -no-icu \
252             -opengl desktop \
253             -no-glib \
254             -accessibility \
255             -nomake examples \
256             -nomake tests \
257             -no-sql-mysql \
258             -no-sql-sqlite \
259             -no-sql-odbc \
260             -no-sql-psql \
261             -no-sql-tds \
262             -qt-zlib \
263             -system-libpng \
264             -qt-libjpeg \
265             -fontconfig \
266             -system-freetype \
267             -qt-pcre \
268             -no-openssl \
269             -no-dbus
270
271 # invoke qmake with removed debug options as a workaround for
272 # https://bugreports.qt-project.org/browse/QTBUG-30898
273 gpg4win_pkg_qtbase_make_args = \
274     QMAKE='$$$${pkgsdir}/bin/qmake CONFIG-="debug debug_and_release"'
275
276 # Qmake still writes debug names in pkgconfig files.
277 define gpg4win_pkg_qtbase_post_install
278  (cd $$$${pkgidir}; \
279  perl -pi -e 's/-lQt5\(\w*\)d/-lQt5\1/g' `find . -name \*.pc`)
280 endef
281
282 # Supported make-only source packages.
283 gpg4win_mpkgs = zlib
284
285 # Extra options for the make invocations for individual packages.
286 # make_flags is used for building, make_args_inst is used for installing.
287 gpg4win_pkg_zlib_make_args = \
288   -fwin32/Makefile.gcc PREFIX=$(host)- IMPLIB=libz.dll.a
289
290 gpg4win_pkg_zlib_make_args_inst = -fwin32/Makefile.gcc install \
291         BINARY_PATH=$$$${pkgidir}/bin INCLUDE_PATH=$$$${pkgidir}/include \
292         LIBRARY_PATH=$$$${pkgidir}/lib SHARED_MODE=1 IMPLIB=libz.dll.a
293
294 # Supported binary packages.
295 gpg4win_bpkgs = pkgconfig pango expat freetype fontconfig \
296                 cairo atk dbus oxygen-icons kleopatra bsfilter gnupg-w32
297
298 # libiconv needs some special magic to generate a usable import
299 # library.
300 # define gpg4win_pkg_libiconv_post_install
301 # (cp $(srcdir)/libiconv.def $$$${pkgidir}/lib;         \
302 # cd $$$${pkgidir}/lib;                                 \
303 # $(DLLTOOL) --output-lib libiconv.dll.a --def libiconv.def)
304 # endef
305
306 # libiconv needs some special magic to generate a usable import
307 # library.  Note that we include some internal symbols that are not
308 # actually part of the DLL.  They are needed by the AM_GNU_GETTEXT
309 # configure test, but not used otherwise.
310 # define gpg4win_pkg_gettext_post_install
311 # (cp $(srcdir)/libintl.def $$$${pkgidir}/lib;          \
312 # cd $$$${pkgidir}/lib;                                 \
313 # $(DLLTOOL) --output-lib libintl.dll.a --def libintl.def)
314 # endef
315
316
317 # Zlib needs some special magic to generate a libtool file.
318 # We also install the pc file here.
319 define gpg4win_pkg_zlib_post_install
320 (mkdir $$$${pkgidir}/lib/pkgconfig || true;             \
321 cp $(abs_srcdir)/zlib.pc $$$${pkgidir}/lib/pkgconfig/;  \
322 cd $$$${pkgidir};                                       \
323 echo "# Generated by libtool" > lib/libz.la             \
324 echo "dlname='../bin/zlib1.dll'" >> lib/libz.la;        \
325 echo "library_names='libz.dll.a'" >> lib/libz.la;       \
326 echo "old_library='libz.a'" >> lib/libz.la;             \
327 echo "dependency_libs=''" >> lib/libz.la;               \
328 echo "current=1" >> lib/libz.la;                        \
329 echo "age=2" >> lib/libz.la;                            \
330 echo "revision=5" >> lib/libz.la;                       \
331 echo "installed=yes" >> lib/libz.la;                    \
332 echo "shouldnotlink=no" >> lib/libz.la;                 \
333 echo "dlopen=''" >> lib/libz.la;                        \
334 echo "dlpreopen=''" >> lib/libz.la;                     \
335 echo "libdir=\"$$$${pkgidir}/lib\"" >> lib/libz.la)
336 endef
337
338 # We need to fix the prefix in the various packages using pkgconfig,
339 # or we can't substitute it properly in our pkg-config wrapper.
340 # glib also installs an empty charset.alias for mingw which creates
341 # a stow conflict with the one from iconv.
342 define gpg4win_pkg_glib_post_install
343  (cd $$$${pkgidir};                                                     \
344  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`; \
345  rm $$$${pkgidir}/lib/charset.alias)
346 endef
347
348 define gpg4win_pkg_libffi_post_install
349  (cd $$$${pkgidir};                                                     \
350  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
351 endef
352
353 define gpg4win_pkg_gdk_pixbuf_post_install
354  (cd $$$${pkgidir};                                                     \
355  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
356 endef
357
358 define gpg4win_pkg_atk_post_install
359  (cd $$$${pkgidir_dev};                                                 \
360  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
361 endef
362
363 define gpg4win_pkg_freetype_post_install
364  (cd $$$${pkgidir_dev};                                                 \
365  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
366 endef
367
368 define gpg4win_pkg_fontconfig_post_install
369  (cd $$$${pkgidir_dev};                                                 \
370  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
371 endef
372
373 define gpg4win_pkg_cairo_post_install
374  (cd $$$${pkgidir_dev};                                                 \
375  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
376 endef
377
378 define gpg4win_pkg_pango_post_install
379  (cd $$$${pkgidir_dev};                                                 \
380  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
381 endef
382
383 define gpg4win_pkg_gtk__post_install
384  (cd $$$${pkgidir_dev};                                                 \
385  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
386 endef
387
388 define gpg4win_pkg_libpng_post_install
389  (cd $$$${pkgidir};                                                     \
390  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
391 endef
392
393
394 # We don't use khelpcenter in kleopatra so remove the help links and
395 # point to the correct common folder
396 define gpg4win_pkg_kleopatra_post_install
397  (for i in de en ; do \
398     (cd $$$${pkgidir}/share/doc/HTML/$$$${i}; \
399      perl -pi -e 's/help:\///g' `find . -name \*.html`; \
400      perl -pi -e 's@common/@../../common/@g' `find . -name \*.html`); \
401  done)
402 endef
403
404
405 #define gpg4win_pkg_libiconv_post_install
406 #(cp $(srcdir)/libiconv.def $$$${pkgidir}/lib;          \
407 #cd $$$${pkgidir}/lib;                                  \
408 #$(DLLTOOL) --output-lib libiconv.dll.a --def libiconv.def)
409 #endef
410
411 # Supported internal packages.  Internal packages do not require any
412 # special support.  Thus, this variable is actually unused, and no
413 # rules are added in gpg4win.mk.
414 gpg4win_ipkgs = man_novice_de man_advanced_de man_novice_en man_advanced_en \
415                 compendium
416
417
418 # Now do the bunch of the work.  This is a bunch of dirty magic to
419 # integrate our special makefile into automake, while not actually
420 # including it (make should include it).  This is in turn necessary
421 # because automake can't deal with the elegant magic in the actual
422 # Makefile.
423
424 define INCLUDE_BY_MAKE
425 include $(1)
426 endef
427
428 $(eval $(call INCLUDE_BY_MAKE,gpg4win.mk))
429
430 clean-local: clean-gpg4win
431
432 common_nsi = inst-sections.nsi installer.nsi installer-finish.nsi       \
433   $(addsuffix .nsi,$(addprefix inst-,$(gpg4win_build_list)))            \
434   $(addsuffix .nsi,$(addprefix uninst-,$(gpg4win_build_list)))
435
436
437 # Prepare the versioninfo file.  The pipeline extracts the last
438 # occurrence of a package with the same name, sorts the entries and
439 # writes the file with DOS line endings.  This helps to avoid
440 # duplicate entries in case one package has been rebuild (which is
441 # common when developing a new version).
442 versioninfo.txt:
443         $(SHA1SUM) $(pkg_files) </dev/null > versioninfo.tmp
444         set -e; \
445         ( while read a b; do echo "$$a $$(basename $$b)"; \
446             done < versioninfo.tmp \
447           | sort -k2 -sf | tac | uniq -f1 ; \
448           echo '=========== SHA-1 checksum ============= == package ==' \
449          ) | tac | awk '{printf "%s\r\n", $$0}' > versioninfo.txt
450         -rm versioninfo.tmp
451
452 NEWS.tmp : $(top_srcdir)/NEWS
453          awk '/^#/ {next} /^\(de\)/ {skip=1;next} /^[^[:space:]]/ {skip=0} \
454              !skip { sub(/^\(en\)/,"   *"); print }' \
455              <$(top_srcdir)/NEWS >NEWS.tmp
456
457 COMPONENTS-list.tmp : $(top_srcdir)/NEWS
458         awk '/^~~~~~~~~~~~/ { ok++; next} ok==1 {print "    "$$0}' \
459             < $(top_srcdir)/NEWS > COMPONENTS-list.tmp
460
461 installer-options.ini : $(top_srcdir)/src/installer-options.ini.in
462         cat $(top_srcdir)/src/installer-options.ini.in >installer-options.ini
463
464
465 # For some nut-crazy reason someone thought it would be a great idea
466 # if makensis changed to the directory of the source file at startup.
467 # So we have to pull a couple of strings to correct this.
468 gpg4win-$(VERSION).exe: gpg4win.nsi $(common_nsi) stamps/stamp-final \
469                         g4wihelp.dll \
470                         $(foosum_exe) \
471                         $(README_files) $(HOWTO_files) \
472                         license.blurb installer-options.ini versioninfo.txt
473         $(MAKENSIS) -V3 -DBUILD_DIR=`pwd` -DTOP_SRCDIR=$(top_srcdir) \
474            -DSRCDIR=$(srcdir) $(EXTRA_MAKENSIS_FLAGS) $(srcdir)/gpg4win.nsi
475
476 gpg4win-light-$(VERSION).exe: gpg4win.nsi $(common_nsi) stamps/stamp-final \
477                         g4wihelp.dll \
478                         $(foosum_exe) \
479                         $(README_files) $(HOWTO_files) \
480                         license.blurb installer-options.ini versioninfo.txt
481         $(MAKENSIS) -V3 -DBUILD_DIR=`pwd` -DTOP_SRCDIR=$(top_srcdir) \
482            -DSRCDIR=$(srcdir) $(EXTRA_MAKENSIS_FLAGS) \
483            -DGPG4WIN_LIGHT=1 $(srcdir)/gpg4win.nsi
484
485 gpg4win-vanilla-$(VERSION).exe: gpg4win.nsi $(common_nsi) stamps/stamp-final \
486                         g4wihelp.dll  \
487                         $(foosum_exe) \
488                         $(README_files) $(HOWTO_files) \
489                         license.blurb installer-options.ini versioninfo.txt
490         $(MAKENSIS) -V3 -DBUILD_DIR=`pwd` -DTOP_SRCDIR=$(top_srcdir) \
491            -DSRCDIR=$(srcdir) $(EXTRA_MAKENSIS_FLAGS) \
492            -DGPG4WIN_VANILLA=1 $(srcdir)/gpg4win.nsi
493
494 gpg4win-$(VERSION).wix: gpg4win.nsi $(common_nsi) stamps/stamp-final \
495                         $(foosum_exe) \
496                         $(README_files) $(HOWTO_files) \
497                         versioninfo.txt
498         perl make-msi.pl --guids $(srcdir)/make-msi.guids \
499                 --manifest gpg4win-$(VERSION).files \
500                 -DBUILD_DIR=. -DTOP_SRCDIR=$(top_srcdir) \
501                 -DSRCDIR=$(srcdir) $(srcdir)/gpg4win.nsi > $@
502
503 gpg4win-light-$(VERSION).wix: gpg4win.nsi $(common_nsi) stamps/stamp-final \
504                         $(foosum_exe) \
505                         $(README_files) $(HOWTO_files) \
506                         versioninfo.txt
507         perl make-msi.pl --guids $(srcdir)/make-msi.guids \
508                 --manifest gpg4win-light-$(VERSION).files \
509                 -DBUILD_DIR=. -DTOP_SRCDIR=$(top_srcdir) \
510                 -DSRCDIR=$(srcdir) -DGPG4WIN_LIGHT=1 $(srcdir)/gpg4win.nsi > $@
511
512 gpg4win-vanilla-$(VERSION).wix: gpg4win.nsi $(common_nsi) stamps/stamp-final \
513                         $(foosum_exe) \
514                         $(README_files) $(HOWTO_files) \
515                         versioninfo.txt
516         perl make-msi.pl --guids $(srcdir)/make-msi.guids \
517                 --manifest gpg4win-vanilla-$(VERSION).files \
518                 -DBUILD_DIR=. -DTOP_SRCDIR=$(top_srcdir) \
519                 -DSRCDIR=$(srcdir) -DGPG4WIN_VANILLA=1 $(srcdir)/gpg4win.nsi > $@
520
521 .PHONY: msi
522 msi: gpg4win-$(VERSION).wix gpg4win-light-$(VERSION).wix \
523      gpg4win-vanilla-$(VERSION).wix
524
525
526 stamps/stamp-dist-self: versioninfo.txt
527         (set -e; cd ..; make dist-bzip2)
528         touch stamps/stamp-dist-self
529
530 gpg4win-src-$(VERSION).exe: gpg4win-src.nsi $(common_nsi) stamps/stamp-final \
531                             stamps/stamp-dist-self installer-options.ini \
532                             license.blurb
533         $(MAKENSIS) -V3 -DBUILD_DIR=`pwd` -DTOP_SRCDIR=$(top_srcdir) \
534           -DSRCDIR=$(srcdir) $(EXTRA_MAKENSIS_FLAGS) $(srcdir)/gpg4win-src.nsi
535
536 license.blurb: $(top_srcdir)/doc/license-page $(top_srcdir)/doc/GPLv3
537         cat $(top_srcdir)/doc/license-page $(top_srcdir)/doc/GPLv3 >$@
538
539 g4wihelp.dll: g4wihelp.c exdll.h
540         $(CC) -I. -shared -O2 -o g4wihelp.dll $(srcdir)/g4wihelp.c \
541            -lwinmm -lgdi32
542         $(STRIP) g4wihelp.dll
543
544 sha1sum.exe: sha1sum.c
545         $(CC) -O2 -o $@ $^
546         $(STRIP) $@
547
548 md5sum.exe: sha1sum.c
549         $(CC) -DBUILD_MD5SUM -O2 -o $@ $^
550         $(STRIP) $@
551
552 sha256sum.exe: sha1sum.c
553         $(CC) -DBUILD_SHA256SUM -O2 -o $@ $^
554         $(STRIP) $@
555
556 mkportable.exe: mkportable.c \
557                 mkportable-vanilla.h mkportable-light.h mkportable-full.h
558         $(CC) -O2 -o $@ $(srcdir)/mkportable.c
559         $(STRIP) $@
560
561 if BUILD_SOURCE_INSTALLER
562 all_src = gpg4win-src-$(VERSION).exe
563 else
564 all_src =
565 endif
566
567 if BUILD_LIGHT_INSTALLER
568 all_light = gpg4win-light-$(VERSION).exe
569 else
570 all_light =
571 endif
572
573 if BUILD_VANILLA_INSTALLER
574 all_vanilla = gpg4win-vanilla-$(VERSION).exe
575 else
576 all_vanilla =
577 endif
578
579 if BUILD_FULL_INSTALLER
580 all_full = gpg4win-$(VERSION).exe
581 else
582 all_full =
583 endif
584
585 all-local: $(all_full) $(all_light) $(all_vanilla) $(all_src)
586
587 clean-local:
588         rm -f gpg4win-$(VERSION).exe gpg4win-light-$(VERSION).exe \
589             gpg4win-vanilla-$(VERSION).exe gpg4win-src-$(VERSION).exe