always build imap as well.
[apps/madmutt.git] / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2 ## Use aclocal -I m4; automake --foreign
3
4 AUTOMAKE_OPTIONS = foreign
5 EXTRA_PROGRAMS = muttng_dotlock pgpringng pgpewrapng makedoc
6
7 if BUILD_NNTP
8 NNTP_SUBDIR = nntp
9 NNTP_INCLUDES = -I$(top_srcdir)/nntp
10 endif
11
12 SUBDIRS = intl m4 po doc contrib \
13           lib-lib lib-mime lib-hash lib \
14           pop imap $(NNTP_SUBDIR)
15
16 bin_SCRIPTS = muttngbug fleang
17
18 BUILT_SOURCES = keymap_defs.h version.h
19
20 bin_PROGRAMS = muttng muttng_dotlock pgpringng pgpewrapng smime_keysng
21 muttng_SOURCES = $(BUILT_SOURCES) \
22         alias.c attach.c base64.c browser.c buffy.c \
23         charset.c color.c compress.c crypt.c cryptglue.c commands.c complete.c \
24         compose.c copy.c curs_lib.c curs_main.c crypt-mod.c crypt-mod.h \
25         date.c edit.c editmsg.c enter.c \
26         flags.c filter.c from.c getdomain.c \
27         handler.c hcache.c hdrline.c headers.c help.c history.c hook.c \
28         init.c keymap.c lib.c \
29         main.c mbox.c mbyte.c menu.c mh.c muttlib.c mutt_idna.c mx.c \
30         pager.c parse.c pattern.c postpone.c query.c \
31         recvattach.c recvcmd.c rfc1524.c rfc3676.c \
32         score.c send.c sendlib.c sidebar.c signal.c sort.c state.c status.c system.c \
33         thread.c url.c utf8.c wcwidth.c \
34         account.c mutt_socket.c mutt_tunnel.c \
35         pgp.c pgpinvoke.c pgpkey.c pgplib.c gnupgparse.c pgpmicalg.c pgppacket.c \
36         crypt-mod-pgp-classic.c smime.c crypt-mod-smime-classic.c
37
38
39 muttng_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ \
40                -Limap -limap -Lpop -lpop $(LIBNNTP) \
41                -Llib-lib -llib -Llib-mime -lmime -Llib-hash -lhash \
42                -Llib -lsane $(MUTTLIBS) $(INTLLIBS) $(LIBICONV)
43
44 muttng_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ \
45                       $(top_builddir)/lib-lib/liblib.a \
46                       $(top_builddir)/lib-mime/libmime.a \
47                       $(top_builddir)/lib-hash/libhash.a \
48                       $(top_builddir)/lib/libsane.a \
49                       \
50                       $(top_builddir)/pop/libpop.a  \
51                       $(top_builddir)/imap/libimap.a \
52                       $(LIBNNTPDEPS) $(INTLDEPS)
53
54 makedoc_SOURCES = makedoc.c
55 makedoc_LDADD = -Llib-lib -llib
56 makedoc_DEPENDENCIES = $(top_builddir)/lib-lib/liblib.a
57
58 CPP=@CPP@
59
60 DEFS=-DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \
61         -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \
62         -DHAVE_CONFIG_H=1 -DPKGDOCDIR=\"$(docdir)\"
63
64 INCLUDES=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(NNTP_INCLUDES) $(LIBGPGME_CFLAGS) -Iintl
65
66 CPPFLAGS=@CPPFLAGS@ -I$(includedir)
67
68 EXTRA_muttng_SOURCES = \
69         account.c mutt_sasl.c mutt_socket.c mutt_ssl.c \
70         mutt_tunnel.c pgp.c pgpinvoke.c pgpkey.c \
71         pgplib.c pgpmicalg.c gnupgparse.c resize.c dotlock.c remailer.c \
72         alias.h browser.h enter.h \
73         mbyte.h remailer.h url.h state.h \
74         mutt_idna.h mutt_libesmtp.c sidebar.h state.h
75
76 EXTRA_DIST = config.rpath  COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \
77         configure acconfig.h \
78         account.h alias.h attach.h recvattach.h handler.h thread.h \
79         buffy.h charset.h compress.h copy.h \
80         dotlock.h functions.def gen_defs \
81         enter.h recvattach.h handler.h thread.h \
82         globals.h history.h init.h keymap.h mutt_crypt.h \
83         mime.h mutt.h mutt_curses.h mutt_menu.h \
84         mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h \
85         mbox.h mh.h mx.h pager.h pgp.h protos.h rfc1524.h \
86         rfc3676.h \
87         sort.h mime.types autogen.sh \
88         _regex.h OPS.MIX remailer.c remailer.h browser.h state.h \
89         mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h Muttngrc.head Muttngrc \
90         makedoc.c stamp-doc-rc README.SSL smime.h\
91         muttngbug pgppacket.h depcomp BEWARE \
92         mkchangelog.sh cvslog2changelog.pl mutt_idna.h \
93         regex.c mutt_libesmtp.h crypt-gpgme.h
94
95 muttng_dotlock_SOURCES = dotlock.c
96 muttng_dotlock_LDADD = -Llib-lib -llib @LIBOBJS@
97 muttng_dotlock_DEPENDENCIES = @LIBOBJS@ $(top_builddir)/lib-lib/liblib.a
98
99 pgpringng_SOURCES = pgppubring.c pgplib.c lib.c extlib.c pgppacket.c
100 pgpringng_LDADD = @LIBOBJS@ $(INTLLIBS) \
101                   -Llib-lib -llib -Llib-hash -lhash -Llib -lsane
102 pgpringng_DEPENDENCIES = @LIBOBJS@ $(INTLDEPS) \
103                          $(top_builddir)/lib-lib/liblib.a \
104                          $(top_builddir)/lib-hash/libhash.a
105
106 pgpewrapng_SOURCES = pgpewrap.c
107 pgpewrapng_LDADD = 
108 pgpewrapng_DEPENDENCIES = 
109
110 CLEANFILES = stamp-doc-rc makedoc \
111         keymap_alldefs.h keymap_defs.h version.h
112
113 ACLOCAL_AMFLAGS = -I m4
114
115 LDADD = @LIBOBJS@ @LIBINTL@
116
117 OPS=@OPS@
118
119 fleang: muttbug.sh
120         cp muttbug.sh fleang
121         chmod +x fleang
122
123 smime_keysng: $(srcdir)/smime_keys.pl
124         cp $(srcdir)/smime_keys.pl smime_keysng
125         chmod +x smime_keysng
126
127 Makefile: $(BUILT_SOURCES)
128
129 keymap_defs.h: $(OPS) $(srcdir)/gen_defs
130         $(srcdir)/gen_defs $(OPS) > keymap_defs.h
131
132 keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME $(srcdir)/gen_defs
133         $(srcdir)/gen_defs $(srcdir)/OPS $(srcdir)/OPS.PGP \
134                 $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME \
135                         > keymap_alldefs.h
136
137 version.h:
138         echo "#define MUTT_REVISION \"git\"" > version.h
139
140 install-exec-hook:
141         if test -f $(DESTDIR)$(bindir)/mutt.dotlock && test -f $(DESTDIR)$(bindir)/muttng_dotlock ; then        \
142                 rm -f $(DESTDIR)$(bindir)/mutt.dotlock ;                \
143                 ln -sf $(DESTDIR)$(bindir)/muttng_dotlock $(DESTDIR)$(bindir)/mutt.dotlock ; \
144         fi
145         if test -f $(DESTDIR)$(bindir)/muttng_dotlock && test x@DOTLOCK_GROUP@ != x ; then \
146                 chgrp @DOTLOCK_GROUP@ $(DESTDIR)$(bindir)/muttng_dotlock && \
147                 chmod @DOTLOCK_PERMISSION@ $(DESTDIR)$(bindir)/muttng_dotlock || \
148                 { echo "Can't fix muttng_dotlock's permissions!" >&2 ; } \
149         fi
150
151 install-data-local: Muttngrc
152         $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
153         -if [ -f $(DESTDIR)$(pkgdatadir)/Muttngrc ] ; then \
154                 mv $(DESTDIR)$(pkgdatadir)/Muttngrc* $(DESTDIR)$(sysconfdir) ; \
155         elif [ -f $(DESTDIR)$(pkgdatadir)/../Muttngrc ] ; then \
156                 mv $(DESTDIR)$(pkgdatadir)/../Muttngrc* $(DESTDIR)$(sysconfdir) ; \
157         elif [ ! -f $(DESTDIR)$(sysconfdir)/Muttngrc ] ; then \
158                 $(INSTALL) -m 644 Muttngrc $(DESTDIR)$(sysconfdir) ; \
159         fi
160         -if [ ! -f $(DESTDIR)$(sysconfdir)/muttng-mime.types ]; then \
161                 $(INSTALL) -m 644 $(srcdir)/mime.types $(DESTDIR)$(sysconfdir)/muttng-mime.types; \
162         fi
163
164
165 # kluge around automake problems.
166
167 dist-hook:
168         -for file in $(BUILT_SOURCES) ; do rm -f $(distdir)/$$file ; done
169
170 mutt-dist:
171         (cd $(srcdir) && ./build-release )
172
173 update-doc: stamp-doc-rc
174         (cd doc && $(MAKE) update-doc)
175
176 Muttngrc: stamp-doc-rc
177
178 stamp-doc-rc: $(srcdir)/init.h makedoc Muttngrc.head
179         -rm -f Muttngrc stamp-doc-rc
180         $(CPP) $(INCLUDES) $(DEFS) $(CPPFLAGS) -D_MAKEDOC -C \
181                 $(srcdir)/init.h | ./makedoc -c | cat Muttngrc.head - > Muttngrc
182         touch stamp-doc-rc
183
184
185 -include cflags.mk