/[svn]/Makefile.distrib
ViewVC logotype

Diff of /Makefile.distrib

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 467 by abate, Tue Jul 10 17:36:54 2007 UTC revision 708 by abate, Tue Jul 10 17:57:26 2007 UTC
# Line 1  Line 1 
1  NATIVE = true  include Makefile.conf
2  PROFILE = false  VERSION = 0.2.0
 PXP_WLEX = false  
 EXPAT = false  
3    
4  PACKAGES = -package "pxp-engine pxp-lex-iso88591 wlexing camlp4 num cgi"  PACKAGES = pxp-engine pxp-lex-iso88591 ulex camlp4 num cgi pcre netstring
5  ifeq ($(PXP_WLEX), true)  ifeq ($(PXP_WLEX), true)
6    PACKAGES += -package pxp-wlex-utf8    PACKAGES += pxp-wlex-utf8
7  else  else
8    PACKAGES += -package pxp-lex-utf8    PACKAGES += pxp-lex-utf8
9  endif  endif
10    
11  SYNTAX = camlp4o -I misc/ pa_extend.cmo \  SYNTAX = -I misc/ q_symbol.cmo \
   q_symbol.cmo \  
12    -symbol cduce_version=\"$(VERSION)\" \    -symbol cduce_version=\"$(VERSION)\" \
13    -symbol build_date=\"$(shell date +%Y-%m-%d)\"    -symbol build_date=\"$(shell date +%Y-%m-%d)\" \
14      -symbol session_dir=\"$(SESSION_DIR)\"
15    
16  ifeq ($(NATIVE), true)  ifeq ($(NATIVE), true)
17          SYNTAX += -symbol ocaml_compiler=\"native\"          SYNTAX += -symbol ocaml_compiler=\"native\"
# Line 22  Line 20 
20  endif  endif
21    
22  ifeq ($(EXPAT), true)  ifeq ($(EXPAT), true)
23            PACKAGES += expat
24          SYNTAX += -symbol EXPAT=          SYNTAX += -symbol EXPAT=
25  endif  endif
26    
27  VERSION = 0.0.9  SYNTAX_PARSER = -syntax camlp4o $(SYNTAX:%=-ppopt %)
28    
29  SYNTAX_PARSER = -pp '$(SYNTAX)'  CAMLC_P = ocamlc -g
30    DEPEND_OCAMLDEP = misc/q_symbol.cmo
 CAMLC_P = ocamlc  
31  ifeq ($(PROFILE), true)  ifeq ($(PROFILE), true)
32          CAMLOPT_P = ocamlopt -p          CAMLOPT_P = ocamlopt -p
33          ifeq ($(NATIVE), false)          ifeq ($(NATIVE), false)
34           CAMLC_P = ocamlcp -p a           CAMLC_P = ocamlcp -p a
35           SYNTAX_PARSER =           SYNTAX_PARSER =
36             DEPEND_OCAMLDEP =
37          endif          endif
38  else  else
39          CAMLOPT_P = ocamlopt -inline 25          CAMLOPT_P = ocamlopt -inline 25
40  endif  endif
41    
42  OPT = -warn-error A  OPT = -warn-error FPS
43  CAMLC = ocamlfind $(CAMLC_P) $(OPT) $(PACKAGES)  OCAMLFIND = ocamlfind
44  CAMLOPT = ocamlfind $(CAMLOPT_P) $(OPT) $(PACKAGES)  CAMLC = $(OCAMLFIND) $(CAMLC_P) $(OPT) -package "$(PACKAGES)"
45    CAMLOPT = $(OCAMLFIND) $(CAMLOPT_P) $(OPT) -package "$(PACKAGES)"
46    
47  ifeq ($(NATIVE), true)  ifeq ($(NATIVE), true)
48          EXTENSION = cmx          EXTENSION = cmx
49          LINK = $(CAMLOPT) -linkpkg gramlib.cmxa          LINK = $(CAMLOPT) -linkpkg gramlib.cmxa
         ifeq ($(EXPAT), true)  
                 LINK += mlexpat.cmxa  
         endif  
50  else  else
51          EXTENSION = cmo          EXTENSION = cmo
52          LINK = $(CAMLC) -custom -linkpkg gramlib.cma mlexpat.cma          LINK = $(CAMLC) -custom -linkpkg gramlib.cma
         ifeq ($(EXPAT), true)  
                 LINK += mlexpat.cma  
         endif  
53  endif  endif
54    
55  all: cduce dtd2cduce local_website  all: cduce dtd2cduce
56    
57    
58    install: all
59            mkdir -p $(PREFIX)/bin/
60            mkdir -p $(PREFIX)/man/man1/
61            install -m755 cduce dtd2cduce $(PREFIX)/bin/
62            install -m644 doc/cduce.1 $(PREFIX)/man/man1/
63    
64    uninstall:
65            rm  $(PREFIX)/bin/cduce $(PREFIX)/bin/dtd2cduce $(PREFIX)/man/man1/cduce.1
66    
67  # Source directories  # Source directories
68    
69  DIRS = misc parser typing types runtime driver  DIRS = misc parser schema typing types compile runtime driver module
70  CLEAN_DIRS = $(DIRS) tools tests  CLEAN_DIRS = $(DIRS) tools tests
71    
72  # Objects to build  # Objects to build
73    
74  OBJECTS = \  OBJECTS = \
75     misc/stats.cmo \
76     misc/serialize.cmo misc/custom.cmo \
77   misc/state.cmo misc/pool.cmo misc/encodings.cmo misc/bool.cmo \   misc/state.cmo misc/pool.cmo misc/encodings.cmo misc/bool.cmo \
78   misc/pretty.cmo \   misc/pretty.cmo misc/ns.cmo \
79   \   \
80   types/sortedList.cmo types/boolean.cmo types/ident.cmo \   types/sortedList.cmo types/boolean.cmo types/ident.cmo \
81   types/intervals.cmo types/chars.cmo types/atoms.cmo types/normal.cmo \   types/intervals.cmo types/chars.cmo types/atoms.cmo \
82     types/normal.cmo \
83   types/types.cmo types/patterns.cmo types/sequence.cmo \   types/types.cmo types/patterns.cmo types/sequence.cmo \
84   types/sample.cmo \   types/sample.cmo types/builtin_defs.cmo \
85     \
86     runtime/value.cmo \
87   \   \
88   parser/location.cmo parser/wlexer.cmo parser/ast.cmo parser/parser.cmo \   schema/schema_types.cmo schema/schema_xml.cmo schema/schema_builtin.cmo \
89     schema/schema_validator.cmo schema/schema_parser.cmo \
90     \
91     parser/location.cmo parser/ulexer.cmo parser/ast.cmo parser/parser.cmo \
92   \   \
93   typing/typed.cmo typing/typer.cmo \   typing/typed.cmo typing/typer.cmo \
94   \   \
95   runtime/value.cmo runtime/load_xml.cmo runtime/run_dispatch.cmo \   compile/lambda.cmo \
96     \
97     runtime/load_xml.cmo runtime/run_dispatch.cmo \
98     runtime/explain.cmo \
99   runtime/print_xml.cmo runtime/eval.cmo \   runtime/print_xml.cmo runtime/eval.cmo \
100     compile/compile.cmo \
101     compile/operators.cmo \
102   \   \
103   types/builtin.cmo driver/cduce.cmo   types/builtin.cmo driver/cduce.cmo
104    
# Line 89  Line 106 
106  WEBIFACE  = $(OBJECTS) driver/examples.cmo driver/webiface.cmo  WEBIFACE  = $(OBJECTS) driver/examples.cmo driver/webiface.cmo
107  DTD2CDUCE = tools/dtd2cduce.cmo  DTD2CDUCE = tools/dtd2cduce.cmo
108    
109  DEPEND = $(DIRS:=/*.ml) $(DIRS:=/*.mli)  ALL_OBJECTS = $(OBJECTS) \
110  INCLUDES = $(DIRS:%=-I %)   driver/run.cmo driver/examples.cmo driver/webiface.cmo \
111     tools/dtd2cduce.cmo
112    
113  ifeq ($(EXPAT), true)  DEPEND = $(ALL_OBJECTS:.cmo=.ml) $(ALL_OBJECTS:.cmo=.mli)
114   INCLUDES += -I expat  
115  endif  INCLUDES = $(DIRS:%=-I %)
116    
117  cduce: $(CDUCE:.cmo=.$(EXTENSION))  cduce: $(CDUCE:.cmo=.$(EXTENSION))
118          $(LINK) $(INCLUDES) -o $@ $^          $(LINK) $(INCLUDES) -o $@ $^
119    
120    bug: $(OBJECTS) bug.cmo
121            $(LINK) $(INCLUDES) -o $@ $^
122    
123  webiface: $(WEBIFACE:.cmo=.$(EXTENSION))  webiface: $(WEBIFACE:.cmo=.$(EXTENSION))
124          $(LINK) -o $@ $^          $(LINK) $(INCLUDES) -o $@ $^ -ccopt -static
125    # webiface is made static to be able to move it more easily
126    # (to compile it on a machine which is not the web server)
127    
128  dtd2cduce: $(DTD2CDUCE:.cmo=.$(EXTENSION))  dtd2cduce: $(DTD2CDUCE:.cmo=.$(EXTENSION))
129          $(LINK) -o $@ $^          $(LINK) $(INCLUDES) -o $@ $^
130    
131    validate: $(OBJECTS:.cmo=.$(EXTENSION)) tools/validate.ml
132            $(LINK) $(INCLUDES) -o $@ $^
133    
134  .PHONY: compute_depend  .PHONY: compute_depend
135  compute_depend: misc/q_symbol.cmo  compute_depend: $(DEPEND_OCAMLDEP)
136          @echo "Computing dependencies ..."          @echo "Computing dependencies ..."
137          ocamldep $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) | \          ocamlfind ocamldep -package "$(PACKAGES)" $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) | \
138          sed -e "s|: |: misc/q_symbol.cmo |" > depend          sed -e "s|: |: misc/q_symbol.cmo |" > depend
139    
 parser/wlexer.ml: parser/wlexer.mll  
         wlex parser/wlexer.mll  
   
140  clean:  clean:
141          for i in $(CLEAN_DIRS); do \          for i in $(CLEAN_DIRS); do \
142          (cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *~); \          (cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *~); \
143          done          done
144          (cd expat; make clean)          (cd expat; $(MAKE) clean)
145          rm -f `find . -name "*~"`          rm -f `find . -name "*~"`
146          rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~          rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~
147          rm -f cduce ocamlprof.dump          rm -f cduce ocamlprof.dump
148          rm -f dtd2cduce pool webiface          rm -f dtd2cduce pool webiface validate
149          rm -Rf prepro package          rm -Rf prepro package
150          rm -f web/www/*.php web/www/*.html web/*~          rm -f web/www/*.html web/*~
151            rm -f web/*.cdo
152    
153    
154  .SUFFIXES: .ml .mli .cmo .cmi .cmx  .SUFFIXES: .ml .mli .cmo .cmi .cmx
# Line 132  Line 156 
156  misc/q_symbol.cmo: misc/q_symbol.ml  misc/q_symbol.cmo: misc/q_symbol.ml
157          $(CAMLC) -c -pp 'camlp4o pa_extend.cmo q_MLast.cmo' $<          $(CAMLC) -c -pp 'camlp4o pa_extend.cmo q_MLast.cmo' $<
158    
 .PHONY: expat  
 expat:  
         (cd expat; make)  
   
159  .ml.cmo:  .ml.cmo:
160          $(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<          $(CAMLC) -c $(INCLUDES) $(SYNTAX_PARSER) $<
161    
162  .ml.cmx:  .ml.cmx:
163          $(CAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<          $(CAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
# Line 150  Line 170 
170  # CDuce-generated files  # CDuce-generated files
171    
172  driver/examples.ml: cduce web/examples/build.cd web/examples/examples.xml  driver/examples.ml: cduce web/examples/build.cd web/examples/examples.xml
173          (cd web/examples; ../../cduce --quiet build.cd)          (cd web/examples; ../../cduce --quiet build.cd --arg examples.xml)
174    
175  web/files: cduce web/site.cd  webpages: cduce web/site.cdo
176          (cd web; ../cduce --quiet site.cd --arg -php site.xml)          (cd web; ../cduce --run site.cd  --arg site.xml)
   
 #  
 # Customize the following variables to match the settings  
 # of your local web server  
 #  
 WEB_PREFIX = /var/www  
 CGI_DIR = $(WEB_PREFIX)/cgi-bin  
 CDUCE_HTML_DIR = $(WEB_PREFIX)/html  
   
 install_web_local:web/files webiface  
         cp  web/www/*.php web/cduce.css  $(CDUCE_HTML_DIR)/  
         cp webiface $(CGI_DIR)/  
         if test ! -d "$(CDUCE_HTML_DIR)/img" ; then \  
           mkdir $(CDUCE_HTML_DIR)/img; \  
         fi;  
         cp web/img/*.*  $(CDUCE_HTML_DIR)/img  
177    
178    web/site.cdo: cduce web/site.cd
179            ./cduce --compile web/site.cd
180    
181  local_website: cduce  website: webpages webiface
182          (cd web; ../cduce --quiet site.cd --arg site.xml)  
183    install_web: website
184            cp  web/www/*.html web/cduce.css  $(HTML_DIR)/
185            cp CHANGES $(HTML_DIR)/
186            cp webiface $(CGI_DIR)/cduce
187            if test ! -d "$(HTML_DIR)/img" ; then \
188              mkdir $(HTML_DIR)/img; \
189            fi;
190            cp web/img/*.*  $(HTML_DIR)/img

Legend:
Removed from v.467  
changed lines
  Added in v.708

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