Commit 5a85aa54 authored by Pietro Abate's avatar Pietro Abate

[r2003-05-25 18:35:04 by cvscast] Makefile.distrib

Original author: cvscast
Date: 2003-05-25 18:35:04+00:00
parent fef412d1
NATIVE = true
PROFILE = false
PXP_WLEX = false
PACKAGES = -package "pxp-engine pxp-lex-iso88591 wlexing camlp4 num cgi"
ifeq ($(PXP_WLEX), true)
PACKAGES += -package pxp-wlex-utf8
else
PACKAGES += -package pxp-lex-utf8
endif
SYNTAX = camlp4o pa_extend.cmo
VERSION = 0.0.9 (alpha)
ifeq ($(PROFILE), true)
CAMLC_P = ocamlcp -p a
CAMLOPT_P = ocamlopt -p
SYNTAX_PARSER =
else
CAMLC_P = ocamlc
CAMLOPT_P = ocamlopt
SYNTAX_PARSER = -pp '$(SYNTAX)'
endif
OPT = -warn-error A
CAMLC = ocamlfind $(CAMLC_P) $(OPT) $(PACKAGES)
CAMLOPT = ocamlfind $(CAMLOPT_P) $(OPT) $(PACKAGES)
ifeq ($(NATIVE), true)
EXTENSION = cmx
LINK = $(CAMLOPT) -linkpkg gramlib.cmxa
else
EXTENSION = cmo
LINK = $(CAMLC) -custom -linkpkg gramlib.cma
endif
all: cduce dtd2cduce local_website
# Source directories
DIRS = misc parser typing types runtime driver
CLEAN_DIRS = $(DIRS) tools tests
# Objects to build
OBJECTS = \
misc/cduce_config.cmo \
misc/state.cmo misc/pool.cmo misc/encodings.cmo misc/bool.cmo \
misc/pretty.cmo \
\
types/sortedList.cmo types/boolean.cmo types/ident.cmo \
types/intervals.cmo types/chars.cmo types/atoms.cmo types/normal.cmo \
types/types.cmo types/patterns.cmo types/sequence.cmo \
types/sample.cmo \
\
parser/location.cmo parser/wlexer.cmo parser/ast.cmo parser/parser.cmo \
\
typing/typed.cmo typing/typer.cmo \
\
runtime/value.cmo runtime/load_xml.cmo runtime/run_dispatch.cmo \
runtime/print_xml.cmo runtime/eval.cmo \
\
types/builtin.cmo driver/cduce.cmo
CDUCE = $(OBJECTS) driver/run.cmo
WEBIFACE = $(OBJECTS) driver/examples.cmo driver/webiface.cmo
DTD2CDUCE = tools/dtd2cduce.cmo
DEPEND = $(DIRS:=/*.ml) $(DIRS:=/*.mli)
INCLUDES = $(DIRS:%=-I %)
PREPRO = $(SYNTAX) pr_o.cmo
misc/cduce_config.cmo: misc/cduce_config.ml
$(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
rm -f misc/cduce_config.ml
misc/cduce_config.cmx: misc/cduce_config.ml
$(CAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
rm -f misc/cduce_config.ml
misc/cduce_config.ml:
sed -e 's|%%VERSION%%|$(VERSION)|' \
-e 's|%%BUILD_DATE%%|$(shell date +%Y-%m-%d)|' \
-e 's|%%NATIVE%%|$(NATIVE)|' \
misc/cduce_config.mlp > misc/cduce_config.ml
cduce: $(CDUCE:.cmo=.$(EXTENSION))
$(LINK) $(INCLUDES) -o $@ $^
webiface: $(WEBIFACE:.cmo=.$(EXTENSION))
$(LINK) -o $@ $^
dtd2cduce: $(DTD2CDUCE:.cmo=.$(EXTENSION))
$(LINK) -o $@ $^
.PHONY: compute_depend
compute_depend:
@echo "Computing dependencies ..."
ocamldep $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) > depend
parser/wlexer.ml: parser/wlexer.mll
wlex parser/wlexer.mll
clean:
for i in $(CLEAN_DIRS); do \
(cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *~); \
done
rm -f `find -name "*~"`
rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~
rm -f cduce ocamlprof.dump
rm -f dtd2cduce pool webiface
rm -Rf prepro package
rm -f web/www/*.php web/www/*.html web/*~
.SUFFIXES: .ml .mli .cmo .cmi .cmx
.ml.cmo:
$(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
.ml.cmx:
$(CAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
.mli.cmi:
$(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
include depend
# CDuce-generated files
driver/examples.ml: cduce web/examples/build.cd web/examples/examples.xml
(cd web/examples; ../../cduce --quiet build.cd)
web/files: cduce web/site.cd
(cd web; ../cduce --quiet site.cd --arg -php site.xml)
# Packaging
write_header:
headache -h header $(DEPEND)
remove_header:
headache -r $(DEPEND)
include Makefile.distrib
# For development
......@@ -175,37 +30,25 @@ install_web:
scp webiface cduce@iris:cgi-bin/cduce
ssh cduce@iris "chmod +s cgi-bin/cduce"
#
# 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
website: web/files
scp web/www/*.php web/cduce.css cduce@iris.ens.fr:public_html/
local_website: cduce
(cd web; ../cduce --quiet site.cd --arg site.xml)
# Distribution
# Packaging
DISTRIB = $(DIRS) tools web depend INSTALL CHANGES LICENSE README Makefile
DISTRIB = $(DIRS) tools web depend INSTALL CHANGES LICENSE README doc
PACKAGE = cduce-$(VERSION)
.PHONY: package
package:
rm -Rf package
mkdir package
cp -R $(DISTRIB) package/
(cd package; headache -h ../header $(DEPEND); rm -Rf `find -name "CVS"`)
rm -Rf $(PACKAGE)
mkdir $(PACKAGE)
cp -R $(DISTRIB) $(PACKAGE)/
cp Makefile.distrib $(PACKAGE)/Makefile
(cd $(PACKAGE); \
rm -f types/IDEAS; \
headache -h ../header $(DEPEND))
tar czf $(PACKAGE).tar.gz --exclude CVS --exclude IDEAS $(PACKAGE)
rm -Rf $(PACKAGE)
NATIVE = true
PROFILE = false
PXP_WLEX = false
PACKAGES = -package "pxp-engine pxp-lex-iso88591 wlexing camlp4 num cgi"
ifeq ($(PXP_WLEX), true)
PACKAGES += -package pxp-wlex-utf8
else
PACKAGES += -package pxp-lex-utf8
endif
SYNTAX = camlp4o pa_extend.cmo
VERSION = 0.0.9
ifeq ($(PROFILE), true)
CAMLC_P = ocamlcp -p a
CAMLOPT_P = ocamlopt -p
SYNTAX_PARSER =
else
CAMLC_P = ocamlc
CAMLOPT_P = ocamlopt
SYNTAX_PARSER = -pp '$(SYNTAX)'
endif
OPT = -warn-error A
CAMLC = ocamlfind $(CAMLC_P) $(OPT) $(PACKAGES)
CAMLOPT = ocamlfind $(CAMLOPT_P) $(OPT) $(PACKAGES)
ifeq ($(NATIVE), true)
EXTENSION = cmx
LINK = $(CAMLOPT) -linkpkg gramlib.cmxa
else
EXTENSION = cmo
LINK = $(CAMLC) -custom -linkpkg gramlib.cma
endif
all: cduce dtd2cduce local_website
# Source directories
DIRS = misc parser typing types runtime driver
CLEAN_DIRS = $(DIRS) tools tests
# Objects to build
OBJECTS = \
misc/cduce_config.cmo \
misc/state.cmo misc/pool.cmo misc/encodings.cmo misc/bool.cmo \
misc/pretty.cmo \
\
types/sortedList.cmo types/boolean.cmo types/ident.cmo \
types/intervals.cmo types/chars.cmo types/atoms.cmo types/normal.cmo \
types/types.cmo types/patterns.cmo types/sequence.cmo \
types/sample.cmo \
\
parser/location.cmo parser/wlexer.cmo parser/ast.cmo parser/parser.cmo \
\
typing/typed.cmo typing/typer.cmo \
\
runtime/value.cmo runtime/load_xml.cmo runtime/run_dispatch.cmo \
runtime/print_xml.cmo runtime/eval.cmo \
\
types/builtin.cmo driver/cduce.cmo
CDUCE = $(OBJECTS) driver/run.cmo
WEBIFACE = $(OBJECTS) driver/examples.cmo driver/webiface.cmo
DTD2CDUCE = tools/dtd2cduce.cmo
DEPEND = $(DIRS:=/*.ml) $(DIRS:=/*.mli)
INCLUDES = $(DIRS:%=-I %)
PREPRO = $(SYNTAX) pr_o.cmo
misc/cduce_config.cmo: misc/cduce_config.ml
$(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
rm -f misc/cduce_config.ml
misc/cduce_config.cmx: misc/cduce_config.ml
$(CAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
rm -f misc/cduce_config.ml
misc/cduce_config.ml:
sed -e 's|%%VERSION%%|$(VERSION)|' \
-e 's|%%BUILD_DATE%%|$(shell date +%Y-%m-%d)|' \
-e 's|%%NATIVE%%|$(NATIVE)|' \
misc/cduce_config.mlp > misc/cduce_config.ml
cduce: $(CDUCE:.cmo=.$(EXTENSION))
$(LINK) $(INCLUDES) -o $@ $^
webiface: $(WEBIFACE:.cmo=.$(EXTENSION))
$(LINK) -o $@ $^
dtd2cduce: $(DTD2CDUCE:.cmo=.$(EXTENSION))
$(LINK) -o $@ $^
.PHONY: compute_depend
compute_depend:
@echo "Computing dependencies ..."
ocamldep $(INCLUDES) $(SYNTAX_PARSER) $(DEPEND) > depend
parser/wlexer.ml: parser/wlexer.mll
wlex parser/wlexer.mll
clean:
for i in $(CLEAN_DIRS); do \
(cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *~); \
done
rm -f `find -name "*~"`
rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.o *~
rm -f cduce ocamlprof.dump
rm -f dtd2cduce pool webiface
rm -Rf prepro package
rm -f web/www/*.php web/www/*.html web/*~
.SUFFIXES: .ml .mli .cmo .cmi .cmx
.ml.cmo:
$(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
.ml.cmx:
$(CAMLOPT) -c $(SYNTAX_PARSER) $(INCLUDES) $<
.mli.cmi:
$(CAMLC) -c $(SYNTAX_PARSER) $(INCLUDES) $<
include depend
# CDuce-generated files
driver/examples.ml: cduce web/examples/build.cd web/examples/examples.xml
(cd web/examples; ../../cduce --quiet build.cd)
web/files: cduce web/site.cd
(cd web; ../cduce --quiet site.cd --arg -php 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
local_website: cduce
(cd web; ../cduce --quiet site.cd --arg site.xml)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment