1 ## Process this file with automake to produce Makefile.in
2 ## Use aclocal -I m4; automake --foreign
3 include $(top_srcdir)/flymake.am
5 AUTOMAKE_OPTIONS = 1.6 foreign
6 EXTRA_PROGRAMS = mutt_dotlock mutt_pgpring pgpewrap mutt_md5
10 IMAP_INCLUDES = -I$(top_srcdir)/imap
14 AUTOCRYPT_SUBDIR = autocrypt
15 AUTOCRYPT_INCLUDES = -I$(top_srcdir)/autocrypt
18 SUBDIRS = m4 po intl doc contrib $(IMAP_SUBDIR) $(AUTOCRYPT_SUBDIR)
20 bin_SCRIPTS = muttbug flea $(SMIMEAUX_TARGET)
23 HCVERSION = hcversion.h
26 BUILT_SOURCES = keymap_defs.h patchlist.c reldate.h conststrings.c version.h $(HCVERSION)
28 bin_PROGRAMS = mutt $(DOTLOCK_TARGET) $(PGPAUX_TARGET)
30 addrbook.c alias.c attach.c base64.c browser.c buffer.c buffy.c color.c \
32 commands.c complete.c compose.c copy.c curs_lib.c curs_main.c date.c \
33 edit.c enter.c flags.c init.c filter.c from.c \
35 handler.c hash.c hdrline.c headers.c help.c hook.c keymap.c \
36 main.c mbox.c menu.c mh.c mx.c pager.c parse.c pattern.c \
37 postpone.c query.c recvattach.c recvcmd.c \
38 rfc822.c rfc1524.c rfc2047.c rfc2231.c rfc3676.c \
39 score.c send.c sendlib.c signal.c sort.c \
40 status.c system.c thread.c charset.c history.c lib.c \
41 muttlib.c editmsg.c mbyte.c \
42 url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c
44 nodist_mutt_SOURCES = $(BUILT_SOURCES)
46 mutt_LDADD = $(MUTT_LIB_OBJECTS) $(LIBOBJS) \
47 $(LIBIMAP) $(LIBAUTOCRYPT) \
49 $(INTLLIBS) $(LIBICONV) $(GPGME_LIBS) $(GPG_ERROR_LIBS)
51 mutt_DEPENDENCIES = $(MUTT_LIB_OBJECTS) $(LIBOBJS) $(LIBIMAPDEPS) \
52 $(INTLDEPS) $(LIBAUTOCRYPTDEPS)
54 DEFS=-DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \
55 -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \
58 AM_CPPFLAGS=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(AUTOCRYPT_INCLUDES) $(GPGME_CFLAGS) -Iintl
60 EXTRA_mutt_SOURCES = account.c bcache.c compress.c crypt-gpgme.c crypt-mod-pgp-classic.c \
61 crypt-mod-pgp-gpgme.c crypt-mod-smime-classic.c \
62 crypt-mod-smime-gpgme.c dotlock.c gnupgparse.c hcache.c md5.c monitor.c \
63 mutt_idna.c mutt_sasl.c mutt_socket.c mutt_ssl.c mutt_ssl_gnutls.c \
64 mutt_tunnel.c pgp.c pgpinvoke.c pgpkey.c pgplib.c pgpmicalg.c \
65 pgppacket.c pop.c pop_auth.c pop_lib.c remailer.c resize.c sha1.c \
66 sidebar.c smime.c smtp.c utf8.c wcwidth.c \
67 bcache.h browser.h hcache.h mbyte.h monitor.h mutt_idna.h remailer.h url.h
69 EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO UPDATING \
71 attach.h buffer.h buffy.h charset.h compress.h copy.h crypthash.h \
72 dotlock.h functions.h gen_defs \
73 globals.h hash.h history.h init.h keymap.h mutt_crypt.h \
74 mailbox.h mapping.h md5.h mime.h mutt.h mutt_curses.h mutt_menu.h \
75 mutt_regex.h mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h \
76 mx.h pager.h pgp.h pop.h protos.h rfc1524.h rfc2047.h \
77 rfc2231.h rfc822.h rfc3676.h sha1.h sort.h mime.types VERSION prepare \
78 _mutt_regex.h OPS.MIX README.SECURITY remailer.c remailer.h browser.h \
79 mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h \
80 README.SSL smime.h group.h \
81 muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
82 ChangeLog mkchangelog.sh mkreldate.sh mutt_idna.h sidebar.h OPS.SIDEBAR \
83 snprintf.c regex.c crypt-gpgme.h hcachever.sh.in \
84 txt2c.c txt2c.sh version.sh check_sec.sh
86 EXTRA_SCRIPTS = smime_keys
88 mutt_dotlock_SOURCES = mutt_dotlock.c
89 mutt_dotlock_LDADD = $(LIBOBJS)
90 mutt_dotlock_DEPENDENCIES = $(LIBOBJS)
92 mutt_pgpring_SOURCES = pgppubring.c pgplib.c lib.c extlib.c sha1.c md5.c pgppacket.c ascii.c
93 mutt_pgpring_LDADD = $(LIBOBJS) $(INTLLIBS)
94 mutt_pgpring_DEPENDENCIES = $(LIBOBJS) $(INTLDEPS)
96 mutt_md5_SOURCES = md5.c
97 mutt_md5_CFLAGS = -DMD5UTIL
100 txt2c_SOURCES = txt2c.c
103 noinst_PROGRAMS = $(MUTT_MD5) txt2c
105 mutt_dotlock.c: dotlock.c
106 cp $(srcdir)/dotlock.c mutt_dotlock.c
108 conststrings.c: txt2c config.status
110 ($(CC) -v >/dev/null 2>&1 && $(CC) -v) || \
111 ($(CC) --version >/dev/null 2>&1 && $(CC) --version) || \
112 ($(CC) -V >/dev/null 2>&1 && $(CC) -V) || \
113 echo "unknown compiler"; \
114 ) 2>&1 | ${srcdir}/txt2c.sh cc_version >conststrings_c
115 echo "$(CFLAGS)" | ${srcdir}/txt2c.sh cc_cflags >>conststrings_c
116 grep ac_cs_config= config.status | \
118 sed -e 's/^"//' -e 's/"$$//' | ${srcdir}/txt2c.sh configure_options >>conststrings_c
119 mv -f conststrings_c conststrings.c
121 CLEANFILES = mutt_dotlock.c keymap_alldefs.h $(BUILT_SOURCES)
123 DISTCLEANFILES= flea smime_keys txt2c po/$(PACKAGE).pot
125 ACLOCAL_AMFLAGS = -I m4
127 LDADD = $(LIBOBJS) $(INTLLIBS)
129 flea: $(srcdir)/muttbug
130 cp $(srcdir)/muttbug flea
133 smime_keys: $(srcdir)/smime_keys.pl
134 cp $(srcdir)/smime_keys.pl smime_keys
137 keymap_defs.h: $(OPS) $(srcdir)/gen_defs
138 $(srcdir)/gen_defs $(OPS) > keymap_defs.h
140 keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.SIDEBAR $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME $(srcdir)/gen_defs
142 $(srcdir)/gen_defs $(srcdir)/OPS $(srcdir)/OPS.SIDEBAR $(srcdir)/OPS.PGP \
143 $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME \
146 # If we have GNU make, we can use the FORCE target to enable
147 # automatic rebuilding of version.h after a commit.
150 echo '#define MUTT_VERSION "'`sh "$(srcdir)/version.sh"`'"' > $@.tmp
151 cmp -s $@ $@.tmp && rm -f $@.tmp || mv $@.tmp $@
153 # On some other versions of make, such as OpenBSD, invoking the
154 # version.h target always retriggers targets with that prerequisite, which
155 # causes installation issues.
157 version.h: $(srcdir)/version.sh
158 echo '#define MUTT_VERSION "'`sh "$(srcdir)/version.sh"`'"' > version.h
161 reldate.h: $(srcdir)/mkreldate.sh $(srcdir)/ChangeLog
162 echo 'const char *ReleaseDate = "'`(cd $(srcdir) && ./mkreldate.sh)`'";' > reldate.h
164 # The '#undef ENABLE_NLS' is to work around an automake ordering issue:
165 # BUILT_SOURCES are processed before SUBDIRS.
166 # If configured with --with-included-gettext this means that intl will
167 # not have generated libintl.h yet, and mutt.h -> lib.h will generate
169 hcversion.h: $(srcdir)/mutt.h $(srcdir)/rfc822.h hcachever.sh $(MUTT_MD5)
170 ( echo '#include "config.h"'; echo '#undef ENABLE_NLS'; echo '#include "mutt.h"'; ) \
171 | $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - | sh ./hcachever.sh hcversion.h
173 patchlist.c: $(srcdir)/PATCHES $(srcdir)/patchlist.sh
174 $(srcdir)/patchlist.sh < $(srcdir)/PATCHES > patchlist.c
177 if test -f $(DESTDIR)$(bindir)/mutt.dotlock && test -f $(DESTDIR)$(bindir)/mutt_dotlock ; then \
178 rm -f $(DESTDIR)$(bindir)/mutt.dotlock ; \
179 ln -sf $(DESTDIR)$(bindir)/mutt_dotlock $(DESTDIR)$(bindir)/mutt.dotlock ; \
181 if test -f $(DESTDIR)$(bindir)/mutt_dotlock && test x$(DOTLOCK_GROUP) != x ; then \
182 chgrp $(DOTLOCK_GROUP) $(DESTDIR)$(bindir)/mutt_dotlock && \
183 chmod $(DOTLOCK_PERMISSION) $(DESTDIR)$(bindir)/mutt_dotlock || \
184 { echo "Can't fix mutt_dotlock's permissions! This is required to lock mailboxes in the mail spool directory." >&2 ; exit 1 ; } \
188 $(MKDIR_P) $(DESTDIR)$(sysconfdir)
189 $(INSTALL) -m 644 $(srcdir)/mime.types $(DESTDIR)$(sysconfdir)/mime.types.dist
190 -if [ ! -f $(DESTDIR)$(sysconfdir)/mime.types ]; then \
191 $(INSTALL) -m 644 $(srcdir)/mime.types $(DESTDIR)$(sysconfdir); \
195 for i in mime.types ; do \
196 if cmp -s $(DESTDIR)$(sysconfdir)/$$i.dist $(DESTDIR)$(sysconfdir)/$$i ; then \
197 rm $(DESTDIR)$(sysconfdir)/$$i ; \
199 rm $(DESTDIR)$(sysconfdir)/$${i}.dist ; \
203 cat /dev/null > $(top_srcdir)/PATCHES
206 (cd $(top_srcdir) && ./check_sec.sh)
210 sh ./mkchangelog.sh | cat - ChangeLog > ChangeLog.$$$$ && mv ChangeLog.$$$$ ChangeLog; \
211 $${VISUAL:-vi} ChangeLog)
214 (cd $(srcdir) && ./build-release )
217 (cd doc && $(MAKE) update-doc)
219 .PHONY: commit pclean check-security