IMPROVED: slightly cheaper constant matching operation for chr_identifier store
[chr.git] / Makefile.in
blob6fb68a841a382de28066e6c6f9341a319f30161c
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 PLINCL=@PLINCL@
13 PL=@PL@
14 XPCEBASE=$(PLBASE)/xpce
15 PKGDOC=$(PLBASE)/doc/packages
16 PCEHOME=../xpce
17 LIBDIR=$(PLBASE)/library
18 CHRDIR=$(LIBDIR)/chr
19 EXDIR=$(PKGDOC)/examples/chr
20 DESTDIR=
22 CC=@CC@
23 COFLAGS=@COFLAGS@
24 CWFLAGS=@CWFLAGS@
25 CMFLAGS=@CMFLAGS@
26 CIFLAGS=
27 CFLAGS=$(COFLAGS) $(CWFLAGS) $(CMFLAGS) $(CIFLAGS) @DEFS@
28 LIBS=@LIBS@
30 LD=@LD@
31 LDFLAGS=@LDSOFLAGS@
33 DOCTOTEX=$(PCEHOME)/bin/doc2tex
34 PLTOTEX=$(PCEHOME)/bin/pl2tex
35 LATEX=latex
36 DOC=chr
37 TEX=$(DOC).tex
38 DVI=$(DOC).dvi
39 PDF=$(DOC).pdf
40 HTML=$(DOC).html
42 INSTALL=@INSTALL@
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@
52 TARGETS= @TARGETS@
53 CHRPL= chr_swi.pl
54 EXAMPLES= chrfreeze.chr fib.chr gcd.chr primes.chr \
55 bool.chr family.chr fibonacci.chr leq.chr listdom.chr \
56 chrdif.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" \
68 -t 'halt(1)'
69 $(PL) -q -f chr_swi_bootstrap.pl \
70 -g "chr_compile_step2('$<','$@'),halt" \
71 -t 'halt(1)'
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" \
76 -t 'halt(1)'
77 $(PL) -q -f chr_swi_bootstrap.pl \
78 -g "chr_compile_step3('$<','$@'),halt" \
79 -t 'halt(1)'
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" \
84 -t 'halt(1)'
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" \
89 -t 'halt(1)'
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" \
92 -t 'halt(1)'
93 $(PL) -L50M -G50M -T20M -p chr=. -q -f chr_swi_bootstrap.pl \
94 -g "chr_compile_step4('$<','$@'),halt" \
95 -t 'halt(1)'
97 chr.pl: chr_swi.pl
98 cp $< $@
100 install: $(LIBPL)
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
107 ln-install::
108 @$(MAKE) INSTALL_DATA='../ln-install' install
110 rpm-install: install
112 pdf-install: install-examples
114 html-install: install-examples
116 install-examples::
117 mkdir -p $(DESTDIR)$(EXDIR)
118 (cd Examples && $(INSTALL_DATA) $(EXAMPLES) $(DESTDIR)$(EXDIR))
120 uninstall:
121 (cd $(PLBASE)/library && rm -f $(LIBPL))
122 $(PL) -f none -g make -t halt
124 check: chr.pl
125 $(PL) -q -f chr_test.pl -g test,halt -t 'halt(1)'
128 ################################################################
129 # Documentation
130 ################################################################
132 # NOTE: Manual is integrated in system manual
134 doc: pdf html
135 #pdf: $(PDF)
136 #html: $(HTML)
137 pdf::
138 html::
140 $(HTML): $(TEX)
141 latex2html $(DOC)
142 mv html/index.html $@
144 $(PDF): $(TEX)
145 ../../man/runtex --pdf $(DOC)
147 $(TEX): $(DOCTOTEX)
149 .doc.tex:
150 $(DOCTOTEX) $*.doc > $*.tex
151 .pl.tex:
152 $(PLTOTEX) $*.pl > $*.tex
154 ################################################################
155 # Clean
156 ################################################################
158 clean:
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
164 distclean: clean
165 rm -f $(TARGETS) config.h config.cache config.status Makefile
166 rm -f $(TEX)
167 ../../man/runtex --clean $(DOC)