/[svn]/Makefile
ViewVC logotype

Contents of /Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 374 - (hide annotations)
Tue Jul 10 17:29:46 2007 UTC (5 years, 10 months ago) by abate
File size: 4166 byte(s)
[r2003-05-20 13:27:25 by cvscast] Unicode support

Original author: cvscast
Date: 2003-05-20 13:27:27+00:00
1 abate 368 DEBUG = -g
2     OCAMLCP = ocamlc
3     OCAMLC = ocamlfind $(OCAMLCP) -package $(PACKAGES)
4     OCAMLOPT = ocamlfind ocamlopt -inline 25 -package $(PACKAGES)
5     # extra options:
6     # -p (profiling)
7 abate 22
8 abate 374 PACKAGES = "pxp-engine pxp-lex-iso88591 pxp-wlex-utf8 wlexing camlp4 num,cgi"
9 abate 61
10 abate 370 DISTRIB = $(DIRS) tools web depend INSTALL LICENSE README Makefile
11 abate 61
12 abate 370 all: cduce.opt dtd2cduce local_website
13 abate 78
14 abate 368 # Source directories
15 abate 1
16 abate 368 DIRS = misc parser typing types runtime driver
17     CLEAN_DIRS = $(DIRS) tools tests
18 abate 4
19 abate 368 # Objects to build
20 abate 3
21 abate 368 OBJECTS = \
22     misc/state.cmo misc/pool.cmo misc/encodings.cmo misc/bool.cmo \
23     misc/pretty.cmo \
24     \
25     types/sortedList.cmo types/boolean.cmo types/ident.cmo \
26     types/intervals.cmo types/chars.cmo types/atoms.cmo types/normal.cmo \
27     types/types.cmo types/patterns.cmo types/sequence.cmo types/builtin.cmo \
28     \
29     parser/location.cmo parser/wlexer.cmo parser/ast.cmo parser/parser.cmo \
30     \
31     typing/typed.cmo typing/typer.cmo \
32     \
33     runtime/value.cmo runtime/load_xml.cmo runtime/run_dispatch.cmo \
34     runtime/print_xml.cmo runtime/eval.cmo \
35     \
36     driver/cduce.cmo
37 abate 45
38 abate 368 CDUCE = $(OBJECTS) driver/run.cmo
39     WEBIFACE = $(OBJECTS) driver/examples.cmo driver/webiface.cmo
40 abate 3
41 abate 90 XCDUCE = $(CDUCE:.cmo=.cmx)
42 abate 273 XWEBIFACE = $(WEBIFACE:.cmo=.cmx)
43 abate 20
44 abate 61 DEPEND = $(DIRS:=/*.ml) $(DIRS:=/*.mli)
45     INCLUDES = $(DIRS:%=-I %)
46    
47     SYNTAX = camlp4o pa_extend.cmo
48     SYNTAX_PARSER = -pp '$(SYNTAX)'
49     PREPRO = $(SYNTAX) pr_o.cmo
50    
51 abate 90 cduce: $(CDUCE)
52 abate 368 $(OCAMLC) $(DEBUG) -linkpkg -o $@ gramlib.cma $^
53 abate 10
54 abate 90 webiface: $(WEBIFACE)
55 abate 368 $(OCAMLC) $(DEBUG) -linkpkg -o $@ gramlib.cma $^
56 abate 63
57 abate 71 dtd2cduce: tools/dtd2cduce.cmo
58 abate 368 $(OCAMLC) $(DEBUG) -linkpkg -o $@ $^
59 abate 71
60 abate 124 cduce.opt: $(XCDUCE)
61 abate 368 $(OCAMLOPT) -linkpkg -o $@ gramlib.cmxa $^
62 abate 20
63 abate 273 webiface.opt: $(XWEBIFACE)
64 abate 368 $(OCAMLOPT) -linkpkg -o $@ gramlib.cmxa $^
65 abate 273
66 abate 3 compute_depend:
67     @echo "Computing dependencies ..."
68 abate 4 ocamldep $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) > depend
69 abate 1
70 abate 81 parser/wlexer.ml: parser/wlexer.mll
71     wlex parser/wlexer.mll
72    
73 abate 1 clean:
74 abate 72 for i in $(CLEAN_DIRS); do \
75 abate 58 (cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *~); \
76     done
77     rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~
78 abate 273 rm -f cduce cduce.opt webiface.opt ocamlprof.dump
79 abate 90 rm -f dtd2cduce pool webiface
80 abate 368 rm -Rf prepro package
81 abate 370 rm -f web/*.php web/*.html web/*~
82 abate 1
83 abate 61
84 abate 1 .SUFFIXES: .ml .mli .cmo .cmi .cmx
85    
86     .ml.cmo:
87 abate 61 $(OCAMLC) $(DEBUG) -c $(SYNTAX_PARSER) $(INCLUDES) $<
88    
89 abate 1 .ml.cmx:
90 abate 58 $(OCAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
91 abate 1
92     .mli.cmi:
93 abate 61 $(OCAMLC) $(DEBUG) -c $(SYNTAX_PARSER) $(INCLUDES) $<
94 abate 1
95 abate 3 include depend
96 abate 105
97 abate 368 # CDuce-generated files
98 abate 105
99 abate 288 driver/examples.ml: cduce.opt web/examples/build.cd web/examples/examples.xml
100     (cd web/examples; ../../cduce.opt -quiet build.cd)
101 abate 126
102 abate 260 web/files: cduce.opt web/site.cd
103 abate 369 (cd web; ../cduce.opt -quiet site.cd -- -php site.xml)
104 abate 255
105 abate 368 # Packaging
106 abate 286
107     write_header:
108     headache -h header $(DEPEND)
109    
110     remove_header:
111     headache -r $(DEPEND)
112    
113 abate 368 # For development
114    
115     pull: tools/pull.cmo
116     $(OCAMLC) $(DEBUG) -linkpkg -o $@ $^
117    
118     all.cma: $(OBJECTS)
119     $(OCAMLC) $(DEBUG) -o $@ -linkpkg gramlib.cma -a $(OBJECTS)
120    
121     test: all.cma
122     fort all.cma -I +fort $(INCLUDES) tests/test_fort.ml
123    
124     run_top: all.cma
125     ledit ocaml $(INCLUDES) `ocamlfind use pxp` all.cma
126    
127     profile:
128     rm -Rf prepro
129     mkdir prepro
130     for i in $(DIRS); do \
131     mkdir prepro/$$i; \
132     for j in $$i/*.ml $$i/*.mli; do \
133     if [ -f "$$j" ]; then \
134     echo $$j; \
135     $(PREPRO) $$j -o prepro/$$j; \
136     fi; \
137     done; \
138     done
139     cp parser/wlexer.mll prepro/parser/
140     cp Makefile depend prepro/
141     (cd prepro; make cduce OCAMLCP="ocamlcp -p a" SYNTAX_PARSER=)
142    
143 abate 105 # Site-specific installation
144 abate 369
145     cedre_build:
146     rsh cedre ". .env; cd IMPLEM/CDUCE; make webiface.opt; make web/files"
147 abate 105 install_web:
148 abate 369 scp web/*.php web/cduce.css cduce@iris:public_html/
149     scp webiface.opt cduce@iris:cgi-bin/cduce
150     ssh cduce@iris "chmod +s cgi-bin/cduce"
151    
152 abate 155 install_web_local:
153 abate 363 ssh root@localhost "cp -f ~beppe/IMPLEM/CDUCE/webiface.opt /var/www/cgi-bin/cduce; cp -f ~beppe/IMPLEM/CDUCE/web/*.php /var/www/html/; chmod +s /var/www/cgi-bin/cduce;"
154 abate 172
155 abate 369 website: web/files
156 abate 261 scp web/*.php web/cduce.css cduce@iris:public_html/
157 abate 286
158 abate 370 local_website: cduce.opt webiface.opt
159     (cd web; ../cduce.opt -quiet site.cd -- site.xml)
160    
161 abate 368 # Distribution
162    
163     .PHONY: package
164     package:
165     rm -Rf package
166     mkdir package
167     cp -R $(DISTRIB) package/
168 abate 370 (cd package; headache -h ../header $(DEPEND))
169    

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