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