# Generated automatically from Makefile.in by configure.
#
# Makefile for ChaSen dictionary
#

#CC           = gcc
RM           = rm -f
CP           = cp
MKDICDIR     = ../mkchadic
CONNECT.jm   = JUMAN.connect
CONNECT.cha  = chasen.connect
CONNECT.vcha = connect.cha
SHELL        = /bin/sh
LIBDIR       = /usr/local/lib/chasen
DICDIR       = $(LIBDIR)/dic
MAKEINT      = transdic
MAKE         = make
GREP         = `./mkgrep.sh`

all: connect mat int pat

connect: $(CONNECT.jm) $(CONNECT.cha) $(CONNECT.vcha)

$(CONNECT.jm) $(CONNECT.cha) $(CONNECT.vcha):
	@ if [ -f $@.c ]; then \
	  echo "$(CC) -E $@.c | $(GREP) -v '^[#;]' > $@"; \
	  $(CC) -E $@.c | $(GREP) -v '^[#;]' > $@; \
	else exit 0; fi

conv:
	-$(CP) JUMAN.katuyou cforms.cha
	-$(CP) chasen.cforms cforms.cha
	-$(CP) JUMAN.kankei ctypes.cha
	-$(CP) chasen.ctypes ctypes.cha
	$(MKDICDIR)/convgram

mat:
	$(MKDICDIR)/makemat

int: trans sort

trans:
	$(MKDICDIR)/$(MAKEINT) *.dic > chadic.txt

sort:
	$(MKDICDIR)/sortdic chadic.txt > chadic.int
	$(RM) chadic.txt

pat:
	$(MKDICDIR)/pattool -F chadic

install:
	-mkdir $(DICDIR)
	sed 's#^MKDICDIR.*$$#MKDICDIR=$(MKDICDIR)#' Makefile > $(DICDIR)/Makefile
	-$(CP) chasen.* chadic.* *.cha $(DICDIR)

clean:
	$(RM) $(CONNECT.jm) $(CONNECT.cha) table.cha matrix.cha \
	chasen.table chasen.matrix jumandic.* chadic.*
