Index: trunk/phase3/math/Makefile |
— | — | @@ -1,3 +1,5 @@ |
| 2 | +.PHONY: clean all |
| 3 | + |
2 | 4 | OBJ=render_info.cmo tex.cmo texutil.cmo parser.cmo lexer.cmo texvc.cmo \ |
3 | 5 | render_info.cmx tex.cmx texutil.cmx parser.cmx lexer.cmx texvc.cmx \ |
4 | 6 | lexer.cmi parser.cmi render_info.cmi tex.cmi texutil.cmi texvc.cmi \ |
— | — | @@ -10,15 +12,41 @@ |
11 | 13 | html.o mathml.cmi mathml.cmo mathml.cmx mathml.o |
12 | 14 | CGIPATH=-I /usr/lib/ocaml/cgi -I /usr/lib/ocaml/netstring -I /usr/lib/ocaml/pcre |
13 | 15 | |
| 16 | +COMMON_NATIVE_OBJ =util.cmx parser.cmx html.cmx mathml.cmx texutil.cmx lexer.cmx |
| 17 | +COMMON_BYTECODE_OBJ=util.cmo parser.cmo html.cmo mathml.cmo texutil.cmo lexer.cmo |
| 18 | + |
14 | 19 | all: texvc texvc_test texvc_tex |
15 | | -texvc.bc: util.cmo parser.cmo html.cmo mathml.cmo texutil.cmo render.cmo lexer.cmo texvc.cmo |
16 | | - ocamlc -o $@ unix.cma $^ |
17 | | -texvc: util.cmx parser.cmx html.cmx mathml.cmx texutil.cmx render.cmx lexer.cmx texvc.cmx |
| 20 | +cgi: texvc_cgi.cmo texvc_cgi |
| 21 | +clean: |
| 22 | + rm -f $(OBJ) |
| 23 | + |
| 24 | +# Native versions |
| 25 | +texvc: $(COMMON_NATIVE_OBJ) render.cmx texvc.cmx |
18 | 26 | ocamlopt -o $@ unix.cmxa $^ |
19 | | -texvc_test: util.cmx parser.cmx html.cmx mathml.cmx texutil.cmx lexer.cmx texvc_test.cmx |
| 27 | +texvc_test: $(COMMON_NATIVE_OBJ) lexer.cmx texvc_test.cmx |
20 | 28 | ocamlopt -o $@ $^ |
21 | | -texvc_tex: util.cmx parser.cmx html.cmx mathml.cmx texutil.cmx lexer.cmx texvc_tex.cmx |
| 29 | +texvc_tex: $(COMMON_NATIVE_OBJ) texvc_tex.cmx |
22 | 30 | ocamlopt -o $@ $^ |
| 31 | + |
| 32 | +# Bytecode version |
| 33 | +texvc.bc: $(COMMON_BYTECODE_OBJ) render.cmo texvc.cmo |
| 34 | + ocamlc -o $@ unix.cma $^ |
| 35 | + |
| 36 | +# CGI related targets: |
| 37 | +texvc_cgi.cmo: texvc_cgi.ml |
| 38 | + ocamlc -c $(CGIPATH) $< |
| 39 | +texvc_cgi: util.cmo parser.cmo texutil.cmo render.cmo lexer.cmo texvc_cgi.cmo |
| 40 | + ocamlc -o $@ unix.cma $(CGIPATH) pcre.cma netstring.cma cgi.cma $^ |
| 41 | + chmod g-w $@ |
| 42 | + |
| 43 | +# |
| 44 | +# Pattern rules |
| 45 | +# |
| 46 | + |
| 47 | +# .ml source .mli interface |
| 48 | +# .cmi compiled interface |
| 49 | +# .cmo object .cma library object |
| 50 | +# .cmx object file .cmxa library object file |
23 | 51 | %.ml: %.mll |
24 | 52 | ocamllex $< |
25 | 53 | %.mli %.ml: %.mly |
— | — | @@ -29,14 +57,9 @@ |
30 | 58 | ocamlopt -c $< |
31 | 59 | %.cmi: %.mli |
32 | 60 | ocamlc -c $< |
33 | | -texvc_cgi.cmo: texvc_cgi.ml |
34 | | - ocamlc -c $(CGIPATH) $< |
35 | | -texvc_cgi: util.cmo parser.cmo texutil.cmo render.cmo lexer.cmo texvc_cgi.cmo |
36 | | - ocamlc -o $@ unix.cma $(CGIPATH) pcre.cma netstring.cma cgi.cma $^ |
37 | | - chmod g-w $@ |
38 | | -clean: |
39 | | - rm -f $(OBJ) |
40 | 61 | |
| 62 | +# Various dependencies |
| 63 | + |
41 | 64 | html.cmo: render_info.cmi tex.cmi util.cmo html.cmi |
42 | 65 | html.cmx: render_info.cmi tex.cmi util.cmx html.cmi |
43 | 66 | html.cmi: tex.cmi |