# files that are not compiled are files for which it is not
# known in which module they will be loaded
#
# hence, files are compiled that
# A  define a seperate module
# B  are always loaded into user
# C  are always loaded into Module
#
# D special rules are also necc. for files that need
# special operator declarations.
#
# note that C and D case are handled in seperate dir's
# at the moment

#uncomment and change for your setup
#PROLOG=sicstus
#PLFLAGS=compactcode
#APPDEFS=$(HOME)/lib/app-defaults
RM_PATTERN=-f *.ql *~ *.orig

QL= between.ql\
	call_tree.ql\
	command.ql\
	concat.ql\
	count_edges.ql\
	database.ql\
	decons.ql\
	env.ql\
	equi.ql\
	feature.ql\
	flags.ql\
	gen_sym.ql\
	latex.ql\
	link_clause.ql\
	partial.ql\
	prettyvars.ql\
	p_tree.ql\
	restrict.ql\
	show.ql\
   	term_expand.ql\
	tk_draw.ql\
	tk_tree.ql\
	tk_menu.ql\
	transitive.ql\
	wlists.ql

all: $(QL) 
	( cd f ; make PROLOG=$(PROLOG) PLFLAGS=$(PLFLAGS))

install:
	rm -f $(APPDEFS)/SP_menu
	ln -s `pwd`/SP_menu.ad $(APPDEFS)/SP_menu

# default
.SUFFIXES: .ql .pl
.pl.ql:
	-echo 'prolog_flag(compiling,_,$(PLFLAGS)), fcompile($*).' | $(PROLOG) -f 
	touch .changed

clean:
	rm $(RM_PATTERN)
	( cd f ; make clean RM_PATTERN='$(RM_PATTERN)')
