71d7cc421cf914c62958f7bb22cd0f5962861096
[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 = m4 po intl doc contrib lib $(IMAP_SUBDIR) $(POP_SUBDIR) $(NNTP_SUBDIR)
23
24 bin_SCRIPTS = muttngbug fleang
25
26 BUILT_SOURCES = keymap_defs.h patchlist.c
27
28 bin_PROGRAMS = muttng @DOTLOCK_TARGET@ @PGPAUX_TARGET@ @SMIMEAUX_TARGET@
29 muttng_SOURCES = $(BUILT_SOURCES) \
30         alias.c ascii.c attach.c \
31         base64.c buffer.c browser.c buffy.c \
32         charset.c color.c compress.c crypt.c cryptglue.c commands.c complete.c \
33         compose.c copy.c curs_lib.c curs_main.c crypt-mod.c crypt-mod.h \
34         date.c \
35         edit.c editmsg.c enter.c \
36         flags.c filter.c from.c \
37         getdomain.c \
38         handler.c hash.c hcache.c hdrline.c headers.c help.c history.c hook.c \
39         init.c \
40         keymap.c \
41         lib.c \
42         main.c mbox.c mbyte.c md5c.c menu.c mh.c muttlib.c mutt_idna.c mx.c \
43         pager.c parse.c pattern.c postpone.c \
44         query.c \
45         recvattach.c recvcmd.c rfc822.c rfc1524.c rfc2047.c rfc2231.c \
46         score.c send.c sendlib.c sidebar.c signal.c sort.c state.c status.c system.c \
47         thread.c \
48         url.c utf8.c \
49         wcwidth.c \
50         xterm.c
51
52 muttng_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(LIBPOP) $(LIBNNTP) \
53         -Llib -lsane $(MUTTLIBS) $(INTLLIBS) $(LIBICONV)
54
55 muttng_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(top_builddir)/lib/libsane.a \
56         $(LIBIMAPDEPS) $(LIBPOPDEPS) $(LIBNNTPDEPS) $(INTLDEPS)
57
58 makedoc_SOURCES = makedoc.c
59 makedoc_LDADD =
60 makedoc_DEPENDENCIES = 
61
62 # $(makedoc_OBJECTS): $(makedoc_SOURCES)
63 #       $(HOST_CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) -c $<
64
65 # makedoc: $(makedoc_OBJECTS) $(makedoc_DEPENDENCIES)
66 #       @rm -rf makedoc
67 #       $(HOST_CC) $(AM_CFLAGS) $(LDFLAGS) $(makedoc_LDFLAGS) $(makedoc_OBJECTS) $(makedoc_LDADD) -o makedoc
68
69 CPP=@CPP@
70
71 DEFS=-DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \
72         -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \
73         -DHAVE_CONFIG_H=1
74
75 INCLUDES=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(POP_INCLUDES) $(NNTP_INCLUDES) $(LIBGPGME_CFLAGS) -Iintl
76
77 CPPFLAGS=@CPPFLAGS@ -I$(includedir)
78
79 EXTRA_muttng_SOURCES = \
80         account.c md5c.c mutt_sasl.c mutt_socket.c mutt_ssl.c \
81         mutt_tunnel.c smime.c pgp.c pgpinvoke.c pgpkey.c \
82         pgplib.c sha1.c pgpmicalg.c gnupgparse.c resize.c dotlock.c remailer.c \
83         alias.h \
84         buffer.h browser.h \
85         enter.h \
86         mbyte.h remailer.h url.h state.h \
87         pgppacket.c mutt_idna.h mutt_libesmtp.c \
88         crypt-mod-pgp-classic.c crypt-mod-smime-classic.c \
89         sidebar.h state.h
90
91 EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \
92         configure acconfig.h \
93         account.h alias.h attach.h \
94         buffer.h buffy.h \
95         charset.h compress.h copy.h crypthash.h \
96         dotlock.h functions.h gen_defs \
97         enter.h \
98         globals.h hash.h history.h init.h keymap.h mutt_crypt.h \
99         mapping.h md5.h mime.h mutt.h mutt_curses.h mutt_menu.h \
100         mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h \
101         mbox.h mh.h mx.h pager.h pgp.h protos.h reldate.h rfc1524.h rfc2047.h \
102         rfc2231.h rfc822.h sha1.h sort.h mime.types VERSION autogen.sh \
103         _regex.h OPS.MIX remailer.c remailer.h browser.h state.h \
104         mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h Muttngrc.head Muttngrc \
105         makedoc.c stamp-doc-rc README.SSL smime.h\
106         muttngbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh       \
107         mkchangelog.sh cvslog2changelog.pl mutt_idna.h \
108         snprintf.c regex.c mutt_libesmtp.h crypt-gpgme.h
109
110 muttng_dotlock_SOURCES = mutt_dotlock.c
111 muttng_dotlock_LDADD = @LIBOBJS@
112 muttng_dotlock_DEPENDENCIES = @LIBOBJS@
113
114 pgpringng_SOURCES = pgppubring.c pgplib.c lib.c extlib.c sha1.c md5c.c pgppacket.c ascii.c
115 pgpringng_LDADD = @LIBOBJS@ $(INTLLIBS) -Llib -lsane
116 pgpringng_DEPENDENCIES = @LIBOBJS@ $(INTLDEPS)
117
118 pgpewrapng_SOURCES = pgpewrap.c
119 pgpewrapng_LDADD = 
120 pgpewrapng_DEPENDENCIES = 
121
122 mutt_dotlock.c: dotlock.c
123         cp $(srcdir)/dotlock.c mutt_dotlock.c
124
125 CLEANFILES = mutt_dotlock.c stamp-doc-rc makedoc \
126         keymap_alldefs.h keymap_defs.h patchlist.c
127
128 ACLOCAL_AMFLAGS = -I m4
129
130 LDADD = @LIBOBJS@ @INTLLIBS@
131
132 OPS=@OPS@
133
134 fleang: muttbug.sh
135         cp muttbug.sh fleang
136         chmod +x fleang
137
138 smime_keysng: $(srcdir)/smime_keys.pl
139         cp $(srcdir)/smime_keys.pl smime_keysng
140         chmod +x smime_keysng
141
142 Makefile: $(BUILT_SOURCES)
143
144 keymap_defs.h: $(OPS) $(srcdir)/gen_defs
145         $(srcdir)/gen_defs $(OPS) > keymap_defs.h
146
147 keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME $(srcdir)/gen_defs
148         $(srcdir)/gen_defs $(srcdir)/OPS $(srcdir)/OPS.PGP \
149                 $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME \
150                         > keymap_alldefs.h
151
152 reldate:
153         echo 'const char *ReleaseDate = "'`date +%Y-%m-%d`'";' > $(srcdir)/reldate.h
154
155 patchlist.c: $(srcdir)/PATCHES $(srcdir)/patchlist.sh
156         $(srcdir)/patchlist.sh < $(srcdir)/PATCHES > patchlist.c
157
158 install-exec-hook:
159         if test -f $(DESTDIR)$(bindir)/mutt.dotlock && test -f $(DESTDIR)$(bindir)/muttng_dotlock ; then        \
160                 rm -f $(DESTDIR)$(bindir)/mutt.dotlock ;                \
161                 ln -sf $(DESTDIR)$(bindir)/muttng_dotlock $(DESTDIR)$(bindir)/mutt.dotlock ; \
162         fi
163         if test -f $(DESTDIR)$(bindir)/muttng_dotlock && test x@DOTLOCK_GROUP@ != x ; then \
164                 chgrp @DOTLOCK_GROUP@ $(DESTDIR)$(bindir)/muttng_dotlock && \
165                 chmod @DOTLOCK_PERMISSION@ $(DESTDIR)$(bindir)/muttng_dotlock || \
166                 { echo "Can't fix muttng_dotlock's permissions!" >&2 ; exit 1 ; } \
167         fi
168
169 install-data-local: Muttngrc
170         $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
171         -if [ -f $(DESTDIR)$(pkgdatadir)/Muttngrc ] ; then \
172                 mv $(DESTDIR)$(pkgdatadir)/Muttngrc* $(DESTDIR)$(sysconfdir) ; \
173         elif [ -f $(DESTDIR)$(pkgdatadir)/../Muttngrc ] ; then \
174                 mv $(DESTDIR)$(pkgdatadir)/../Muttngrc* $(DESTDIR)$(sysconfdir) ; \
175         elif [ ! -f $(DESTDIR)$(sysconfdir)/Muttngrc ] ; then \
176                 $(INSTALL) -m 644 Muttngrc $(DESTDIR)$(sysconfdir) ; \
177         fi
178         -if [ ! -f $(DESTDIR)$(sysconfdir)/muttng-mime.types ]; then \
179                 $(INSTALL) -m 644 $(srcdir)/mime.types $(DESTDIR)$(sysconfdir)/muttng-mime.types; \
180         fi
181
182
183 # Don't make this one ChangeLog - it's intended to be
184 # used manually.
185
186 pclean:
187         cat /dev/null > $(top_srcdir)/PATCHES
188
189 check-security:
190         (cd $(top_srcdir) && ./check_sec.sh)
191
192 commit-real:
193         (cd $(top_srcdir) && cvs commit)
194
195 commit-changelog:
196         (cd $(top_srcdir) && cvs commit -m "# changelog commit" ChangeLog)
197
198 commit: pclean check-security commit-real changelog commit-changelog
199
200 changelog:
201         (cd $(top_srcdir); \
202         cvs update ChangeLog; \
203         sh ./mkchangelog.sh | fmt -c | cat  - ChangeLog > ChangeLog.$$$$ && mv ChangeLog.$$$$ ChangeLog; \
204         $${VISUAL:-vi} ChangeLog)
205
206 ChangeLog: changelog
207
208 # kluge around automake problems.
209
210 dist-hook:
211         -for file in $(BUILT_SOURCES) ; do rm -f $(distdir)/$$file ; done
212
213 mutt-dist:
214         (cd $(srcdir) && ./build-release )
215
216 update-doc: stamp-doc-rc
217         (cd doc && $(MAKE) update-doc)
218
219 Muttngrc: stamp-doc-rc
220
221 stamp-doc-rc: $(srcdir)/init.h makedoc Muttngrc.head
222         -rm -f Muttngrc stamp-doc-rc
223         $(CPP) $(INCLUDES) $(DEFS) $(CPPFLAGS) -D_MAKEDOC -C \
224                 $(srcdir)/init.h | ./makedoc -c | cat Muttngrc.head - > Muttngrc
225         touch stamp-doc-rc
226
227
228 .PHONY: commit pclean check-security commit-real commit-changelog
229 .PHONY: changelog ChangeLog