]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/pxp/pxp/Makefile.code
- the mathql interpreter is not helm-dependent any more
[helm.git] / helm / DEVEL / pxp / pxp / Makefile.code
1 # make all:             make bytecode archives
2 # make opt:             make native archives
3 #----------------------------------------------------------------------
4
5 include Makefile.conf
6
7 all: 
8         $(MAKE) -f Makefile.code pxp_types.cma
9         $(MAKE) -f Makefile.code pxp_lex_iso88591.cma
10         if [ "x$(UTF8_SUPPORT)" = "xyes" ]; then $(MAKE) -f Makefile.code pxp_lex_utf8.cma; else rm -f pxp_lex_utf8.cma; fi
11         $(MAKE) -f Makefile.code pxp_engine.cma
12         if [ "x$(UTF8_SUPPORT)" = "xyes" ]; then $(MAKE) -f Makefile.code pxp_utf8.cmo; else rm -f pxp_utf8.cmo; fi
13
14 opt:
15         $(MAKE) -f Makefile.code pxp_types.cmxa
16         $(MAKE) -f Makefile.code pxp_lex_iso88591.cmxa
17         if [ "x$(UTF8_SUPPORT)" = "xyes" ]; then $(MAKE) -f Makefile.code pxp_lex_utf8.cmxa; else rm -f pxp_lex_utf8.cmxa; fi
18         $(MAKE) -f Makefile.code pxp_engine.cmxa
19         if [ "x$(UTF8_SUPPORT)" = "xyes" ]; then $(MAKE) -f Makefile.code pxp_utf8.cmx; else rm -f pxp_utf8.cmx; fi
20
21 #----------------------------------------------------------------------
22
23 pxp_types.cma: $(OBJECTS_types)
24         $(OCAMLC) -a -o pxp_types.cma $(OBJECTS_types)
25
26 pxp_types.cmxa: $(XOBJECTS_types)
27         $(OCAMLOPT) -a -o pxp_types.cmxa $(XOBJECTS_types)
28
29 pxp_engine.cma: $(OBJECTS_engine)
30         $(OCAMLC) -a -o pxp_engine.cma $(OBJECTS_engine)
31
32 pxp_engine.cmxa: $(XOBJECTS_engine)
33         $(OCAMLOPT) -a -o pxp_engine.cmxa $(XOBJECTS_engine)
34
35
36 # The following rules are "phony" to force 'make' to go into the
37 # "lexers" subdirectory.
38
39 .PHONY: pxp_lex_iso88591.cma
40 pxp_lex_iso88591.cma: $(CMI_types)
41         $(MAKE) -C lexers all_iso88591
42         cp lexers/pxp_lex_iso88591.cma .
43
44 .PHONY: pxp_lex_iso88591.cmxa
45 pxp_lex_iso88591.cmxa: $(CMI_types)
46         $(MAKE) -C lexers opt_iso88591
47         cp lexers/pxp_lex_iso88591.cmxa lexers/pxp_lex_iso88591.a .
48
49 .PHONY: pxp_lex_utf8.cma
50 pxp_lex_utf8.cma: $(CMI_types)
51         $(MAKE) -C lexers all_utf8
52         cp lexers/pxp_lex_utf8.cma .
53
54 .PHONY: pxp_lex_utf8.cmxa
55 pxp_lex_utf8.cmxa: $(CMI_types)
56         $(MAKE) -C lexers opt_utf8
57         cp lexers/pxp_lex_utf8.cmxa lexers/pxp_lex_utf8.a .
58
59 #----------------------------------------------------------------------
60 # general rules:
61
62 OPTIONS   =
63 OCAMLC    = $(OCAMLFIND) ocamlc -package "$(PACKAGES)" \
64               -g -I lexers $(OPTIONS) $(ROPTIONS)
65 OCAMLOPT  = $(OCAMLFIND) ocamlopt -package "$(PACKAGES)" \
66               -p -I lexers $(OPTIONS) $(ROPTIONS)
67 OCAMLDEP  = ocamldep $(OPTIONS)
68 OCAMLFIND = ocamlfind
69
70 depend: *.ml *.mli pxp_yacc.ml
71         $(OCAMLDEP) *.ml *.mli >depend
72
73 .SUFFIXES: .cmo .cmi .cmx .ml .mli .mll .m2y
74
75 .ml.cmx:
76         $(OCAMLOPT) -c $<
77
78 .ml.cmo:
79         $(OCAMLC) -c $<
80
81 .mli.cmi:
82         $(OCAMLC) -c $<
83
84 .mll.ml:
85         ocamllex $<
86
87 .m2y.ml:
88         ./m2parsergen/m2parsergen < $< >`basename $< .m2y`.ml || { rm -f `basename $< .m2y`.ml; false; }
89
90 *.mli:
91
92
93 # Generated dependencies:
94
95 include depend
96