/[svn]/Makefile.distrib
ViewVC logotype

Contents of /Makefile.distrib

Parent Directory Parent Directory | Revision Log Revision Log


Revision 453 - (hide annotations)
Tue Jul 10 17:35:58 2007 UTC (5 years, 10 months ago) by abate
File size: 3660 byte(s)
[r2003-05-28 21:16:42 by cvscast] bug find sans path

Original author: cvscast
Date: 2003-05-28 21:16:42+00:00
1 abate 435 NATIVE = true
2     PROFILE = false
3     PXP_WLEX = false
4    
5     PACKAGES = -package "pxp-engine pxp-lex-iso88591 wlexing camlp4 num cgi"
6     ifeq ($(PXP_WLEX), true)
7     PACKAGES += -package pxp-wlex-utf8
8     else
9     PACKAGES += -package pxp-lex-utf8
10     endif
11    
12 abate 450 SYNTAX = camlp4o -I misc/ pa_extend.cmo \
13     q_symbol.cmo \
14     -symbol cduce_version=\"$(VERSION)\" \
15     -symbol build_date=\"$(shell date +%Y-%m-%d)\"
16 abate 435
17 abate 450 ifeq ($(NATIVE), true)
18     SYNTAX += -symbol ocaml_compiler=\"native\"
19     else
20     SYNTAX += -symbol ocaml_compiler=\"bytecode\"
21     endif
22    
23 abate 435 VERSION = 0.0.9
24    
25     ifeq ($(PROFILE), true)
26     CAMLC_P = ocamlcp -p a
27     CAMLOPT_P = ocamlopt -p
28     SYNTAX_PARSER =
29     else
30     CAMLC_P = ocamlc
31     CAMLOPT_P = ocamlopt
32     SYNTAX_PARSER = -pp '$(SYNTAX)'
33     endif
34    
35     OPT = -warn-error A
36     CAMLC = ocamlfind $(CAMLC_P) $(OPT) $(PACKAGES)
37     CAMLOPT = ocamlfind $(CAMLOPT_P) $(OPT) $(PACKAGES)
38    
39     ifeq ($(NATIVE), true)
40     EXTENSION = cmx
41     LINK = $(CAMLOPT) -linkpkg gramlib.cmxa
42     else
43     EXTENSION = cmo
44     LINK = $(CAMLC) -custom -linkpkg gramlib.cma
45     endif
46    
47     all: cduce dtd2cduce local_website
48    
49     # Source directories
50    
51     DIRS = misc parser typing types runtime driver
52     CLEAN_DIRS = $(DIRS) tools tests
53    
54     # Objects to build
55    
56     OBJECTS = \
57     misc/state.cmo misc/pool.cmo misc/encodings.cmo misc/bool.cmo \
58     misc/pretty.cmo \
59     \
60     types/sortedList.cmo types/boolean.cmo types/ident.cmo \
61     types/intervals.cmo types/chars.cmo types/atoms.cmo types/normal.cmo \
62     types/types.cmo types/patterns.cmo types/sequence.cmo \
63     types/sample.cmo \
64     \
65     parser/location.cmo parser/wlexer.cmo parser/ast.cmo parser/parser.cmo \
66     \
67     typing/typed.cmo typing/typer.cmo \
68     \
69     runtime/value.cmo runtime/load_xml.cmo runtime/run_dispatch.cmo \
70     runtime/print_xml.cmo runtime/eval.cmo \
71     \
72     types/builtin.cmo driver/cduce.cmo
73    
74     CDUCE = $(OBJECTS) driver/run.cmo
75     WEBIFACE = $(OBJECTS) driver/examples.cmo driver/webiface.cmo
76     DTD2CDUCE = tools/dtd2cduce.cmo
77    
78     DEPEND = $(DIRS:=/*.ml) $(DIRS:=/*.mli)
79     INCLUDES = $(DIRS:%=-I %)
80    
81     cduce: $(CDUCE:.cmo=.$(EXTENSION))
82     $(LINK) $(INCLUDES) -o $@ $^
83    
84     webiface: $(WEBIFACE:.cmo=.$(EXTENSION))
85     $(LINK) -o $@ $^
86    
87     dtd2cduce: $(DTD2CDUCE:.cmo=.$(EXTENSION))
88     $(LINK) -o $@ $^
89    
90     .PHONY: compute_depend
91 abate 450 compute_depend: misc/q_symbol.cmo
92 abate 435 @echo "Computing dependencies ..."
93 abate 450 ocamldep $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) | \
94     sed -e "s|: |: misc/q_symbol.cmo |" > depend
95 abate 435
96     parser/wlexer.ml: parser/wlexer.mll
97     wlex parser/wlexer.mll
98    
99     clean:
100     for i in $(CLEAN_DIRS); do \
101     (cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *~); \
102     done
103 abate 453 rm -f `find . -name "*~"`
104 abate 435 rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~
105     rm -f cduce ocamlprof.dump
106     rm -f dtd2cduce pool webiface
107     rm -Rf prepro package
108     rm -f web/www/*.php web/www/*.html web/*~
109    
110    
111     .SUFFIXES: .ml .mli .cmo .cmi .cmx
112    
113 abate 450 misc/q_symbol.cmo: misc/q_symbol.ml
114     $(CAMLC) -c $<
115    
116 abate 435 .ml.cmo:
117     $(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
118    
119     .ml.cmx:
120     $(CAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
121    
122     .mli.cmi:
123     $(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
124    
125     include depend
126    
127     # CDuce-generated files
128    
129     driver/examples.ml: cduce web/examples/build.cd web/examples/examples.xml
130     (cd web/examples; ../../cduce --quiet build.cd)
131    
132     web/files: cduce web/site.cd
133     (cd web; ../cduce --quiet site.cd --arg -php site.xml)
134    
135     #
136     # Customize the following variables to match the settings
137     # of your local web server
138     #
139     WEB_PREFIX = /var/www
140     CGI_DIR = $(WEB_PREFIX)/cgi-bin
141     CDUCE_HTML_DIR = $(WEB_PREFIX)/html
142    
143     install_web_local:web/files webiface
144     cp web/www/*.php web/cduce.css $(CDUCE_HTML_DIR)/
145     cp webiface $(CGI_DIR)/
146     if test ! -d "$(CDUCE_HTML_DIR)/img" ; then \
147     mkdir $(CDUCE_HTML_DIR)/img; \
148     fi;
149     cp web/img/*.* $(CDUCE_HTML_DIR)/img
150    
151    
152     local_website: cduce
153     (cd web; ../cduce --quiet site.cd --arg site.xml)

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5