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
13 XPCEBASE
=$(PLBASE
)/xpce
14 PKGDOC
=$(PLBASE
)/doc
/packages
16 LIBDIR
=$(PLBASE
)/library
18 EXDIR
=$(PKGDOC
)/examples
/chr
21 DOCTOTEX
=$(PCEHOME
)/bin
/doc2tex
22 PLTOTEX
=$(PCEHOME
)/bin
/pl2tex
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
40 EXAMPLES
= chrfreeze.chr fib.chr gcd.chr primes.chr \
41 bool.chr family.chr fibonacci.chr leq.chr listdom.chr \
46 chr_translate_bootstrap1.pl
: chr_translate_bootstrap1.chr
47 $(PL
) -q
-f chr_swi_bootstrap.pl \
48 -g
"chr_compile_step1('$<','$@'),halt" \
50 $(PL
) -q
-f chr_swi_bootstrap.pl \
51 -g
"chr_compile_step2('$<','$@'),halt" \
54 chr_translate_bootstrap2.pl
: chr_translate_bootstrap2.chr chr_translate_bootstrap1.pl
55 $(PL
) -q
-f chr_swi_bootstrap.pl \
56 -g
"chr_compile_step2('$<','$@'),halt" \
58 $(PL
) -q
-f chr_swi_bootstrap.pl \
59 -g
"chr_compile_step3('$<','$@'),halt" \
62 guard_entailment.pl
: guard_entailment.chr chr_translate_bootstrap2.pl
63 $(PL
) -q
-f chr_swi_bootstrap.pl \
64 -g
"chr_compile_step3('$<','$@'),halt" \
67 chr_translate.pl
: chr_translate.chr chr_translate_bootstrap2.pl guard_entailment.pl
68 $(PL
) -q
-f chr_swi_bootstrap.pl \
69 -g
"chr_compile_step3('$<','$@'),halt" \
71 $(PL
) -p chr
=.
-q
-f chr_swi_bootstrap.pl \
72 -g
"chr_compile_step4('guard_entailment.chr','guard_entailment.pl'),halt" \
74 $(PL
) -L10M
-p chr
=.
-q
-f chr_swi_bootstrap.pl \
75 -g
"chr_compile_step4('$<','$@'),halt" \
82 mkdir
-p
$(DESTDIR
)$(CHRDIR
)
83 $(INSTALL
) -m
644 $(LIBPL
) $(DESTDIR
)$(CHRDIR
)
84 $(INSTALL
) -m
644 $(CHRPL
) $(DESTDIR
)$(LIBDIR
)/chr.pl
85 $(INSTALL
) -m
644 README
$(DESTDIR
)$(CHRDIR
)
86 $(PL
) -f none
-g make
-t halt
90 pdf-install
: install-examples
92 html-install
: install-examples
95 mkdir
-p
$(DESTDIR
)$(EXDIR
)
96 (cd Examples
&& $(INSTALL_DATA
) $(EXAMPLES
) $(DESTDIR
)$(EXDIR
))
99 (cd
$(PLBASE
)/library
&& rm -f
$(LIBPL
))
100 $(PL
) -f none
-g make
-t halt
103 $(PL
) -q
-f chr_test.pl
-g
test,halt
-t
'halt(1)'
106 ################################################################
108 ################################################################
116 mv html
/index.html
$@
124 $(DOCTOTEX
) $*.doc
> $*.
tex
126 $(PLTOTEX
) $*.pl
> $*.
tex
128 ################################################################
130 ################################################################
133 rm -f
*~
*% config.log
134 rm -f chr.pl chr_translate.pl
135 rm -f chr_translate_bootstrap1.pl chr_translate_bootstrap2.pl
136 rm -f guard_entailment.pl
139 rm -f
$(TARGETS
) config.h config.cache config.status Makefile
141 runtex
--clean $(DOC
)