include ../../Makefile.defs

PL= cug.pl cf_grammar.pl declarations.pl lexicon.pl interface.pl \
       parser.pl start.pl ubg_utils.pl shift_reduce.pl suite.pl types.pl

install : 
	cp TC $(BINDIR)

state : $(HDRUG) $(PL) TC
	( echo "ensure_loaded(start).";\
          echo "initialization(x).";\
          echo "save_program(state).") | $(HDRUG) -f 

script : TC
	echo '#!/bin/sh' > script
	echo $(HDRUG) -f -l x '$$*' >> script
	chmod +x script

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


clean :
	rm $(RM_PATTERN) state script TC
