8350d52c78
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2305 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
158 lines
4.6 KiB
Makefile
158 lines
4.6 KiB
Makefile
#
|
|
# default base directory for YAP installation
|
|
# (EROOT for architecture-dependent files)
|
|
#
|
|
prefix = @prefix@
|
|
ROOTDIR = $(prefix)
|
|
EROOTDIR = @exec_prefix@
|
|
|
|
srcdir=@srcdir@
|
|
|
|
BINDIR = $(EROOTDIR)/bin
|
|
LIBDIR=$(EROOTDIR)/lib
|
|
YAPLIBDIR=$(EROOTDIR)/lib/Yap
|
|
SHAREDIR=$(ROOTDIR)/share
|
|
|
|
SHELL=@SHELL@
|
|
PL=@EXTEND_DYNLOADER_PATH@ $(DESTDIR)$(BINDIR)/yap $(DESTDIR)$(YAPLIBDIR)/startup
|
|
CHRDIR=$(SHAREDIR)/chr
|
|
EXDIR=$(CHRDIR)/examples/chr
|
|
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.pl $(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_errors.pl \
|
|
$(srcdir)/chr_compiler_options.pl $(srcdir)/chr_compiler_utility.pl \
|
|
$(srcdir)/chr_integertable_store.pl
|
|
CHRPL= $(srcdir)/chr_swi.pl
|
|
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
|
|
|
|
GPLDIR= $(srcdir)/../../GPL
|
|
LGPLDIR= $(srcdir)/../../LGPL
|
|
EXTRALIBDIR= $(srcdir)/../../library
|
|
GPLLIBPL= $(EXTRALIBDIR)/aggregate.pl $(EXTRALIBDIR)/error.pl $(EXTRALIBDIR)/occurs.yap $(EXTRALIBDIR)/pairs.pl
|
|
LGPLLIBPL= $(EXTRALIBDIR)/maplist.pl
|
|
EXTRALIBPL= $(GPLLIBPL) $(LGPLLIBPL)
|
|
|
|
all: chr_translate.pl
|
|
|
|
chr_translate_bootstrap1.pl: $(srcdir)/chr_translate_bootstrap1.chr $(EXTRALIBPL)
|
|
$(PL) -f -l chr_swi_bootstrap.yap \
|
|
-g "chr_compile_step1('$<','$@'),halt." \
|
|
-z 'halt(1).'
|
|
$(PL) -f -l chr_swi_bootstrap.yap \
|
|
-g "chr_compile_step2('$<','$@'),halt." \
|
|
-z 'halt(1).'
|
|
|
|
chr_translate_bootstrap2.pl: $(srcdir)/chr_translate_bootstrap2.chr chr_translate_bootstrap1.pl
|
|
$(PL) -f -l chr_swi_bootstrap.yap \
|
|
-g "chr_compile_step2('$<','$@'),halt." \
|
|
-z 'halt(1).'
|
|
$(PL) -f -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) -f -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) -f -l chr_swi_bootstrap.yap \
|
|
-g "chr_compile_step3('$<','$@'),halt." \
|
|
-z 'halt(1).'
|
|
$(PL) -f -p chr=. -l chr_swi_bootstrap.yap \
|
|
-g "chr_compile_step4('guard_entailment.chr','guard_entailment.pl'),halt." \
|
|
-z 'halt(1).'
|
|
$(PL) -f -p chr=. -l chr_swi_bootstrap.yap \
|
|
-g "chr_compile_step4('$<','$@'),halt." \
|
|
-z 'halt(1).'
|
|
|
|
chr.pl: chr_swi.pl
|
|
cp $< $@
|
|
|
|
$(GPLLIBPL): $(EXTRALIBDIR)/%: $(GPLDIR)/%
|
|
cp $< $@
|
|
$(LGPLLIBPL): $(EXTRALIBDIR)/%: $(LGPLDIR)/%
|
|
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 $(srcdir)/README $(DESTDIR)$(CHRDIR)
|
|
# $(PL) -f -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)
|