include ../Makefile.defs

QL=cmd.ql\
   go.ql\
   start.ql\
   tk.ql\
   st_tty.ql\
   st_tex.ql\
   st_blt.ql\
   show.ql

all : 
	( cd library ; make )
	make Hdrug

.SUFFIXES: .ql .pl

.pl.ql:
	-echo 'prolog_flag(compiling,_,$(PLFLAGS)), fcompile($*).' | protcl -f

# if you want to start start.pl without the makefile, add the following
# three assertions in your .sicstusrc, and don't use the -f switch to protcl
Hdrug : $(QL) library/*.pl library/*.ql library/f/*.pl library/f/*.ql
	( echo "asserta(hdrug_library('$(CWD)/Tcl')). ";\
	  echo "asserta(library_directory('$(PROTCL)')). ";\
	  echo "asserta(library_directory('$(CWD)/Prolog/library')). ";\
          echo "ensure_loaded(start)."       ;\
          echo "save_program('Hdrug'), header.") \
        | protcl -f

clean : 
	rm $(RM_PATTERN) Hdrug
	( cd library ; make clean )

