make the generation of mime-token.[hc] a bit more effficient.
[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 = madmutt_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 $(XXXXXXXXXXXX_doc) contrib \
13           lib-mime lib-lib lib-crypt lib-hash lib-sys lib-ui lib \
14           pop imap $(NNTP_SUBDIR)
15
16 BUILT_SOURCES = keymap_defs.h version.h
17
18 bin_PROGRAMS = madmutt madmutt_dotlock pgpringng pgpewrapng smime_keysng
19 madmutt_SOURCES = $(BUILT_SOURCES) \
20         alias.c attach.c base64.c browser.c buffy.c \
21         charset.c compress.c commands.c complete.c  \
22         compose.c copy.c editmsg.c init.c keymap.c lib.c \
23         flags.c filter.c from.c handler.c hcache.c hdrline.c headers.c help.c hook.c \
24         main.c mbox.c mh.c muttlib.c mutt_idna.c mx.c \
25         pager.c pattern.c postpone.c query.c recvattach.c recvcmd.c \
26         score.c send.c sendlib.c sidebar.c sort.c state.c status.c \
27         thread.c account.c
28
29 madmutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ \
30                -Limap -limap -Lpop -lpop $(LIBNNTP) \
31                -Llib-lib -llib -Llib-mime -lmime -Llib-crypt -lcrypt -Llib-hash -lhash \
32                -Llib-sys -lsys -Llib-ui -lui \
33                -Llib -lsane $(MUTTLIBS) $(INTLLIBS) $(LIBICONV)
34
35 madmutt_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ \
36                        $(top_builddir)/lib-lib/liblib.a \
37                        $(top_builddir)/lib-mime/libmime.a \
38                        $(top_builddir)/lib-crypt/libcrypt.a \
39                        $(top_builddir)/lib-hash/libhash.a \
40                        $(top_builddir)/lib-ui/libui.a \
41                        $(top_builddir)/lib/libsane.a \
42                        \
43                        $(top_builddir)/pop/libpop.a  \
44                        $(top_builddir)/imap/libimap.a \
45                        $(LIBNNTPDEPS) $(INTLDEPS)
46
47 makedoc_SOURCES = makedoc.c
48 makedoc_LDADD = -Llib-lib -llib
49 makedoc_DEPENDENCIES = $(top_builddir)/lib-lib/liblib.a
50
51 CPP=@CPP@
52
53 DEFS=-DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \
54         -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \
55         -DHAVE_CONFIG_H=1 -DPKGDOCDIR=\"$(docdir)\"
56
57 INCLUDES=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(NNTP_INCLUDES) $(GPGME_CFLAGS) -Iintl
58
59 CPPFLAGS=@CPPFLAGS@ -I$(includedir)
60
61 EXTRA_madmutt_SOURCES = \
62         account.c mutt_sasl.c dotlock.c remailer.c \
63         alias.h browser.h remailer.h state.h \
64         mutt_idna.h mutt_libesmtp.c sidebar.h state.h
65
66 EXTRA_DIST = config.rpath  COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \
67         configure account.h alias.h attach.h recvattach.h handler.h thread.h \
68         buffy.h charset.h compress.h copy.h dotlock.h functions.def gen_defs \
69         recvattach.h handler.h thread.h globals.h init.h keymap.h \
70         mime.h mutt.h mutt_sasl.h mbox.h mh.h mx.h pager.h protos.h \
71         sort.h mime.types autogen.sh OPS.MIX remailer.c remailer.h browser.h state.h \
72         lib.h extlib.c pgpewrap.c smime_keys.pl Madmuttrc.head Madmuttrc \
73         makedoc.c stamp-doc-rc README.SSL depcomp mutt_idna.h mutt_libesmtp.h
74
75 madmutt_dotlock_SOURCES = dotlock.c
76 madmutt_dotlock_LDADD = -Llib-lib -llib @LIBOBJS@
77 madmutt_dotlock_DEPENDENCIES = @LIBOBJS@ $(top_builddir)/lib-lib/liblib.a
78
79 pgpringng_SOURCES = pgppubring.c lib.c extlib.c
80 pgpringng_LDADD = @LIBOBJS@ $(INTLLIBS) \
81                   -Llib-lib -llib -Llib-hash -lhash -Llib-crypt -lcrypt -Llib -lsane
82 pgpringng_DEPENDENCIES = @LIBOBJS@ $(INTLDEPS) \
83                          $(top_builddir)/lib-lib/liblib.a \
84                          $(top_builddir)/lib-hash/libhash.a
85
86 pgpewrapng_SOURCES = pgpewrap.c
87 pgpewrapng_LDADD = 
88 pgpewrapng_DEPENDENCIES = 
89
90 CLEANFILES = stamp-doc-rc makedoc \
91         keymap_alldefs.h keymap_defs.h version.h
92
93 ACLOCAL_AMFLAGS = -I m4
94
95 LDADD = @LIBOBJS@ @LIBINTL@
96
97 OPS=@OPS@
98
99 smime_keysng: $(srcdir)/smime_keys.pl
100         cp $(srcdir)/smime_keys.pl smime_keysng
101         chmod +x smime_keysng
102
103 Makefile: $(BUILT_SOURCES)
104
105 keymap_defs.h: $(OPS) $(srcdir)/gen_defs
106         $(srcdir)/gen_defs $(OPS) > keymap_defs.h
107
108 keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME $(srcdir)/gen_defs
109         $(srcdir)/gen_defs $(srcdir)/OPS $(srcdir)/OPS.PGP \
110                 $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME \
111                         > keymap_alldefs.h
112
113 version.h:
114         echo "#define MUTT_REVISION \"git\"" > version.h
115
116 install-exec-hook:
117         if test -f $(DESTDIR)$(bindir)/mutt.dotlock && test -f $(DESTDIR)$(bindir)/madmutt_dotlock ; then       \
118                 rm -f $(DESTDIR)$(bindir)/mutt.dotlock ;                \
119                 ln -sf $(DESTDIR)$(bindir)/madmutt_dotlock $(DESTDIR)$(bindir)/mutt.dotlock ; \
120         fi
121         if test -f $(DESTDIR)$(bindir)/madmutt_dotlock && test x@DOTLOCK_GROUP@ != x ; then \
122                 chgrp @DOTLOCK_GROUP@ $(DESTDIR)$(bindir)/madmutt_dotlock && \
123                 chmod @DOTLOCK_PERMISSION@ $(DESTDIR)$(bindir)/madmutt_dotlock || \
124                 { echo "Can't fix madmutt_dotlock's permissions!" >&2 ; } \
125         fi
126
127 install-data-local: madmuttrc
128         $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
129         -if [ -f $(DESTDIR)$(pkgdatadir)/madmuttrc ] ; then \
130                 mv $(DESTDIR)$(pkgdatadir)/madmuttrc* $(DESTDIR)$(sysconfdir) ; \
131         elif [ -f $(DESTDIR)$(pkgdatadir)/../madmuttrc ] ; then \
132                 mv $(DESTDIR)$(pkgdatadir)/../madmuttrc* $(DESTDIR)$(sysconfdir) ; \
133         elif [ ! -f $(DESTDIR)$(sysconfdir)/madmuttrc ] ; then \
134                 $(INSTALL) -m 644 madmuttrc $(DESTDIR)$(sysconfdir) ; \
135         fi
136         -if [ ! -f $(DESTDIR)$(sysconfdir)/madmutt-mime.types ]; then \
137                 $(INSTALL) -m 644 $(srcdir)/mime.types $(DESTDIR)$(sysconfdir)/madmutt-mime.types; \
138         fi
139
140
141 # kluge around automake problems.
142
143 dist-hook:
144         -for file in $(BUILT_SOURCES) ; do rm -f $(distdir)/$$file ; done
145
146 mutt-dist:
147         (cd $(srcdir) && ./build-release )
148
149 update-doc: stamp-doc-rc
150         (cd doc && $(MAKE) update-doc)
151
152 madmuttrc: stamp-doc-rc
153
154 stamp-doc-rc: $(srcdir)/init.h makedoc madmuttrc.head
155         -rm -f madmuttrc stamp-doc-rc
156         $(CPP) $(INCLUDES) $(DEFS) $(CPPFLAGS) -D_MAKEDOC -C \
157                 $(srcdir)/init.h | ./makedoc -c | cat madmuttrc.head - > madmuttrc
158         touch stamp-doc-rc
159
160
161 -include cflags.mk
162
163 wc:
164         @sloccount $(wildcard *.h *.c) $(wildcard lib-*/) lib imap nntp pop | grep 'ansic[=:]'