#
# default base directory for YAP installation
#
ROOTDIR = /usr/pkg
#
# where the binary should be
#
BINDIR = $(ROOTDIR)/bin
#
# where YAP should look for binary libraries
#
LIBDIR=${exec_prefix}/lib/Yap
#
# where YAP should look for architecture-independent Prolog libraries
#
SHAREDIR=$(ROOTDIR)/share
#
#
# You shouldn't need to change what follows.
#
INSTALL=/usr/bin/install -c -o pbulk -g users
INSTALL_DATA=/usr/bin/install -c -o pbulk -g users -m 644
INSTALL_PROGRAM=/usr/bin/install -c -s -o pbulk -g users -m 755
srcdir=.
YAP_EXTRAS= -DCOROUTINING=1 -DCUT_C=1 -DRATIONAL_TREES=1 -DDEPTH_LIMIT=1 -DTABLING=1 

EX_INSTALL_DIR=$(SHAREDIR)/doc/Yap/packages/examples/meld

EXDIR=$(srcdir)/examples

MELD_PROGRAMS= \
	$(srcdir)/meldtd.yap \
	$(srcdir)/meldc.yap \
	$(srcdir)/meldi.yap \
	$(srcdir)/meldp.yap

MELD_EXAMPLES= \
	$(EXDIR)/temperature/maxtemp.meld \
	$(EXDIR)/temperature/graph0.meld \
	$(EXDIR)/temperature/graph1.meld \
	$(EXDIR)/temperature/graph2.meld \
	$(EXDIR)/temperature/graph3.meld \
	$(EXDIR)/pagerank/pagerank.meld \

PROGRAMS= \
	$(srcdir)/meld.yap \
	$(MELD_PROGRAMS)

all:

install: $(PROGRAMS) $(EXAMPLES)
	mkdir -p $(DESTDIR)$(SHAREDIR)/Yap
	mkdir -p $(DESTDIR)$(SHAREDIR)/Yap/meld
	mkdir -p $(DESTDIR)$(EX_INSTALL_DIR)
	$(INSTALL_DATA) $(srcdir)/meld.yap $(DESTDIR)$(SHAREDIR)/Yap
	for p in $(MELD_PROGRAMS); do $(INSTALL_DATA) $$p $(DESTDIR)$(SHAREDIR)/Yap/meld; done
	for p in $(MELD_EXAMPLES); do $(INSTALL_DATA) $$p $(DESTDIR)$(EX_INSTALL_DIR); done

