fixes, simplifictions
[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
6
7 if BUILD_NNTP
8 NNTP_SUBDIR = nntp
9 endif
10
11 SUBDIRS = tools intl m4 po \
12           lib-lua lib-mime lib-lib lib-mx lib-sys lib-ui \
13           pop imap $(NNTP_SUBDIR)
14
15 BUILT_SOURCES = keymap_defs.h charset.gperf
16 DISTCLEANFILES = $(BUILT_SOURCES)
17
18 bin_PROGRAMS = madmutt madmutt_dotlock
19 madmutt_SOURCES = $(BUILT_SOURCES) \
20         alias.c attach.c base64.c browser.c buffy.c charset.c commands.c \
21         compose.c copy.c crypt.c editmsg.c init.c keymap.c flags.c from.c \
22         handler.c headers.c help.c hook.c main.c muttlib.c mutt_idna.c \
23         pager.c pattern.c postpone.c recvattach.c recvcmd.c score.c send.c \
24         sendlib.c send_smtp.c sort.c state.c thread.c account.c remailer.c \
25         mutt_sasl.c
26
27 madmutt_LDADD = $(top_builddir)/lib-mime/libmime.a \
28                 $(top_builddir)/lib-mx/libmx.a \
29                 $(top_builddir)/imap/libimap.a \
30                 $(top_builddir)/pop/libpop.a \
31                 $(LIBNNTP) \
32                 $(top_builddir)/lib-sys/libsys.a \
33                 $(top_builddir)/lib-ui/libui.a \
34                 $(top_builddir)/lib-lua/liblua.a \
35                 $(top_builddir)/lib-lib/liblib.a \
36                 $(MUTTLIBS) $(INTLLIBS) $(LIBICONV)
37
38 madmutt_DEPENDENCIES = $(top_builddir)/lib-lib/liblib.a \
39                        $(top_builddir)/lib-mime/libmime.a \
40                        $(top_builddir)/lib-sys/libsys.a \
41                        $(top_builddir)/lib-ui/libui.a \
42                        $(top_builddir)/lib-lua/liblua.a \
43                        $(top_builddir)/lib-mx/libmx.a \
44                        \
45                        $(top_builddir)/pop/libpop.a   \
46                        $(top_builddir)/imap/libimap.a \
47                        $(LIBNNTPDEPS) $(INTLDEPS)
48
49 CPP=@CPP@
50
51 DEFS=-DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \
52         -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \
53         -DHAVE_CONFIG_H=1 -DPKGDOCDIR=\"$(docdir)\"
54
55 INCLUDES=-I$(top_srcdir) $(GPGME_CFLAGS) -Iintl
56
57 CPPFLAGS=@CPPFLAGS@ -I$(includedir)
58
59 EXTRA_DIST = config.rpath  COPYRIGHT GPL OPS TODO \
60         configure account.h alias.h attach.h recvattach.h handler.h thread.h \
61         alias.h browser.h remailer.h state.h mutt_idna.h state.h buffy.h \
62         charset.h copy.h dotlock.h functions.def gen_defs recvattach.h handler.h \
63         thread.h globals.h init.h keymap.h mime.h mutt.h mutt_sasl.h pager.h \
64         protos.h sort.h autogen.sh remailer.h browser.h state.h README.SSL \
65         depcomp mutt_idna.h send_smtp.h
66
67 madmutt_dotlock_SOURCES = dotlock.c
68 madmutt_dotlock_LDADD = $(top_builddir)/lib-lib/liblib.a
69 madmutt_dotlock_DEPENDENCIES = $(top_builddir)/lib-lib/liblib.a
70
71 CLEANFILES = keymap_defs.h
72
73 ACLOCAL_AMFLAGS = -I m4
74
75 LDADD = @LIBINTL@
76
77 charset.gperf: charset.def
78         sh $< > $@
79
80 keymap_defs.h: OPS
81         $(srcdir)/gen_defs $^ > keymap_defs.h
82
83 install-exec-hook:
84         if test -f $(DESTDIR)$(bindir)/mutt.dotlock && test -f $(DESTDIR)$(bindir)/madmutt_dotlock ; then       \
85                 rm -f $(DESTDIR)$(bindir)/mutt.dotlock ;                \
86                 ln -sf $(DESTDIR)$(bindir)/madmutt_dotlock $(DESTDIR)$(bindir)/mutt.dotlock ; \
87         fi
88         if test -f $(DESTDIR)$(bindir)/madmutt_dotlock && test x@DOTLOCK_GROUP@ != x ; then \
89                 chgrp @DOTLOCK_GROUP@ $(DESTDIR)$(bindir)/madmutt_dotlock && \
90                 chmod @DOTLOCK_PERMISSION@ $(DESTDIR)$(bindir)/madmutt_dotlock || \
91                 { echo "Can't fix madmutt_dotlock's permissions!" >&2 ; } \
92         fi
93
94 include tools/cpkg2c.mk
95 -include tools/cflags.mk
96
97 wc:
98         @sloccount $(wildcard *.h *.c) $(wildcard lib-*/) lib imap nntp pop | grep 'ansic[=:]'