2005-10-28 18:41:30 +01:00
|
|
|
#
|
|
|
|
# default base directory for YAP installation
|
|
|
|
# (EROOT for architecture-dependent files)
|
|
|
|
#
|
|
|
|
prefix = @prefix@
|
|
|
|
ROOTDIR = $(prefix)
|
|
|
|
EROOTDIR = @exec_prefix@
|
|
|
|
|
|
|
|
srcdir=@srcdir@
|
|
|
|
|
|
|
|
SHELL=@SHELL@
|
|
|
|
PLBASE=@PLBASE@
|
|
|
|
PLARCH=@PLARCH@
|
2007-07-12 01:18:41 +01:00
|
|
|
PL=../../yap ../../startup
|
2005-10-28 18:41:30 +01:00
|
|
|
XPCEBASE=$(PLBASE)/xpce
|
|
|
|
PKGDOC=$(PLBASE)/doc/packages
|
|
|
|
PCEHOME=../../xpce
|
|
|
|
LIBDIR=$(PLBASE)/library
|
|
|
|
SHAREDIR=$(ROOTDIR)/share/Yap
|
|
|
|
CHRDIR=$(SHAREDIR)/chr
|
|
|
|
EXDIR=$(CHRDIR)/examples/chr
|
|
|
|
DESTDIR=
|
|
|
|
LN_S=@LN_S@
|
|
|
|
|
|
|
|
DOCTOTEX=$(PCEHOME)/bin/doc2tex
|
|
|
|
PLTOTEX=$(PCEHOME)/bin/pl2tex
|
|
|
|
LATEX=latex
|
|
|
|
DOC=chr
|
|
|
|
TEX=$(DOC).tex
|
|
|
|
DVI=$(DOC).dvi
|
|
|
|
PDF=$(DOC).pdf
|
|
|
|
HTML=$(DOC).html
|
|
|
|
|
|
|
|
INSTALL=@INSTALL@
|
|
|
|
INSTALL_PROGRAM=@INSTALL_PROGRAM@
|
|
|
|
INSTALL_DATA=@INSTALL_DATA@
|
|
|
|
|
|
|
|
|
|
|
|
LIBPL= $(srcdir)/chr_runtime.pl $(srcdir)/chr_op.pl chr_translate.pl $(srcdir)/chr_debug.pl \
|
|
|
|
$(srcdir)/chr_messages.pl $(srcdir)/hprolog.yap $(srcdir)/pairlist.pl $(srcdir)/clean_code.pl \
|
|
|
|
$(srcdir)/find.pl $(srcdir)/a_star.pl $(srcdir)/binomialheap.pl $(srcdir)/builtins.pl \
|
|
|
|
$(srcdir)/chr_hashtable_store.pl $(srcdir)/listmap.pl guard_entailment.pl \
|
|
|
|
$(srcdir)/chr_compiler_options.pl $(srcdir)/chr_compiler_utility.pl
|
|
|
|
CHRPL= $(srcdir)/chr_swi.pl
|
|
|
|
CHRYAP= $(srcdir)/chr.yap
|
|
|
|
EXAMPLES= $(srcdir)/Benchmarks/chrfreeze.chr $(srcdir)/Benchmarks/fib.chr $(srcdir)/Benchmarks/gcd.chr $(srcdir)/Benchmarks/primes.chr \
|
|
|
|
$(srcdir)/Benchmarks/bool.chr $(srcdir)/Benchmarks/family.chr $(srcdir)/Benchmarks/fibonacci.chr $(srcdir)/Benchmarks/leq.chr $(srcdir)/Benchmarks/listdom.chr \
|
|
|
|
$(srcdir)/Benchmarks/chrdif.chr
|
|
|
|
|
|
|
|
all: chr_translate.pl
|
|
|
|
|
|
|
|
chr_translate_bootstrap1.pl: $(srcdir)/chr_translate_bootstrap1.chr
|
|
|
|
$(PL) -l chr_swi_bootstrap.yap \
|
|
|
|
-g "chr_compile_step1('$<','$@'),halt." \
|
|
|
|
-z 'halt(1).'
|
|
|
|
$(PL) -l chr_swi_bootstrap.yap \
|
|
|
|
-g "chr_compile_step2('$<','$@'),halt." \
|
|
|
|
-z 'halt(1).'
|
|
|
|
|
2005-10-29 02:27:36 +01:00
|
|
|
chr_translate_bootstrap2.pl: $(srcdir)/chr_translate_bootstrap2.chr chr_translate_bootstrap1.pl
|
2005-10-28 18:41:30 +01:00
|
|
|
$(PL) -l chr_swi_bootstrap.yap \
|
|
|
|
-g "chr_compile_step2('$<','$@'),halt." \
|
|
|
|
-z 'halt(1).'
|
|
|
|
$(PL) -l chr_swi_bootstrap.yap \
|
|
|
|
-g "chr_compile_step3('$<','$@'),halt." \
|
|
|
|
-z 'halt(1).'
|
|
|
|
|
|
|
|
guard_entailment.pl: $(srcdir)/guard_entailment.chr chr_translate_bootstrap2.pl
|
|
|
|
$(PL) -l chr_swi_bootstrap.yap \
|
|
|
|
-g "chr_compile_step3('$<','$@'),halt." \
|
|
|
|
-z 'halt(1).'
|
|
|
|
|
|
|
|
chr_translate.pl: $(srcdir)/chr_translate.chr chr_translate_bootstrap2.pl guard_entailment.pl
|
|
|
|
$(PL) -l chr_swi_bootstrap.yap \
|
|
|
|
-g "chr_compile_step3('$<','$@'),halt." \
|
|
|
|
-z 'halt(1).'
|
|
|
|
$(PL) -p chr=. -l chr_swi_bootstrap.yap \
|
|
|
|
-g "chr_compile_step4('guard_entailment.chr','guard_entailment.pl'),halt." \
|
|
|
|
-z 'halt(1).'
|
|
|
|
$(PL) -p chr=. -l chr_swi_bootstrap.yap \
|
|
|
|
-g "chr_compile_step4('$<','$@'),halt." \
|
|
|
|
-z 'halt(1).'
|
|
|
|
|
|
|
|
chr.pl: chr_swi.pl
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
install: chr_translate.pl guard_entailment.pl
|
|
|
|
mkdir -p $(DESTDIR)$(CHRDIR)
|
|
|
|
$(INSTALL) -m 644 $(LIBPL) $(DESTDIR)$(CHRDIR)
|
|
|
|
$(INSTALL) -m 644 $(CHRPL) $(DESTDIR)$(SHAREDIR)/chr.pl
|
|
|
|
$(INSTALL) -m 644 $(CHRYAP) $(DESTDIR)$(SHAREDIR)
|
|
|
|
$(INSTALL) -m 644 $(srcdir)/README $(DESTDIR)$(CHRDIR)
|
|
|
|
# $(PL) -g make -z halt
|
|
|
|
|
|
|
|
rpm-install: install
|
|
|
|
|
|
|
|
pdf-install: install-examples
|
|
|
|
|
|
|
|
html-install: install-examples
|
|
|
|
|
|
|
|
install-examples::
|
|
|
|
mkdir -p $(DESTDIR)$(EXDIR)
|
|
|
|
(cd Examples && $(INSTALL_DATA) $(EXAMPLES) $(DESTDIR)$(EXDIR))
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
(cd $(PLBASE)/library && rm -f $(LIBPL))
|
|
|
|
$(PL) -f none -g make -t halt
|
|
|
|
|
|
|
|
check: chr.pl
|
|
|
|
$(PL) -f chr_test.pl -g test,halt -t 'halt(1)'
|
|
|
|
|
|
|
|
|
|
|
|
################################################################
|
|
|
|
# Documentation
|
|
|
|
################################################################
|
|
|
|
|
|
|
|
doc: $(PDF) $(HTML)
|
|
|
|
pdf: $(PDF)
|
|
|
|
html: $(HTML)
|
|
|
|
|
|
|
|
$(HTML): $(TEX)
|
|
|
|
latex2html $(DOC)
|
|
|
|
mv html/index.html $@
|
|
|
|
|
|
|
|
$(PDF): $(TEX)
|
|
|
|
runtex --pdf $(DOC)
|
|
|
|
|
|
|
|
$(TEX): $(DOCTOTEX)
|
|
|
|
|
|
|
|
.doc.tex:
|
|
|
|
$(DOCTOTEX) $*.doc > $*.tex
|
|
|
|
.pl.tex:
|
|
|
|
$(PLTOTEX) $*.pl > $*.tex
|
|
|
|
|
|
|
|
################################################################
|
|
|
|
# Clean
|
|
|
|
################################################################
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *~ *% config.log
|
|
|
|
rm -f chr.pl chr_translate.pl
|
|
|
|
rm -f chr_translate_bootstrap1.pl chr_translate_bootstrap2.pl
|
|
|
|
rm -f guard_entailment.pl
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
rm -f $(TARGETS) config.h config.cache config.status Makefile
|
|
|
|
rm -f $(TEX)
|
|
|
|
runtex --clean $(DOC)
|