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
14 XPCEBASE
=$(PLBASE
)/xpce
15 PKGDOC
=$(PLBASE
)/doc
/packages
17 LIBDIR
=$(PLBASE
)/library
19 EXDIR
=$(PKGDOC
)/examples
/chr
27 CFLAGS
=$(COFLAGS
) $(CWFLAGS
) $(CMFLAGS
) $(CIFLAGS
) @DEFS@
33 DOCTOTEX
=$(PCEHOME
)/bin
/doc2tex
34 PLTOTEX
=$(PCEHOME
)/bin
/pl2tex
43 INSTALL_PROGRAM
=@INSTALL_PROGRAM@
44 INSTALL_DATA
=@INSTALL_DATA@
46 LIBPL
= chr_runtime.pl chr_op.pl chr_translate.pl chr_debug.pl \
47 chr_messages.pl hprolog.pl pairlist.pl clean_code.pl \
48 find.pl a_star.pl binomialheap.pl builtins.pl \
49 chr_hashtable_store.pl listmap.pl guard_entailment.pl \
50 chr_compiler_options.pl chr_compiler_utility.pl chr_compiler_errors.pl \
51 chr_integertable_store.pl @TARGETS@
54 EXAMPLES
= chrfreeze.chr fib.chr gcd.chr primes.chr \
55 bool.chr family.chr fibonacci.chr leq.chr listdom.chr \
58 all: chr_translate.pl
$(TARGETS
)
60 chr_support.@SO@
: chr_support.o
61 $(LD
) $(LDFLAGS
) -o
$@ chr_support.o
63 chr_translate_bootstrap.pl
: $(TARGETS
)
65 chr_translate_bootstrap1.pl
: chr_translate_bootstrap1.chr chr_translate_bootstrap.pl
66 $(PL
) -q
-f chr_swi_bootstrap.pl \
67 -g
"chr_compile_step1('$<','$@'),halt" \
69 $(PL
) -q
-f chr_swi_bootstrap.pl \
70 -g
"chr_compile_step2('$<','$@'),halt" \
73 chr_translate_bootstrap2.pl
: chr_translate_bootstrap2.chr chr_translate_bootstrap1.pl
74 $(PL
) -q
-f chr_swi_bootstrap.pl \
75 -g
"chr_compile_step2('$<','$@'),halt" \
77 $(PL
) -q
-f chr_swi_bootstrap.pl \
78 -g
"chr_compile_step3('$<','$@'),halt" \
81 guard_entailment.pl
: guard_entailment.chr chr_translate_bootstrap2.pl
82 $(PL
) -q
-f chr_swi_bootstrap.pl \
83 -g
"chr_compile_step3('$<','$@'),halt" \
86 chr_translate.pl
: chr_translate.chr chr_translate_bootstrap2.pl guard_entailment.pl
87 $(PL
) -q
-f chr_swi_bootstrap.pl \
88 -g
"chr_compile_step3('$<','$@'),halt" \
90 $(PL
) -L50M
-G50M
-T20M
-p chr
=.
-q
-f chr_swi_bootstrap.pl \
91 -g
"chr_compile_step4('guard_entailment.chr','guard_entailment.pl'),halt" \
93 $(PL
) -L50M
-G50M
-T20M
-p chr
=.
-q
-f chr_swi_bootstrap.pl \
94 -g
"chr_compile_step4('$<','$@'),halt" \
101 mkdir
-p
$(DESTDIR
)$(CHRDIR
)
102 $(INSTALL_DATA
) $(LIBPL
) $(DESTDIR
)$(CHRDIR
)
103 $(INSTALL_DATA
) $(CHRPL
) $(DESTDIR
)$(LIBDIR
)/chr.pl
104 $(INSTALL_DATA
) README
$(DESTDIR
)$(CHRDIR
)
105 $(PL
) -f none
-g make
-t halt
108 @
$(MAKE
) INSTALL_DATA
='../ln-install' install
112 pdf-install
: install-examples
114 html-install
: install-examples
117 mkdir
-p
$(DESTDIR
)$(EXDIR
)
118 (cd Examples
&& $(INSTALL_DATA
) $(EXAMPLES
) $(DESTDIR
)$(EXDIR
))
121 (cd
$(PLBASE
)/library
&& rm -f
$(LIBPL
))
122 $(PL
) -f none
-g make
-t halt
125 $(PL
) -q
-f chr_test.pl
-g
test,halt
-t
'halt(1)'
128 ################################################################
130 ################################################################
132 # NOTE: Manual is integrated in system manual
142 mv html
/index.html
$@
145 ..
/..
/man
/runtex
--pdf
$(DOC
)
150 $(DOCTOTEX
) $*.doc
> $*.
tex
152 $(PLTOTEX
) $*.pl
> $*.
tex
154 ################################################################
156 ################################################################
159 rm -f
*~
*.o
*.so
*% config.log
160 rm -f chr.pl chr_translate.pl
161 rm -f chr_translate_bootstrap1.pl chr_translate_bootstrap2.pl
162 rm -f guard_entailment.pl
165 rm -f
$(TARGETS
) config.h config.cache config.status Makefile
167 ..
/..
/man
/runtex
--clean $(DOC
)