CHR: experimental detach code size reduction (bug fix)
[chr.git] / Makefile.in
blobd9cb3e72b86f4156abca046ef1fa83cc2ccad16d
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 html::
139 $(HTML): $(TEX)
140 latex2html $(DOC)
141 mv html/index.html $@
143 $(PDF): $(TEX)
144 ../../man/runtex --pdf $(DOC)
146 $(TEX): $(DOCTOTEX)
148 .doc.tex:
149 $(DOCTOTEX) $*.doc > $*.tex
150 .pl.tex:
151 $(PLTOTEX) $*.pl > $*.tex
153 ################################################################
154 # Clean
155 ################################################################
157 clean:
158 rm -f *~ *.o *.so *% config.log
159 rm -f chr.pl chr_translate.pl
160 rm -f chr_translate_bootstrap1.pl chr_translate_bootstrap2.pl
161 rm -f guard_entailment.pl
163 distclean: clean
164 rm -f $(TARGETS) config.h config.cache config.status Makefile
165 rm -f $(TEX)
166 ../../man/runtex --clean $(DOC)