2008-09-30 Colin Leroy <colin@colino.net>
[gpg4win.git] / src / Makefile.am
1 # Makefile.am - Installer for GnuPG 4 Windows Makefile.
2 # Copyright (C) 2005, 2006, 2007, 2008 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 config.site \
21         installer-options.ini.in libiconv.def libintl.def loreley.mid \
22         gpg4win-splash.wav gpgwrap.c exdll.h g4wihelp.c g4wihelp.nsi \
23         inst-sections.nsi installer.nsi installer-finish.nsi  \
24         qt.conf kleowrap.c potomo Memento.nsh dirmngr.conf    \
25         inst-gpg4win.nsi           uninst-gpg4win.nsi         \
26         inst-atk.nsi               uninst-atk.nsi             \
27         inst-cairo.nsi             uninst-cairo.nsi           \
28         inst-libgsasl.nsi          uninst-libgsasl.nsi        \
29         inst-libtasn1.nsi          uninst-libtasn1.nsi        \
30         inst-opencdk.nsi           uninst-opencdk.nsi         \
31         inst-gnutls.nsi            uninst-gnutls.nsi          \
32         inst-curl.nsi              uninst-curl.nsi            \
33         inst-libxml2.nsi           uninst-libxml2.nsi         \
34         inst-libetpan.nsi          uninst-libetpan.nsi        \
35         inst-claws-mail.nsi        uninst-claws-mail.nsi      \
36         inst-notification_plugin.nsi       uninst-notification_plugin.nsi      \
37         inst-gtkhtml2_viewer.nsi   uninst-gtkhtml2_viewer.nsi      \
38         inst-vcalendar.nsi         uninst-vcalendar.nsi      \
39         inst-rssyl.nsi             uninst-rssyl.nsi      \
40         inst-tnef_parse.nsi        uninst-tnef_parse.nsi      \
41         inst-crypt.nsi             uninst-crypt.nsi           \
42         inst-dirmngr.nsi           uninst-dirmngr.nsi         \
43         inst-eudoragpg.nsi         uninst-eudoragpg.nsi       \
44         inst-gettext.nsi           uninst-gettext.nsi         \
45         inst-glib.nsi              uninst-glib.nsi            \
46         inst-gnupg2.nsi            uninst-gnupg2.nsi          \
47         inst-gpa.nsi               uninst-gpa.nsi             \
48         inst-gpgee.nsi             uninst-gpgee.nsi           \
49         inst-gpgme.nsi             uninst-gpgme.nsi           \
50         inst-scute.nsi             uninst-scute.nsi           \
51         inst-gpgol.nsi             uninst-gpgol.nsi           \
52         inst-gpgex.nsi             uninst-gpgex.nsi           \
53         inst-gtk+.nsi              uninst-gtk+.nsi            \
54         inst-jpeg.nsi              uninst-jpeg.nsi            \
55         inst-libassuan.nsi         uninst-libassuan.nsi       \
56         inst-libgcrypt.nsi         uninst-libgcrypt.nsi       \
57         inst-libgpg-error.nsi      uninst-libgpg-error.nsi    \
58         inst-libiconv.nsi          uninst-libiconv.nsi        \
59         inst-libksba.nsi           uninst-libksba.nsi         \
60         inst-adns.nsi              uninst-adns.nsi            \
61         inst-libpng.nsi            uninst-libpng.nsi          \
62         inst-compendium_de.nsi     uninst-compendium_de.nsi   \
63         inst-man_advanced_de.nsi   uninst-man_advanced_de.nsi \
64         inst-man_advanced_en.nsi   uninst-man_advanced_en.nsi \
65         inst-man_novice_de.nsi     uninst-man_novice_de.nsi   \
66         inst-man_novice_en.nsi     uninst-man_novice_en.nsi   \
67         inst-pango.nsi             uninst-pango.nsi           \
68         inst-pinentry.nsi          uninst-pinentry.nsi        \
69         inst-pkgconfig.nsi         uninst-pkgconfig.nsi       \
70         inst-pthreads-w32.nsi      uninst-pthreads-w32.nsi    \
71         inst-regex.nsi             uninst-regex.nsi           \
72         inst-w32pth.nsi            uninst-w32pth.nsi          \
73         inst-winpt.nsi             uninst-winpt.nsi           \
74         inst-zlib.nsi              uninst-zlib.nsi            \
75         inst-qt.nsi                uninst-qt.nsi              \
76         inst-kdesupport.nsi        uninst-kdesupport.nsi      \
77         inst-oxygen-icons.nsi      uninst-oxygen-icons.nsi    \
78         inst-kdelibs.nsi           uninst-kdelibs.nsi         \
79         inst-kleopatra.nsi         uninst-kleopatra.nsi       \
80         inst-bzip2.nsi             uninst-bzip2.nsi           \
81         inst-final.nsi
82
83 # Need to clean the dll because we bypassed automake.
84 CLEANFILES = g4wihelp.dll versioninfo.txt README.en.txt README.de.txt \
85              installer-options.ini NEWS.tmp \
86              gpgwrap.exe gpgwrap-2.exe kleowrap.exe
87
88 # Supported source packages.
89 gpg4win_spkgs = glib libgpg-error gpgme gpgol gpgex \
90                 gpa winpt libgsasl libtasn1 opencdk gnutls curl libxml2 \
91                 libetpan claws-mail notification_plugin gtkhtml2_viewer \
92                 vcalendar rssyl gnupg2 pinentry libassuan libksba libgcrypt \
93                 adns dirmngr w32pth scute tnef_parse
94
95 # Extra options to configure for individual packages.
96 # We can use $(idir) here for the installation prefix.
97
98 gpg4win_pkg_glib_configure = \
99   --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
100   CPPFLAGS=-I$(idir)/include LDFLAGS=-L$(idir)/lib
101
102 # The GnuPG package provides man pages which we have to convert.
103 # We also create the MO files here.
104 define gpg4win_pkg_gnupg2_post_install
105 (for i in gpg2 gpgv2 gpgsm gpg-agent scdaemon gpg-connect-agent gpgconf ; \
106   do man -Tlatin1 -l $$$${pkgidir}/share/man/man1/$$$${i}.1 | \
107     sed `printf "s/_\b//g;s/\b.//g"` | \
108     sed -e 's/$$$$/\r/' > $$$${pkgidir}/share/man/man1/$$$${i}.man ; \
109  done ; \
110  for i in `$(tsdir)/src/potomo --get-linguas $$$${pkgsdir}/po` ; do \
111      $(tsdir)/src/potomo $$$${pkgsdir}/po/$$$${i}.po \
112                       $$$${pkgidir}/share/gnupg/$$$${i}.mo ; \
113  done)
114 endef
115
116
117
118 # Build the reference manual.
119 define gpg4win_pkg_gpgol_post_install
120 ( cd $$$${pkgndir}/doc; make pdf )
121 endef
122
123 # We would like to use --with-libiconv-prefix and
124 # --with-libintl-prefix, but these don't work with the cheesy
125 # non-"libfoo.la" versions of iconv and gettext that we are using.
126 #gpg4win_pkg_libgpg_error_configure = \
127 #  --with-libiconv-prefix=$(idir) --with-libintl-prefix=$(idir)
128 gpg4win_pkg_libgpg_error_configure = --silent \
129   CPPFLAGS=-I$(idir)/include LDFLAGS=-L$(idir)/lib
130
131 gpg4win_pkg_libassuan_configure =  --silent \
132   --disable-shared \
133   --with-pth-prefix=$(idir)
134
135 gpg4win_pkg_libksba_configure = --silent \
136   --with-gpg-error-prefix=$(idir)
137
138 gpg4win_pkg_libgcrypt_configure = --silent \
139   --with-gpg-error-prefix=$(idir)
140
141 gpg4win_pkg_adns_configure = --silent
142
143 gpg4win_pkg_dirmngr_configure = \
144   --with-gpg-error-prefix=$(idir) \
145   --with-ksba-prefix=$(idir) \
146   --with-libgcrypt-prefix=$(idir) \
147   --with-libassuan-prefix=$(idir) \
148   --with-pth-prefix=$(idir)
149
150 gpg4win_pkg_gnupg2_configure = \
151   --with-gpg-error-prefix=$(idir) \
152   --with-ksba-prefix=$(idir) \
153   --with-libgcrypt-prefix=$(idir) \
154   --with-libassuan-prefix=$(idir) \
155   --with-zlib=$(idir) \
156   --with-bzip2=$(idir) \
157   --with-pth-prefix=$(idir) \
158   --with-adns=$(idir) \
159   --without-included-gettext \
160   --disable-regex
161
162 # We would like to use --with-libiconv-prefix and
163 # --with-libintl-prefix, but these don't work with the cheesy
164 # non-"libfoo.la" versions of iconv and gettext that we are using.
165 gpg4win_pkg_pinentry_configure = \
166   --disable-pinentry-gtk \
167   --enable-pinentry-gtk2 \
168   --with-glib-prefix=$(idir) --with-gtk-prefix=$(idir) \
169   --disable-pinentry-qt \
170   CPPFLAGS=-I$(idir)/include LDFLAGS=-L$(idir)/lib
171 #  --with-libiconv-prefix=$(idir) --with-libintl-prefix=$(idir)
172
173 # The LDFLAGS is needed for -lintl for glib.  The QT4 variables work
174 # around the lack of cross compilation support in qt-dev.
175 gpg4win_pkg_gpgme_configure = --silent \
176   --with-gpg-error-prefix=$(idir) --enable-static \
177   `test -n "@HAVE_PKG_GLIB@" && echo "--enable-w32-glib"` \
178   `test -n "@HAVE_PKG_QT@" && echo "--enable-w32-qt"` \
179   LDFLAGS=-L$(idir)/lib \
180   QT4_CORE_CFLAGS=\"-DQT_LARGEFILE_SUPPORT -DQT_DLL \
181                    -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_THREAD_SUPPORT \
182                    -I$(idir)/include/QtCore -I$(idir)/include \
183                    -I$(idir)/mkspecs/win32-g++\" \
184   QT4_CORE_LIBS=\"-L$(idir)/lib -lQtCore4\"
185
186 gpg4win_pkg_gpa_configure = --silent \
187   --with-libiconv-prefix=$(idir) --with-libintl-prefix=$(idir) \
188   --with-gpgme-prefix=$(idir) --with-zlib=$(idir) \
189   --with-libassuan-prefix=$(idir) --with-gpg-error-prefix=$(idir)
190
191 gpg4win_pkg_gpgol_configure = --silent \
192   --with-gpgme-prefix=$(idir) --with-gpg-error-prefix=$(idir) \
193   --with-libassuan-prefix=$(idir)
194
195 gpg4win_pkg_gpgex_configure = --silent \
196   --with-gpg-error-prefix=$(idir) \
197   --with-libassuan-prefix=$(idir)
198
199 gpg4win_pkg_winpt_configure = --silent \
200   --with-gpgme-prefix=$(idir) --with-gpg-error-prefix=$(idir)
201
202 gpg4win_pkg_gnutls_configure = \
203   --disable-cxx
204
205 gpg4win_pkg_curl_configure = \
206   --with-gnutls --without-ca-bundle
207
208 gpg4win_pkg_libxml2_configure = \
209   --enable-shared --without-python
210
211 # The CFLAGS are needed to find pthread-w32.
212 gpg4win_pkg_libetpan_configure = --with-gnutls \
213   CPPFLAGS=\"-I$(idir)/include\" LIBS=\"-L$(idir)/lib\"
214
215 # --disable-aspell can be removed from svn917 on and later.
216 gpg4win_pkg_claws_mail_configure = \
217   --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
218   --with-gpg-error-prefix=$(idir) --with-gpgme-prefix=$(idir) \
219   --with-config-dir="Claws-mail" --enable-pthread --enable-gnutls \
220   --enable-libetpan --disable-aspell --disable-enchant \
221   --disable-trayicon-plugin --disable-dbus \
222   --disable-openssl --disable-dillo-viewer-plugin --disable-gnomeprint \
223   --disable-jpilot --disable-startup-notification --disable-ipv6 \
224   --disable-mathml-viewer-plugin --disable-clamav-plugin \
225   --disable-spamassassin-plugin --disable-bogofilter-plugin \
226   --disable-valgrind --disable-networkmanager-support
227
228 gpg4win_pkg_notification_plugin_configure = \
229   --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
230   --disable-libnotify --disable-lcdproc
231
232 gpg4win_pkg_gtkhtml2_viewer_configure = \
233   --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) LIBS=\"-L$(idir)/bin\"
234
235 gpg4win_pkg_vcalendar_configure = \
236   --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) LIBS=\"-L$(idir)/bin\"
237
238 gpg4win_pkg_rssyl_configure = \
239   --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) LIBS=\"-L$(idir)/bin\"
240
241 gpg4win_pkg_tnef_parse_configure = \
242   --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) LIBS=\"-L$(idir)/bin\"
243
244 gpg4win_pkg_scute_configure = --silent \
245   --with-gpgme-prefix=$(idir) --with-libassuan-prefix=$(idir)
246
247 # Supported make-only source packages.
248 gpg4win_mpkgs = pthreads-w32 bzip2
249
250 # Extra options for the make invocations for individual packages.
251 # make_flags is used fur building, make_args_inst is used for installing.
252 gpg4win_pkg_pthreads_w32_make_args = \
253   prefix=$(idir) CROSS=$(host_alias)- clean GC-inlined
254
255 gpg4win_pkg_pthreads_w32_make_args_inst = \
256   prefix=$$$${pkgidir} CROSS=$(host_alias)- 
257
258 gpg4win_pkg_bzip2_make_args = \
259   CC=$(CC) AR=$(AR) RANLIB=$(RANLIB)
260
261 gpg4win_pkg_bzip2_make_args_inst = \
262   PREFIX=$$$${pkgidir} CC=$(CC) AR=$(AR) RANLIB=$(RANLIB)
263
264
265 # Supported binary packages.
266 gpg4win_bpkgs = libiconv gettext pkgconfig zlib libpng jpeg pango cairo \
267                 atk gtk+ gpgee crypt regex qt kdesupport oxygen-icons kdelibs \
268                 kleopatra
269
270 # libiconv needs some special magic to generate a usable import
271 # library.
272 define gpg4win_pkg_libiconv_post_install
273 (cp $(srcdir)/libiconv.def $$$${pkgidir}/lib;           \
274 cd $$$${pkgidir}/lib;                                   \
275 $(DLLTOOL) --output-lib libiconv.dll.a --def libiconv.def)
276 endef
277
278 # libiconv needs some special magic to generate a usable import
279 # library.  Note that we include some internal symbols that are not
280 # actually part of the DLL.  They are needed by the AM_GNU_GETTEXT
281 # configure test, but not used otherwise.
282 define gpg4win_pkg_gettext_post_install
283 (cp $(srcdir)/libintl.def $$$${pkgidir}/lib;            \
284 cd $$$${pkgidir}/lib;                                   \
285 $(DLLTOOL) --output-lib libintl.dll.a --def libintl.def)
286 endef
287
288
289 # Zlib needs some special magic to generate a libtool file.
290 define gpg4win_pkg_zlib_post_install
291 (cd $$$${pkgidir_dev};                                  \
292 echo "dlname='../bin/zlib1.dll'" > lib/libz.la; \
293 echo "library_names='libz.dll.a'" >> lib/libz.la;       \
294 echo "old_library='libz.a'" >> lib/libz.la;             \
295 echo "dependency_libs=''" >> lib/libz.la;               \
296 echo "current=1" >> lib/libz.la;                        \
297 echo "age=2" >> lib/libz.la;                            \
298 echo "revision=3" >> lib/libz.la;                       \
299 echo "installed=yes" >> lib/libz.la;                    \
300 echo "shouldnotlink=no" >> lib/libz.la;                 \
301 echo "dlopen=''" >> lib/libz.la;                        \
302 echo "dlpreopen=''" >> lib/libz.la;                     \
303 echo "libdir=\"$$$${pkgidir}/lib\"" >> lib/libz.la;)
304 endef
305
306 # To make shure that we link against the static versions we need
307 # remove the import libs from crypt
308 define gpg4win_pkg_crypt_post_install
309 (cd $$$${pkgidir}/lib && rm libcrypt.dll.a libcrypt.lib)
310 endef
311
312 # To make shure that we link against the static versions we need
313 # remove the import libs from regex
314 # FIXME: We need to shared version or libtool refuses to build the
315 # claws plugin.
316 #define gpg4win_pkg_regex_post_install
317 #(cd $$$${pkgidir}/lib && rm libregex.dll.a libregex.lib)
318 #endef
319
320 # We need to fix the prefix in the various packages using pkgconfig,
321 # or we can't substitute it properly in our pkg-config wrapper.
322 define gpg4win_pkg_glib_post_install
323  (cd $$$${pkgidir};                                                     \
324  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
325 endef
326
327 define gpg4win_pkg_atk_post_install
328  (cd $$$${pkgidir_dev};                                                 \
329  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
330 endef
331
332 define gpg4win_pkg_cairo_post_install
333  (cd $$$${pkgidir_dev};                                                 \
334  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
335 endef
336
337 define gpg4win_pkg_pango_post_install
338  (cd $$$${pkgidir_dev};                                                 \
339  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
340 endef
341
342 define gpg4win_pkg_gtk__post_install
343  (cd $$$${pkgidir_dev};                                                 \
344  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
345 endef
346
347 # In libpng, the pkg-config files are surprisingly found in the
348 # runtime package.
349 define gpg4win_pkg_libpng_post_install
350  (cd $$$${pkgidir};                                                     \
351  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
352 endef
353
354
355 define gpg4win_pkg_libiconv_post_install
356 (cp $(srcdir)/libiconv.def $$$${pkgidir}/lib;           \
357 cd $$$${pkgidir}/lib;                                   \
358 $(DLLTOOL) --output-lib libiconv.dll.a --def libiconv.def)
359 endef
360
361
362 # kdesupport ships gettext, which we already have.  Remove a stow
363 # conflict about that.  Also remove a stow conflict with kdelibs-lib.
364 define gpg4win_pkg_kdesupport_post_install
365 (rm -fR "$$$${pkgidir_dev}/share/locale"; \
366  rm -fR "$$$${pkgidir_dev}/share/apps/cmake/modules")
367 endef
368
369 # libxml2 ships some binaries, which we already have from kdesupport.  Remove a stow
370 # conflict about that. 
371 define gpg4win_pkg_libxml2_post_install
372 (rm -f "$$$${pkgidir}/bin/xmllint.exe"; \
373  rm -f "$$$${pkgidir}/bin/xmlcatalog.exe")
374 endef
375
376 # Supported internal packages.  Internal packages do not require any
377 # special support.  Thus, this variable is actually unused, and no
378 # rules are added in gpg4win.mk.
379 gpg4win_ipkgs = man_novice_de man_advanced_de man_novice_en man_advanced_en \
380                 compendium_de
381
382
383 # Now do the bunch of the work.  This is a bunch of dirty magic to
384 # integrate our special makefile into automake, while not actually
385 # including it (make should include it).  This is in turn necessary
386 # because automake can't deal with the elegant magic in the actual
387 # Makefile.
388
389 define INCLUDE_BY_MAKE
390 include $(1)
391 endef
392
393 $(eval $(call INCLUDE_BY_MAKE,gpg4win.mk))
394
395 clean-local: clean-gpg4win
396
397 common_nsi = inst-sections.nsi installer.nsi installer-finish.nsi       \
398   $(addsuffix .nsi,$(addprefix inst-,$(gpg4win_build_list)))            \
399   $(addsuffix .nsi,$(addprefix uninst-,$(gpg4win_build_list)))
400
401
402 # Prepare the versioninfo file.  The pipeline extracts the last
403 # occurrence of a package with the same name, sorts the entries and
404 # writes the file with DOS line endings.  This helps to avoid
405 # duplicate entries in case one package has been rebuild (which is
406 # common when developing a new version).
407 versioninfo.txt : playground/build/versioninfo.txt
408         set -e; \
409         ( while read a b; do echo "$$a $$(basename $$b)"; \
410             done < playground/build/versioninfo.txt \
411           | sort -k2 -sf | tac | uniq -f1 ; \
412           echo '=========== SHA-1 checksum ============= == package ==' \
413          ) | tac | awk '{printf "%s\r\n", $$0}' > versioninfo.txt
414
415 NEWS.tmp : $(top_srcdir)/NEWS
416         sed -e '/^#/d' <$(top_srcdir)/NEWS >NEWS.tmp
417
418 README.en.txt : versioninfo.txt NEWS.tmp $(top_srcdir)/doc/README.en.txt
419         sed -e '/^;.*/d;/!VERSIONINFO!/{r versioninfo.txt' -e 'd;}' \
420         -e '/!NEWSFILE!/{r NEWS.tmp' -e 'd;}' \
421         -e '/!PKG-COPYRIGHT!/{r $(top_srcdir)/doc/pkg-copyright.txt' -e 'd;}' \
422         -e 's,!VERSION!,$(VERSION),g' \
423            < $(top_srcdir)/doc/README.en.txt \
424            | awk '{printf "%s\r\n", $$0}' >README.en.txt
425
426 installer-options.ini : $(top_srcdir)/src/installer-options.ini.in
427         cat $(top_srcdir)/src/installer-options.ini.in >installer-options.ini
428
429 README.de.txt : versioninfo.txt NEWS.tmp $(top_srcdir)/doc/README.de.txt
430         sed -e '/^;.*/d;/!VERSIONINFO!/{r versioninfo.txt' -e 'd;}' \
431         -e '/!NEWSFILE!/{r NEWS.tmp' -e 'd;}' \
432         -e '/!PKG-COPYRIGHT!/{r $(top_srcdir)/doc/pkg-copyright.txt' -e 'd;}' \
433         -e 's,!VERSION!,$(VERSION),g' \
434            < $(top_srcdir)/doc/README.de.txt \
435            | awk '{printf "%s\r\n", $$0}' >README.de.txt
436
437 # For some nut-crazy reason someone thought it would be a great idea
438 # if makensis changed to the directory of the source file at startup.
439 # So we have to pull a couple of strings to correct this.
440 gpg4win-$(VERSION).exe: gpg4win.nsi $(common_nsi) stamps/stamp-final \
441                         g4wihelp.dll gpgwrap.exe gpgwrap-2.exe kleowrap.exe \
442                         README.en.txt \
443                         README.de.txt installer-options.ini versioninfo.txt
444         $(MAKENSIS) -V3 -DBUILD_DIR=`pwd` -DTOP_SRCDIR=$(top_srcdir) \
445                 -DSRCDIR=$(srcdir) $(srcdir)/gpg4win.nsi
446
447 gpg4win-light-$(VERSION).exe: gpg4win.nsi $(common_nsi) stamps/stamp-final \
448                         g4wihelp.dll gpgwrap.exe gpgwrap-2.exe kleowrap.exe \
449                         README.en.txt \
450                         README.de.txt installer-options.ini versioninfo.txt
451         $(MAKENSIS) -V3 -DBUILD_DIR=`pwd` -DTOP_SRCDIR=$(top_srcdir) \
452                 -DSRCDIR=$(srcdir) -DGPG4WIN_LIGHT=1 $(srcdir)/gpg4win.nsi
453
454 gpg4win-$(VERSION).wix: gpg4win.nsi $(common_nsi) stamps/stamp-final \
455                         gpgwrap.exe gpgwrap-2.exe kleowrap.exe README.en.txt \
456                         README.de.txt versioninfo.txt
457         perl make-msi.pl --guids $(srcdir)/make-msi.guids \
458                 --manifest gpg4win-$(VERSION).files \
459                 -DBUILD_DIR=. -DTOP_SRCDIR=$(top_srcdir) \
460                 -DSRCDIR=$(srcdir) $(srcdir)/gpg4win.nsi > $@
461
462 gpg4win-light-$(VERSION).wix: gpg4win.nsi $(common_nsi) stamps/stamp-final \
463                         gpgwrap.exe gpgwrap-2.exe kleowrap.exe README.en.txt \
464                         README.de.txt versioninfo.txt
465         perl make-msi.pl --guids $(srcdir)/make-msi.guids \
466                 --manifest gpg4win-light-$(VERSION).files \
467                 -DBUILD_DIR=. -DTOP_SRCDIR=$(top_srcdir) \
468                 -DSRCDIR=$(srcdir) -DGPG4WIN_LIGHT=1 $(srcdir)/gpg4win.nsi > $@
469
470 .PHONY: msi
471 msi: gpg4win-$(VERSION).wix gpg4win-light-$(VERSION).wix
472
473
474 stamps/stamp-dist-self: versioninfo.txt
475         (set -e; cd ..; make dist-bzip2)
476         touch stamps/stamp-dist-self
477
478 gpg4win-src-$(VERSION).exe: gpg4win-src.nsi $(common_nsi) stamps/stamp-final \
479                             stamps/stamp-dist-self installer-options.ini
480         $(MAKENSIS) -V3 -DBUILD_DIR=`pwd` -DTOP_SRCDIR=$(top_srcdir) \
481                 -DSRCDIR=$(srcdir) $(srcdir)/gpg4win-src.nsi
482
483 g4wihelp.dll: g4wihelp.c exdll.h
484         $(CC) -I. -shared -O2 -o g4wihelp.dll $(srcdir)/g4wihelp.c \
485            -lwinmm -lgdi32
486         $(STRIP) g4wihelp.dll
487
488 gpgwrap.exe: gpgwrap.c
489         $(CC) -I. -I.. -DHAVE_CONFIG_H -O2 -o $@ $^
490         $(STRIP) $@
491
492 gpgwrap-2.exe: gpgwrap.c
493         $(CC) -I. -I.. -DHAVE_CONFIG_H -DGPGWRAP_VARIANT=2 -O2 -o $@ $^
494         $(STRIP) $@
495
496 kleowrap.exe: kleowrap.c
497         $(CC) -I. -I.. -DHAVE_CONFIG_H -O2 -mwindows -o $@ $^
498         $(STRIP) $@
499
500 if BUILD_SOURCE_INSTALLER
501 all_src = gpg4win-src-$(VERSION).exe
502 else
503 all_src =
504 endif
505
506 if BUILD_LIGHT_INSTALLER
507 all_light = gpg4win-light-$(VERSION).exe
508 else
509 all_light =
510 endif
511
512 all-local: gpg4win-$(VERSION).exe $(all_light) $(all_src)
513
514 clean-local:
515         rm -f gpg4win-$(VERSION).exe gpg4win-light-$(VERSION).exe \
516             gpg4win-src-$(VERSION).exe