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