SHELL = /bin/sh
INSTALL = @INSTALL@

srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
installroot = @installroot@
exec_prefix = @exec_prefix@

bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include

REPL_EXT=@replsuffix@
SPEC_EXT=@specsuffix@
LIB_DIR=@datadir@/catdoc

all: @charsetcheck@
clean:
install: install-dirs install-spc install-charsets
install-spc: tex.spc ascii.spc tex.rpl ascii.rpl
	    $(INSTALL) -m 644 ascii.spc $(installroot)$(LIB_DIR)/ascii$(SPEC_EXT) 
	    $(INSTALL) -m 644 tex.spc $(installroot)$(LIB_DIR)/tex$(SPEC_EXT) 
	    $(INSTALL) -m 644 ascii.rpl $(installroot)$(LIB_DIR)/ascii$(REPL_EXT)
	    $(INSTALL) -m 644 tex.rpl $(installroot)$(LIB_DIR)/tex$(REPL_EXT)
install-charsets:
	for i in *.txt; do\
	   $(INSTALL) -m 0644 $$i $(installroot)$(LIB_DIR);\
	done
install-dirs:
	../mkinstalldirs $(installroot)$(LIB_DIR)
distclean:
	rm Makefile
