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