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