# Generated automatically from Makefile.in by configure.
#
#
# Copyright (C) 1994 Swedish University Network (SUNET)
#
#
# This program is developed by UDAC, Uppsala University by commission
# of the Swedish University Network (SUNET). 
# 
# 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; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITTNESS 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
#                                          Martin.Wendel@its.uu.se
#					   Torbjorn.Wictorin@its.uu.se
#
#                                          ITS
#                                          P.O. Box 887
#                                          S-751 08 Uppsala
#                                          Sweden
#
# Start of user defines
#######################

# Binaries will be installed in bindir and configuration files in
# libdir. Modify as needed.
#
prefix = /usr/local
exec_prefix = ${prefix}
#binprefix =
#manprefix =

bindir = ${exec_prefix}/bin
datadir = ${prefix}/share
libdir = ${exec_prefix}/lib
mandir = ${prefix}/man
manext = 1

MAINCF = $(libdir)/emil.cf
CHARFILE = $(libdir)/charsets.cpl
LOG_FACILITY = LOG_MAIL

#
# Add extra facilities to the CLIENTS field.
#
# -DSMTP 	 	Enables the use of SMTP delivery. If omitted will 
#			disable the function of the '-n' flag.
#
# -DNAMED_BIND		Use nameserver to look up hostname when using SMTP.
#
# -DUSE_MX		Use MX-records instead of A-records.
#
# -DDEBUG		Enable use of the debug flag.
#
# -DOLD_UNIX_FROM 	Omission of -u flag removes existing unix from 
#			style header with OLD_UNIX_FROM defined. If you
#			rely on this (probably not) specify -DOLD_UNIX_FROM
#			in CLIENTS below.
#
# NAMED_BIND and USE_MX require the res_search() routine. If not
# found by configure (for example on standard SunOS) these will
# be ignored.
#
CLIENTS = -DSMTP -DNAMED_BIND -DUSE_MX -DDEBUG

#
# Modify SMTPHOSTNAME (if using SMTP) to the FQDN of this host.
#
SMTPHOSTNAME = host.domain

# End of user defines
#####################

srcdir = .
CC = gcc
#CPPFLAGS = -I.
#CFLAGS = -g -DDEBUG
#LDFLAGS = -g
CPPFLAGS = 
CFLAGS = -fno-common
LDFLAGS = 
INSTALL = /usr/bin/install -c -o root -g wheel
INSTALL_PROGRAM = install  -s -o root -g wheel -m 555
INSTALL_DATA = install  -o root -g wheel -m 444
EMILPATH = $(bindir)/emil
VERSION = 2.1.0-beta9
cffile = \"$(MAINCF)\"
charsetsfile = \"$(CHARFILE)\"
sendmailpath = \"$(SENDMAILPATH)\"
sendmailprog = \"$(SENDMAILPROG)\"
senderflag = \"$(SENDERFLAG)\"
MFLAGS = "CHARFILE=$(CHARFILE)" "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)"

DEFS = -DHAVE_CONFIG_H $(CLIENTS) -DMAINCF=$(cffile) -DCHARFILE=$(charsetsfile) -DSENDMAILPATH=$(sendmailpath) -DSENDMAILPROG=$(sendmailprog) -DSENDERFLAG=$(senderflag) -DLOG_FACILITY=$(LOG_FACILITY) -DSMTPHOSTNAME=\"$(SMTPHOSTNAME)\" -DEMIL_VERSION=\"$(VERSION)\" -DEMILPATH=\"$(EMILPATH)\"
LIBS = -lresolv -lm -lintl 
RANLIB = ranlib
YACC = byacc
LEX = flex
LEXLIB = -lfl
AR=		ar
SHELL=		/bin/sh

CHARDIR = $(srcdir)/charset


SRCS=	7bit.c appledouble.c applefile.c applesingle.c base64.c binary.c binhex.c \
	buffer.c convert.c filenames.c forks.c format.c hbase64.c header.c \
	hqp.c hqxbin.c load.c logger.c mailtool.c main.c message.c mime.c \
	mimeparse.c ns.c out.c qp.c rfc1522.c rfc822.c rfc822parse.c \
	smtp.c structure.c sunparse.c uuencode.c \
	s_attr.c d_attr.c a_attr.c
OBJS=	7bit.o appledouble.o applefile.o applesingle.o base64.o binary.o binhex.o \
	buffer.o convert.o filenames.o forks.o format.o hbase64.o header.o \
	hqp.o hqxbin.o load.o logger.o mailtool.o main.o message.o mime.o \
	mimeparse.o ns.o out.o qp.o rfc1522.o rfc822.o rfc822parse.o \
	smtp.o structure.o sunparse.o uuencode.o \
	s_attr.o d_attr.o a_attr.o
HDRS=	emil.h attr.h acconfig.h func.h

RESTFILES = COPYING ChangeLog Makefile.in emil.cf README.2.0.4\
README.FIRST README COPYRIGHT INSTALL configure.in mkinstalldirs emil.man \
emil.cf.man helper.c getoption.l getoption.y configure \
config.h.in README.2.1.0 install-sh \
BUGS charset.c charset/*.[ch] charset/*.req charset/*.def charset/*.doc \
charset/*.in charset/*.cm 
DOCS = doc/arrow_left3.gif doc/index.shtml doc/why.html doc/way.html \
doc/control.html doc/arguments.html doc/details.html doc/using.html \
doc/configuration.html doc/intro.html doc/main.html doc/arrow_right3.gif \
doc/arrow_up2.gif doc/binpobox.gif doc/comparison.html doc/design-top.html \
doc/figure1.gif doc/figure2.gif doc/figure3.gif doc/analysis.html \
doc/figure4.gif doc/design-spec.html doc/problem-statement.html \
doc/figure5.gif doc/rfc1521.html doc/rfc1522.html doc/rfc822.html \
doc/figure6.gif doc/figure7.gif doc/setting.html doc/input.html \
doc/output.html doc/emil.cf.html doc/end.html
DISTFILES = $(SRCS) $(HDRS) $(RESTFILES) $(DOCS)
TESTFILES = testdir-2.1.0/*test testdir-2.1.0/emil.cf \
testdir-2.1.0/message[1-9]* testdir-2.1.0/README

all: emil man helper finish

finish:
	@echo " "
	@echo " "
	@echo "Now type 'make install' to install the necessery files"
	@echo " "
	@echo "Try the program \"helper\" to get support on how to setup"
	@echo "conversion on the local mailer of sendmail"

.c.o:   emil.h
	$(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) $(CFLAGS) $(UNIQUE) $<

helper: helper.c emil.h
	$(CC) -o helper $(CPPFLAGS) $(DEFS) -I$(srcdir) $(CFLAGS) $(UNIQUE) helper.c

CHARSET: emil.h
	cd $(CHARDIR); $(MAKE) $(MFLAGS) all

charset.o: charset.c emil.h $(CHARDIR)/strncnv.c
	$(CC) -c -I$(CHARDIR) $(DEFS) -DEMIL -I$(srcdir) $(CFLAGS) $(UNIQUE) charset.c


emil: CHARSET emilx


emilx: $(OBJS) charset.o getoption.o $(CHARDIR)/dfopen.o emil.h
	$(CC) -o emil $(LDFLAGS) $(OBJS) charset.o getoption.o $(CHARDIR)/dfopen.o $(LIBS)

getoption.o:		y.tab.c lex.yy.c emil.h
			$(CC) -c $(DEFS) $(CFLAGS) -o getoption.o y.tab.c

y.tab.c:		getoption.y
			$(YACC) -l -v getoption.y

lex.yy.c:		getoption.l
			$(LEX)  -i getoption.l


man: 
	cp emil.man emil.$(manext)
	cp emil.cf.man emil.cf.$(manext)
	@rm -f config.ed
	@echo "1,\$$s'^MAINCF'$(MAINCF)'g" > config.ed
	@echo "w"		>> config.ed
	@echo "q"		>> config.ed
	ed emil.cf.$(manext) <config.ed
	@rm -f config.ed
	@echo "1,\$$s'^MAINCF'$(MAINCF)'g" > config.ed
	@echo "1,\$$s'^CHARFILE'$(CHARFILE)'g"	>> config.ed
	@echo "w"		>> config.ed
	@echo "q"		>> config.ed
	ed emil.$(manext) <config.ed

manprint: man
	psroff -man emil.$(manext)
	psroff -man emil.cf.$(manext)

test:
	@cd testdir-2.1.0; \
	./emiltest Group ;\
	./emiltest Compound ;\
	./emiltest Buffer ;\
	./emiltest Misc;

install: installdirs
	@if test -f emil ; then \
		if test -f $(bindir)/emil ; then \
			echo " " ;\
			echo "Saving $(bindir)/emil in $(bindir)/emil.bak" ; \
			mv $(bindir)/emil $(bindir)/emil.bak ; \
		fi ; \
		echo " " ;\
		echo "Installing emil as $(bindir)/emil" ; \
		$(INSTALL_PROGRAM) emil $(bindir)/emil ; \
	fi ;
	@if test -f emil.cf ; then \
		if test -f $(MAINCF) ; then \
			echo " " ;\
			echo "Keeping $(MAINCF) as is" ; \
			echo " " ;\
			echo "*********************************************" ;\
			echo "The syntax of emil.cf has changed somewhat." ;\
			echo "A new mailer field has been added." ;\
			echo "You should also check the Match lines in ./emil.cf" ;\
			echo "and include the ones not in your original" ; \
			echo "$(MAINCF)." ; \
			echo "*********************************************" ;\
		else \
			echo " " ;\
			echo "Installing emil.cf as $(MAINCF)" ; \
			$(INSTALL_DATA) emil.cf $(MAINCF) ; \
		fi ; \
	fi ;
	@if test -f charset/charsets.cpl ; then \
		if test -f $(CHARFILE) ; then \
			echo " " ;\
			echo "Keeping $(CHARFILE) as is" ; \
		else \
			echo " " ;\
			echo "Installing charset/charsets.cpl as $(CHARFILE)";\
			$(INSTALL_DATA) charset/charsets.cpl $(CHARFILE); \
			 chmod 444 $(CHARFILE) ; \
		fi ; \
	fi ;
	@if test -f emil.$(manext) ; then \
		echo " " ;\
		echo "Installing emil.$(manext) in $(mandir)/man$(manext)";\
		$(INSTALL_DATA) emil.$(manext) $(mandir)/man$(manext); \
	fi ;
	@if test -f emil.cf.$(manext) ; then \
		echo " " ;\
		echo "Installing emil.cf.$(manext) in $(mandir)/man$(manext)";\
		$(INSTALL_DATA) emil.cf.$(manext) $(mandir)/man$(manext); \
	fi ;
	@echo " " ;
.if !defined(NOPORTDOCS)
	@echo "Installing doc files in $(datadir)/doc/emil" ;
	@$(INSTALL_DATA) $(DOCS) $(datadir)/doc/emil/
.endif
	@echo " " ;
	@echo "Installation done." ;

installdirs:
	$(srcdir)/mkinstalldirs $(bindir) $(datadir)/doc/emil $(libdir) $(mandir)/man$(manext)

uninstall: 
	if test -f $(bindir)/emil ; then \
		rm $(bindir)/emil ; \
	fi ;\
	if test -f $(MAINCF) ; then \
		 rm $(MAINCF); \
	fi ;\
	if test -f $(CHARFILE) ; then \
		 rm $(CHARFILE); \
	fi ;\
	if test -f $(mandir)/man$(manext)/emil.$(manext) ; then \
		 rm $(mandir)/man$(manext)/emil.$(manext); \
	fi ;\
	if test -f $(mandir)/man$(manext)/emil.cf.$(manext) ; then \
		 em $(mandir)/man$(manext)/emil.cf.$(manext) ; \
	fi

Makefile: Makefile.in config.status
	$(SHELL) config.status

config.status: configure
	$(SHELL) config.status --recheck

configure: configure.in
	cd $(srcdir); autoconf

config.h.in: configure.in
	cd $(srcdir); autoheader

TAGS: $(SRCS)
	etags $(SRCS)

clean:
	rm -f *.o emil helper y.tab.c lex.yy.c getoption.o getoption.c core ; \
	cd charset; make clean

mostlyclean: clean

distclean: clean
	rm -f Makefile config.status config.h config.cache config.log;\
	cd charset; make distclean

realclean: distclean
	rm -f TAGS

devdist: $(DISTFILES)
	if test ! -d emil-$(VERSION)-dev; then \
		mkdir emil-$(VERSION)-dev; \
	fi ; \
	tar cvf - $(DISTFILES) | (cd emil-$(VERSION)-dev; tar xf -) ; \
	tar cf - emil-$(VERSION)-dev | gzip > emil-$(VERSION)-dev.tar.gz

dist: $(DISTFILES)
	if test ! -d emil-$(VERSION); then \
		mkdir emil-$(VERSION); \
	fi ; \
	for file in $(SRCS) $(HDRS) ; do \
		cp COPYRIGHT emil-$(VERSION)/$$file; \
		cat $$file >> emil-$(VERSION)/$$file; \
	done; \
	tar cvf - $(RESTFILES) $(DOCS) | (cd emil-$(VERSION); tar xf -) ; \
	tar cof - emil-$(VERSION) | gzip > emil-$(VERSION).tar.gz

testdist: $(TESTFILES)
	tar cof testdir-$(VERSION).tar testdir-2.1.0; \
	gzip testdir-$(VERSION).tar



syntax highlighted by Code2HTML, v. 0.9.1