srcdir = @srcdir@
VPATH = @srcdir@

CC = gcc
CPPFLAGS=-I. -I.. -DXERR
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@

DEFS = @DEFS@ -DCHARFILE=\"$(CHARFILE)\"
LIBS = @LIBS@
RANLIB = @RANLIB@
YACC = @YACC@
LEX = flex
prefix = /usr/local
exec_prefix = $(prefix)
binprefix =
manprefix =

bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
mandir = $(prefix)/man
manext = 1
AR=		ar
SHELL=		/bin/sh


BINDIR=		/usr/local/bin
LIBDIR=		/usr/local/lib/mail/charset

BINS=	gc conv chset

all:		$(BINS) chardefs.txt charsets.cpl

gc:		gc.o charset.h iso646.h dfopen.o
		$(CC) -o $@ $(CPPFLAGS) $(LDFLAGS) $(DEFS) gc.o dfopen.o
conv:		conv.o strncnv.o charset.h iso646.h dfopen.o baseqp.o
		$(CC) -o $@ $(CPPFLAGS) $(LDFLAGS) $(DEFS) conv.o strncnv.o dfopen.o baseqp.o

chset:	chset.o strncnv.o charset.h iso646.h dfopen.o
		$(CC) -o $@ $(CPPFLAGS) $(LDFLAGS) $(DEFS) chset.o strncnv.o dfopen.o

chardefs.txt:	iso10646.def control.def other.def 
		cat iso10646.def control.def other.def > chardefs.txt

charsets.cpl:	gc chardefs.txt charsets.def
		-mkdir cm
		./gc

install:	all
		cp charsets.cpl $(LIBDIR)


export:
		tar cf chset23b.tar *.c *.h *.def *.doc te makefile chars.req

clean:
		-rm -f *.o $(BINS) chardefs.txt cm/*  *.cpl iso10646.cm core; \
		if test -d cm ; then \
			rmdir cm ; \
		fi ;

.c.o:
		$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) -c $<


distclean: clean
	rm -f Makefile config.status config.h



