experimental active_in_guard pragma
[chr.git] / Makefile.in
blob197a8b7137ba09d4ecac9c274447cba8be93d429
1 ################################################################
2 # SWI-Prolog CHR package
3 # Author: Jan Wielemaker. jan@swi.psy.uva.nl
4 # Copyright: LGPL (see COPYING or www.gnu.org
5 ################################################################
7 .SUFFIXES: .tex .dvi .doc .pl
9 SHELL=@SHELL@
10 PLBASE=@PLBASE@
11 PLARCH=@PLARCH@
12 PL=@PL@
13 XPCEBASE=$(PLBASE)/xpce
14 PKGDOC=$(PLBASE)/doc/packages
15 PCEHOME=../../xpce
16 LIBDIR=$(PLBASE)/library
17 CHRDIR=$(LIBDIR)/chr
18 EXDIR=$(PKGDOC)/examples/chr
19 DESTDIR=
21 DOCTOTEX=$(PCEHOME)/bin/doc2tex
22 PLTOTEX=$(PCEHOME)/bin/pl2tex
23 LATEX=latex
24 DOC=chr
25 TEX=$(DOC).tex
26 DVI=$(DOC).dvi
27 PDF=$(DOC).pdf
28 HTML=$(DOC).html
30 INSTALL=@INSTALL@
31 INSTALL_PROGRAM=@INSTALL_PROGRAM@
32 INSTALL_DATA=@INSTALL_DATA@
34 LIBPL= chr_runtime.pl chr_op.pl chr_translate.pl chr_debug.pl \
35 chr_messages.pl hprolog.pl pairlist.pl clean_code.pl \
36 find.pl a_star.pl binomialheap.pl builtins.pl \
37 chr_hashtable_store.pl listmap.pl guard_entailment.pl \
38 chr_compiler_options.pl chr_compiler_utility.pl chr_compiler_errors.pl \
39 chr_integertable_store.pl
40 CHRPL= chr_swi.pl
41 EXAMPLES= chrfreeze.chr fib.chr gcd.chr primes.chr \
42 bool.chr family.chr fibonacci.chr leq.chr listdom.chr \
43 chrdif.chr
45 all: chr_translate.pl
47 chr_translate_bootstrap1.pl: chr_translate_bootstrap1.chr
48 $(PL) -q -f chr_swi_bootstrap.pl \
49 -g "chr_compile_step1('$<','$@'),halt" \
50 -t 'halt(1)'
51 $(PL) -q -f chr_swi_bootstrap.pl \
52 -g "chr_compile_step2('$<','$@'),halt" \
53 -t 'halt(1)'
55 chr_translate_bootstrap2.pl: chr_translate_bootstrap2.chr chr_translate_bootstrap1.pl
56 $(PL) -q -f chr_swi_bootstrap.pl \
57 -g "chr_compile_step2('$<','$@'),halt" \
58 -t 'halt(1)'
59 $(PL) -q -f chr_swi_bootstrap.pl \
60 -g "chr_compile_step3('$<','$@'),halt" \
61 -t 'halt(1)'
63 guard_entailment.pl: guard_entailment.chr chr_translate_bootstrap2.pl
64 $(PL) -q -f chr_swi_bootstrap.pl \
65 -g "chr_compile_step3('$<','$@'),halt" \
66 -t 'halt(1)'
68 chr_translate.pl: chr_translate.chr chr_translate_bootstrap2.pl guard_entailment.pl
69 $(PL) -q -f chr_swi_bootstrap.pl \
70 -g "chr_compile_step3('$<','$@'),halt" \
71 -t 'halt(1)'
72 $(PL) -L50M -G50M -T20M -p chr=. -q -f chr_swi_bootstrap.pl \
73 -g "chr_compile_step4('guard_entailment.chr','guard_entailment.pl'),halt" \
74 -t 'halt(1)'
75 $(PL) -L50M -G50M -T20M -p chr=. -q -f chr_swi_bootstrap.pl \
76 -g "chr_compile_step4('$<','$@'),halt" \
77 -t 'halt(1)'
79 chr.pl: chr_swi.pl
80 cp $< $@
82 install: $(LIBPL)
83 mkdir -p $(DESTDIR)$(CHRDIR)
84 $(INSTALL_DATA) $(LIBPL) $(DESTDIR)$(CHRDIR)
85 $(INSTALL_DATA) $(CHRPL) $(DESTDIR)$(LIBDIR)/chr.pl
86 $(INSTALL_DATA) README $(DESTDIR)$(CHRDIR)
87 $(PL) -f none -g make -t halt
89 ln-install::
90 @$(MAKE) INSTALL_DATA='../ln-install' install
92 rpm-install: install
94 pdf-install: install-examples
96 html-install: install-examples
98 install-examples::
99 mkdir -p $(DESTDIR)$(EXDIR)
100 (cd Examples && $(INSTALL_DATA) $(EXAMPLES) $(DESTDIR)$(EXDIR))
102 uninstall:
103 (cd $(PLBASE)/library && rm -f $(LIBPL))
104 $(PL) -f none -g make -t halt
106 check: chr.pl
107 $(PL) -q -f chr_test.pl -g test,halt -t 'halt(1)'
110 ################################################################
111 # Documentation
112 ################################################################
114 # NOTE: Manual is integrated in system manual
116 doc: $(PDF) $(HTML)
117 pdf: $(PDF)
118 #html: $(HTML)
119 html::
121 $(HTML): $(TEX)
122 latex2html $(DOC)
123 mv html/index.html $@
125 $(PDF): $(TEX)
126 ../../man/runtex --pdf $(DOC)
128 $(TEX): $(DOCTOTEX)
130 .doc.tex:
131 $(DOCTOTEX) $*.doc > $*.tex
132 .pl.tex:
133 $(PLTOTEX) $*.pl > $*.tex
135 ################################################################
136 # Clean
137 ################################################################
139 clean:
140 rm -f *~ *% config.log
141 rm -f chr.pl chr_translate.pl
142 rm -f chr_translate_bootstrap1.pl chr_translate_bootstrap2.pl
143 rm -f guard_entailment.pl
145 distclean: clean
146 rm -f $(TARGETS) config.h config.cache config.status Makefile
147 rm -f $(TEX)
148 ../../man/runtex --clean $(DOC)