* Cleanup and remove generated files
[chr.git] / Makefile.mak
blob30225fdb442a49167f0465190efc4d5590f25804
1 ################################################################
2 # Install CHR stuff for the MS-Windows built
3 # Author: Jan Wielemaker
4 #
5 # Use:
6 # nmake /f Makefile.mak
7 # nmake /f Makefile.mak install
8 ################################################################
10 PLHOME=..\..
11 !include $(PLHOME)\src\rules.mk
12 LIBDIR=$(PLBASE)\library
13 EXDIR=$(PKGDOC)\examples\chr
14 CHR=$(LIBDIR)\chr
15 PL="$(PLHOME)\bin\plcon.exe"
17 LIBPL= chr_runtime.pl chr_op.pl chr_translate.pl chr_debug.pl \
18 chr_messages.pl hprolog.pl pairlist.pl clean_code.pl \
19 find.pl a_star.pl binomialheap.pl builtins.pl \
20 chr_hashtable_store.pl listmap.pl guard_entailment.pl
21 CHRPL= chr_swi.pl
22 EXAMPLES= chrfreeze.chr fib.chr gcd.chr primes.chr \
23 bool.chr family.chr fibonacci.chr leq.chr listdom.chr \
24 chrdif.chr
26 all: chr_translate.pl
28 chr_translate_bootstrap1.pl: chr_translate_bootstrap1.chr
29 $(PL) -q -f chr_swi_bootstrap.pl \
30 -g "chr_compile_step1('chr_translate_bootstrap1.chr','chr_translate_bootstrap1.pl'),halt" \
31 -t "halt(1)"
32 $(PL) -q -f chr_swi_bootstrap.pl \
33 -g "chr_compile_step2('chr_translate_bootstrap1.chr','chr_translate_bootstrap1.pl'),halt" \
34 -t "halt(1)"
36 chr_translate_bootstrap2.pl: chr_translate_bootstrap2.chr chr_translate_bootstrap1.pl
37 $(PL) -q -f chr_swi_bootstrap.pl \
38 -g "chr_compile_step2('chr_translate_bootstrap2.chr','chr_translate_bootstrap2.pl'),halt" \
39 -t 'halt(1)'
40 $(PL) -q -f chr_swi_bootstrap.pl \
41 -g "chr_compile_step3('chr_translate_bootstrap2.chr','chr_translate_bootstrap2.pl'),halt" \
42 -t 'halt(1)'
44 guard_entailment.pl: guard_entailment.chr chr_translate_bootstrap2.pl
45 $(PL) -q -f chr_swi_bootstrap.pl \
46 -g "chr_compile_step3('guard_entailment.chr','guard_entailment.pl'),halt" \
47 -t 'halt(1)'
49 chr_translate.pl: chr_translate.chr chr_translate_bootstrap2.pl guard_entailment.pl
50 $(PL) -q -f chr_swi_bootstrap.pl \
51 -g "chr_compile_step3('chr_translate.chr','chr_translate.pl'),halt" \
52 -t 'halt(1)'
53 $(PL) -p chr=. -q -f chr_swi_bootstrap.pl \
54 -g "chr_compile_step4('guard_entailment.chr','guard_entailment.pl'),halt" \
55 -t 'halt(1)'
56 $(PL) -L10M -p chr=. -q -f chr_swi_bootstrap.pl \
57 -g "chr_compile_step4('chr_translate.chr','chr_translate.pl'),halt" \
58 -t 'halt(1)'
60 chr.pl: chr_swi.pl
61 copy chr_swi.pl chr.pl
63 check: chr.pl
64 $(PL) -q -f chr_test.pl -g test,halt -t 'halt(1)'
67 !IF "$(CFG)" == "rt"
68 install::
69 !ELSE
70 install::
71 @if not exist "$(CHR)\$(NULL)" $(MKDIR) "$(CHR)"
72 @for %f in ($(LIBPL)) do \
73 copy "%f" "$(CHR)"
74 copy $(CHRPL) "$(LIBDIR)\chr.pl"
75 copy README "$(CHR)\README.TXT"
76 $(MAKEINDEX)
77 !ENDIF
79 html-install: install-examples
80 pdf-install: install-examples
82 install-examples::
83 if not exist "$(EXDIR)/$(NULL)" $(MKDIR) "$(EXDIR)"
84 cd examples & @for %f in ($(EXAMPLES)) do @copy %f "$(EXDIR)"
86 xpce-install::
88 uninstall::
89 @for %f in ($(LIBPL)) do \
90 del "$(CHR)\%f"
91 del "$(CHR)\README.TXT"
92 del "$(LIBDIR)\chr.pl"
93 $(MAKEINDEX)
95 clean::
96 if exist *~ del *~
97 -del chr.pl chr_translate.pl
98 -del chr_translate_bootstrap1.pl chr_translate_bootstrap2.pl
99 -del guard_entailment.pl
101 distclean: clean