include ../../Makefile.defs

PL=start.pl approx.pl inflection.pl decl.pl lexicon.pl rules.pl\
templates.pl types.pl compilation.pl wlists.pl

install :
	cp TL $(BINDIR)

state : $(HDRUG) $(PL) PG/*.pl TL
	( cd PG ; make)
	( echo "ensure_loaded(start). ";\
	  echo "initialization(x). ";\
          echo "save_program(state).") | $(HDRUG) -f

script : PG/*.pl TL
	( cd PG ; make)
	echo '#!/bin/sh' > script
	echo $(HDRUG) -f -l x '$$*' >> script
	chmod +x script

TL :
	echo "( cd `pwd` ; " '$(HDRUGXTERM) -e ./$(STATE_OR_SCRIPT) -f $$*)' > TL
	chmod +x TL

clean:
	rm $(RM_PATTERN) state script TL
	( cd PG ; make clean)

