#  elmo - ELectronic Mail Operator
#
#  Copyright (C) 2002, 2003, 2004 rzyjontko
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; version 2.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  


AM_CFLAGS = -Wall -DLOCALEDIR='"$(datadir)/locale"' -DSYSCONFDIR='"$(sysconfdir)"' -DDATADIR='"$(pkgdatadir)"' $(GPGME_CFLAGS)
AM_LFLAGS = -p -s -i

PLIKI_INC  = status.inc elmo.inc cmd.inc clock.inc debug.inc folder.inc \
             mailreader.inc box_selection.inc topbar.inc fetch.inc \
             frames.inc attach.inc help.inc sender.inc abook.inc \
             abook_add.inc

EXTRA_DIST         = funex.pl elmoconf.pl inc.in interface.desc $(PLIKI_INC)
EXTRA_elmo_SOURCES = scandir.c

CLEANFILES = *.inc

ZRODLA_elmo = elmo.c elmo.h status.c status.h folder.c folder.h cmd.c cmd.h \
              mbox.c mbox.h mlex.l mlex.h xmalloc.c xmalloc.h line.c line.h \
              hash.c hash.h address.c address.h clock.h clock.c \
              mailreader.h mailreader.c rstring.c \
              rstring.h multree.c multree.h mail.c mail.h debug.c debug.h \
              rarray.c rarray.h maildir.c maildir.h \
              file.c file.h error.c error.h select.c select.h \
              box_selection.c box_selection.h confread.l confread.h \
              networking.c networking.h pop.c pop.h fetch.c fetch.h \
              mime.c mime.h smtp.c smtp.h run.c run.h \
              compose.l compose.h sender.c sender.h rmime.c rmime.h \
              raddress.c raddress.h attach.c attach.h mailinfo.c mailinfo.h \
              abook.c abook.h read.c read.h eprintf.c eprintf.h misc.c \
              misc.h exec.c exec.h keymap.c keymap.h hook.c hook.h \
              exec_table.t choose.c choose.h linech.c linech.h \
              ask.c ask.h bayes.c bayes.h ecurses.h wrapbox.c wrapbox.h \
              memblock.c memblock.h help.c help.h mybox.c mybox.h \
              gettext.h token.c token.h confhold.c confhold.h \
              memchunk.c memchunk.h md5c.c md5.h hmac-md5.c hmac-md5.h \
              bitarray.c bitarray.h str.c str.h stats.c stats.h \
              interface.c interface.h color.c color.h label.c label.h \
              topbar.c topbar.h procmail.c procmail.h frames.c frames.h \
              pgp.c pgp.h search.c search.h property.c property.h

bin_PROGRAMS = elmo
bin_SCRIPTS  = elmoconf.pl

dist_pkgdata_DATA = template

if EKG_SCANDIR
SCANDIR_elmo = scandir.c
else
SCANDIR_elmo =
endif

elmo_SOURCES = $(ZRODLA_elmo) $(SCANDIR_elmo)
elmo_LDADD   = $(LIBINTL) $(LIBICONV) $(GPGME_LIBS)

exec_headers = abook.h attach.h box_selection.h folder.h fetch.h \
               mailreader.h sender.h choose.h cmd.h bayes.h help.h mybox.h \
               wrapbox.h read.h interface.h debug.h smtp.h stats.h pgp.h \
               select.h

exec.o: exec_table.t

SUFFIXES = .inc
%.inc: inc.in interface.desc $(top_srcdir)/interface.pl
	$(top_srcdir)/interface.pl $(top_srcdir)/src/interface.desc $(top_srcdir)/src/inc.in


exec_table.t: $(exec_headers)
	rm -f exec_table.t
	(cat $(exec_headers) | $(top_srcdir)/exec_table.pl) >> exec_table.t
	$(top_srcdir)/src/funex.pl

confread.c: confread.l
	$(SHELL) $(YLWRAP) $< lex.cf.c $@ -- $(LEX) -Pcf -s -p

compose.c: compose.l
	$(SHELL) $(YLWRAP) $< lex.cm.c $@ -- $(LEX) -Pcm -s -p

full-clean: clean
	rm -f *~ debug.log xmalloc.log core* confread.c mlex.c compose.c \
        exec_table.t $(PLIKI_INC)

#install-data-hook:
#	$(top_srcdir)/src/elmoconf.pl --global --force


syntax highlighted by Code2HTML, v. 0.9.1