we don't really need md5 for hcache at all.
[apps/madmutt.git] / Makefile.am
index c223c0c..9978ecd 100644 (file)
@@ -2,59 +2,49 @@
 ## Use aclocal -I m4; automake --foreign
 
 AUTOMAKE_OPTIONS = foreign
-EXTRA_PROGRAMS = muttng_dotlock pgpringng pgpewrapng makedoc
-
-if BUILD_IMAP
-IMAP_SUBDIR = imap
-IMAP_INCLUDES = -I$(top_srcdir)/imap
-endif
-
-if BUILD_POP
-POP_SUBDIR = pop
-POP_INCLUDES = -I$(top_srcdir)/pop
-endif
+EXTRA_PROGRAMS = madmutt_dotlock
 
 if BUILD_NNTP
 NNTP_SUBDIR = nntp
-NNTP_INCLUDES = -I$(top_srcdir)/nntp
 endif
 
-SUBDIRS = intl m4 po lib-lib lib-hash doc contrib lib $(IMAP_SUBDIR) $(POP_SUBDIR) $(NNTP_SUBDIR)
-
-bin_SCRIPTS = muttngbug fleang
-
-BUILT_SOURCES = keymap_defs.h version.h
-
-bin_PROGRAMS = muttng @DOTLOCK_TARGET@ @PGPAUX_TARGET@ @SMIMEAUX_TARGET@
-muttng_SOURCES = $(BUILT_SOURCES) \
-       alias.c attach.c base64.c browser.c buffy.c \
-       charset.c color.c compress.c crypt.c cryptglue.c commands.c complete.c \
-       compose.c copy.c curs_lib.c curs_main.c crypt-mod.c crypt-mod.h \
-       date.c edit.c editmsg.c enter.c \
-       flags.c filter.c from.c getdomain.c \
-       handler.c hcache.c hdrline.c headers.c help.c history.c hook.c \
-       init.c keymap.c lib.c \
-       main.c mbox.c mbyte.c menu.c mh.c muttlib.c mutt_idna.c mx.c \
-       pager.c parse.c pattern.c postpone.c \
-       query.c \
-       recvattach.c recvcmd.c rfc822.c rfc1524.c rfc2047.c rfc2231.c rfc3676.c \
-       score.c send.c sendlib.c sidebar.c signal.c sort.c state.c status.c system.c \
-       thread.c \
-       url.c utf8.c \
-       wcwidth.c
-
-muttng_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(LIBPOP) $(LIBNNTP) \
-       -Llib-lib -llib -Llib-hash -lhash -Llib -lsane $(MUTTLIBS) $(INTLLIBS) $(LIBICONV)
-
-muttng_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ \
-                     $(top_builddir)/lib-lib/liblib.a \
-                     $(top_builddir)/lib-hash/libhash.a \
-                     $(top_builddir)/lib/libsane.a \
-       $(LIBIMAPDEPS) $(LIBPOPDEPS) $(LIBNNTPDEPS) $(INTLDEPS)
-
-makedoc_SOURCES = makedoc.c
-makedoc_LDADD = -Llib-lib -llib
-makedoc_DEPENDENCIES = $(top_builddir)/lib-lib/liblib.a
+SUBDIRS = tools intl m4 po \
+         lib-lua lib-mime lib-lib lib-mx lib-sys lib-ui \
+         pop imap $(NNTP_SUBDIR)
+
+BUILT_SOURCES = keymap_defs.h charset.gperf
+DISTCLEANFILES = $(BUILT_SOURCES)
+
+bin_PROGRAMS = madmutt madmutt_dotlock
+madmutt_SOURCES = $(BUILT_SOURCES) \
+       alias.c attach.c base64.c browser.c buffy.c charset.c commands.c \
+       compose.c copy.c crypt.c editmsg.c init.c keymap.c flags.c from.c \
+       handler.c headers.c help.c hook.c main.c muttlib.c mutt_idna.c \
+       pager.c pattern.c postpone.c recvattach.c recvcmd.c score.c send.c \
+       sendlib.c send_smtp.c sort.c state.c thread.c account.c remailer.c \
+       mutt_sasl.c
+
+madmutt_LDADD = $(top_builddir)/lib-mime/libmime.a \
+               $(top_builddir)/lib-mx/libmx.a \
+               $(top_builddir)/imap/libimap.a \
+               $(top_builddir)/pop/libpop.a \
+               $(LIBNNTP) \
+               $(top_builddir)/lib-sys/libsys.a \
+               $(top_builddir)/lib-ui/libui.a \
+               $(top_builddir)/lib-lua/liblua.a \
+               $(top_builddir)/lib-lib/liblib.a \
+               $(MUTTLIBS) $(INTLLIBS) $(LIBICONV)
+
+madmutt_DEPENDENCIES = $(top_builddir)/lib-lib/liblib.a \
+                      $(top_builddir)/lib-mime/libmime.a \
+                      $(top_builddir)/lib-sys/libsys.a \
+                      $(top_builddir)/lib-ui/libui.a \
+                      $(top_builddir)/lib-lua/liblua.a \
+                      $(top_builddir)/lib-mx/libmx.a \
+                      \
+                      $(top_builddir)/pop/libpop.a   \
+                      $(top_builddir)/imap/libimap.a \
+                      $(LIBNNTPDEPS) $(INTLDEPS)
 
 CPP=@CPP@
 
@@ -62,127 +52,47 @@ DEFS=-DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \
        -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" \
        -DHAVE_CONFIG_H=1 -DPKGDOCDIR=\"$(docdir)\"
 
-INCLUDES=-I. -I$(top_srcdir) $(IMAP_INCLUDES) $(POP_INCLUDES) $(NNTP_INCLUDES) $(LIBGPGME_CFLAGS) -Iintl
+INCLUDES=-I$(top_srcdir) $(GPGME_CFLAGS) -Iintl
 
 CPPFLAGS=@CPPFLAGS@ -I$(includedir)
 
-EXTRA_muttng_SOURCES = \
-       account.c mutt_sasl.c mutt_socket.c mutt_ssl.c \
-       mutt_tunnel.c smime.c pgp.c pgpinvoke.c pgpkey.c \
-       pgplib.c pgpmicalg.c gnupgparse.c resize.c dotlock.c remailer.c \
-       alias.h browser.h enter.h \
-       mbyte.h remailer.h url.h state.h \
-       pgppacket.c mutt_idna.h mutt_libesmtp.c \
-       crypt-mod-pgp-classic.c crypt-mod-smime-classic.c \
-       sidebar.h state.h
-
-EXTRA_DIST = config.rpath  COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \
-       configure acconfig.h \
-       account.h alias.h attach.h recvattach.h handler.h thread.h \
-       buffy.h charset.h compress.h copy.h \
-       dotlock.h functions.h gen_defs \
-       enter.h recvattach.h handler.h thread.h \
-       globals.h history.h init.h keymap.h mutt_crypt.h \
-       mime.h mutt.h mutt_curses.h mutt_menu.h \
-       mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h \
-       mbox.h mh.h mx.h pager.h pgp.h protos.h rfc1524.h rfc2047.h \
-       rfc2231.h rfc822.h rfc3676.h \
-       sort.h mime.types autogen.sh \
-       _regex.h OPS.MIX remailer.c remailer.h browser.h state.h \
-       mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h Muttngrc.head Muttngrc \
-       makedoc.c stamp-doc-rc README.SSL smime.h\
-       muttngbug pgppacket.h depcomp BEWARE \
-       mkchangelog.sh cvslog2changelog.pl mutt_idna.h \
-       regex.c mutt_libesmtp.h crypt-gpgme.h
-
-muttng_dotlock_SOURCES = dotlock.c
-muttng_dotlock_LDADD = -Llib-lib -llib @LIBOBJS@
-muttng_dotlock_DEPENDENCIES = @LIBOBJS@ $(top_builddir)/lib-lib/liblib.a
-
-pgpringng_SOURCES = pgppubring.c pgplib.c lib.c extlib.c pgppacket.c
-pgpringng_LDADD = @LIBOBJS@ $(INTLLIBS) \
-                 -Llib-lib -llib -Llib-hash -lhash -Llib -lsane
-pgpringng_DEPENDENCIES = @LIBOBJS@ $(INTLDEPS) \
-                        $(top_builddir)/lib-lib/liblib.a \
-                        $(top_builddir)/lib-hash/libhash.a
-
-pgpewrapng_SOURCES = pgpewrap.c
-pgpewrapng_LDADD = 
-pgpewrapng_DEPENDENCIES = 
-
-CLEANFILES = stamp-doc-rc makedoc \
-       keymap_alldefs.h keymap_defs.h version.h
-
-ACLOCAL_AMFLAGS = -I m4
-
-LDADD = @LIBOBJS@ @LIBINTL@
-
-OPS=@OPS@
+EXTRA_DIST = config.rpath  COPYRIGHT GPL OPS TODO \
+       configure account.h alias.h attach.h recvattach.h handler.h thread.h \
+       alias.h browser.h remailer.h state.h mutt_idna.h state.h buffy.h \
+       charset.h copy.h dotlock.h functions.def gen_defs recvattach.h handler.h \
+       thread.h globals.h init.h keymap.h mime.h mutt.h mutt_sasl.h pager.h \
+       protos.h sort.h autogen.sh remailer.h browser.h state.h README.SSL \
+       depcomp mutt_idna.h send_smtp.h
 
-fleang:        muttbug.sh
-       cp muttbug.sh fleang
-       chmod +x fleang
+madmutt_dotlock_SOURCES = dotlock.c
+madmutt_dotlock_LDADD = $(top_builddir)/lib-lib/liblib.a
+madmutt_dotlock_DEPENDENCIES = $(top_builddir)/lib-lib/liblib.a
 
-smime_keysng: $(srcdir)/smime_keys.pl
-       cp $(srcdir)/smime_keys.pl smime_keysng
-       chmod +x smime_keysng
+CLEANFILES = keymap_defs.h
 
-Makefile: $(BUILT_SOURCES)
+ACLOCAL_AMFLAGS = -I m4
 
-keymap_defs.h: $(OPS) $(srcdir)/gen_defs
-       $(srcdir)/gen_defs $(OPS) > keymap_defs.h
+LDADD = @LIBINTL@
 
-keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME $(srcdir)/gen_defs
-       $(srcdir)/gen_defs $(srcdir)/OPS $(srcdir)/OPS.PGP \
-               $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME \
-                       > keymap_alldefs.h
+charset.gperf: charset.def
+       sh $< > $@
 
-version.h: Makefile.am
-       echo "#define MUTT_REVISION \"git\"" > version.h
+keymap_defs.h: OPS
+       $(srcdir)/gen_defs $^ > keymap_defs.h
 
 install-exec-hook:
-       if test -f $(DESTDIR)$(bindir)/mutt.dotlock && test -f $(DESTDIR)$(bindir)/muttng_dotlock ; then        \
+       if test -f $(DESTDIR)$(bindir)/mutt.dotlock && test -f $(DESTDIR)$(bindir)/madmutt_dotlock ; then       \
                rm -f $(DESTDIR)$(bindir)/mutt.dotlock ;                \
-               ln -sf $(DESTDIR)$(bindir)/muttng_dotlock $(DESTDIR)$(bindir)/mutt.dotlock ; \
+               ln -sf $(DESTDIR)$(bindir)/madmutt_dotlock $(DESTDIR)$(bindir)/mutt.dotlock ; \
        fi
-       if test -f $(DESTDIR)$(bindir)/muttng_dotlock && test x@DOTLOCK_GROUP@ != x ; then \
-               chgrp @DOTLOCK_GROUP@ $(DESTDIR)$(bindir)/muttng_dotlock && \
-               chmod @DOTLOCK_PERMISSION@ $(DESTDIR)$(bindir)/muttng_dotlock || \
-               { echo "Can't fix muttng_dotlock's permissions!" >&2 ; } \
+       if test -f $(DESTDIR)$(bindir)/madmutt_dotlock && test x@DOTLOCK_GROUP@ != x ; then \
+               chgrp @DOTLOCK_GROUP@ $(DESTDIR)$(bindir)/madmutt_dotlock && \
+               chmod @DOTLOCK_PERMISSION@ $(DESTDIR)$(bindir)/madmutt_dotlock || \
+               { echo "Can't fix madmutt_dotlock's permissions!" >&2 ; } \
        fi
 
-install-data-local: Muttngrc
-       $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
-       -if [ -f $(DESTDIR)$(pkgdatadir)/Muttngrc ] ; then \
-               mv $(DESTDIR)$(pkgdatadir)/Muttngrc* $(DESTDIR)$(sysconfdir) ; \
-       elif [ -f $(DESTDIR)$(pkgdatadir)/../Muttngrc ] ; then \
-               mv $(DESTDIR)$(pkgdatadir)/../Muttngrc* $(DESTDIR)$(sysconfdir) ; \
-       elif [ ! -f $(DESTDIR)$(sysconfdir)/Muttngrc ] ; then \
-               $(INSTALL) -m 644 Muttngrc $(DESTDIR)$(sysconfdir) ; \
-       fi
-       -if [ ! -f $(DESTDIR)$(sysconfdir)/muttng-mime.types ]; then \
-               $(INSTALL) -m 644 $(srcdir)/mime.types $(DESTDIR)$(sysconfdir)/muttng-mime.types; \
-       fi
-
-
-# kluge around automake problems.
-
-dist-hook:
-       -for file in $(BUILT_SOURCES) ; do rm -f $(distdir)/$$file ; done
-
-mutt-dist:
-       (cd $(srcdir) && ./build-release )
-
-update-doc: stamp-doc-rc
-       (cd doc && $(MAKE) update-doc)
-
-Muttngrc: stamp-doc-rc
-
-stamp-doc-rc: $(srcdir)/init.h makedoc Muttngrc.head
-       -rm -f Muttngrc stamp-doc-rc
-       $(CPP) $(INCLUDES) $(DEFS) $(CPPFLAGS) -D_MAKEDOC -C \
-               $(srcdir)/init.h | ./makedoc -c | cat Muttngrc.head - > Muttngrc
-       touch stamp-doc-rc
-
+include tools/cpkg2c.mk
+-include tools/cflags.mk
 
--include cflags.mk
+wc:
+       @sloccount $(wildcard *.h *.c) $(wildcard lib-*/) lib imap nntp pop | grep 'ansic[=:]'