Makefile 3.08 KB
Newer Older
1
include Makefile.distrib
2
CGIDIR = /usr/lib/cgi-bin/cduce
3

4 5
# For development

6 7
pull: tools/pull.$(EXTENSION)
	$(LINK) -o $@ $^
8

9
PREPRO = camlp4o -I `ocamlfind query ulex` pa_ulex.cma pr_o.cmo $(SYNTAX) -sep "\n"
10

11
profile: misc/q_symbol.cmo.stamp
12 13 14 15 16 17 18 19 20 21 22
	rm -Rf prepro
	mkdir prepro
	for i in $(DIRS); do \
	mkdir prepro/$$i; \
	for j in $$i/*.ml $$i/*.mli; do \
	if [ -f "$$j" ]; then \
	 echo $$j; \
	 $(PREPRO) $$j -o prepro/$$j; \
	fi; \
	done; \
	done
23 24 25 26 27
	cp Makefile.distrib Makefile Makefile.conf prepro/
	(cd prepro;  \
	touch depend; \
	$(MAKE) compute_depend PROFILE=true SYNTAX_PARSER= ; \
	$(MAKE) cduce PROFILE=true SYNTAX_PARSER= NATIVE=false)
28

29

30
SCRIPT =
31
INCLUDES_DEB = $(INCLUDES) $(shell ocamlfind query -i-format -recursive $(PACKAGES))
32 33
DEBUGGER = ocamldebug
debug:
34
	ledit $(DEBUGGER) $(INCLUDES_DEB) ./cduce $(SCRIPT)
35

36
# Packaging
37

38
DISTRIB = $(DIRS) web cduce.spec depend INSTALL INSTALL.WIN32 CHANGES \
39
 LICENSE README AUTHORS Makefile.conf.template configure configure.ml doc \
40
 META.in cduce_mktop VERSION PLIST.godi Makefile.macosx tools/make-package-macosx
41 42

DISTRIB_DOC = doc.xml memento.xml tutorial.xml manual.xml tutorial manual \
43
 xhtml.cd xhtml-categ.cd xhtml-strict.cd site.cd siteTypes.cd
44

45
PACKAGE = cduce-$(VERSION)
46
.PHONY: package
47
package: clean
48 49
	rm -Rf $(PACKAGE).tar.gz
	git archive --prefix=$(PACKAGE)/ -o $(PACKAGE).tar.gz HEAD
50

51
OCAML_STDLIBDIR := $(shell ocamlc -where)
52
.PHONY:
53

54 55
CVS_DISTRIB = web CHANGES LICENSE README AUTHORS cduce dtd2cduce
CVS_DOC = doc/cdo2ml.1 doc/cduce.1 doc/cduce_mktop.1  doc/cduce_validate.1 doc/dtd2cduce.1 doc/fomanual/tutorial.pdf doc/fomanual/manual.pdf
56
cvs_snapshot_bin: clean
57 58 59 60
	if [[ `uname` != Linux ]]; then echo "Not a Linux box!"; exit 2; fi
	$(MAKE) cduce dtd2cduce NATIVE=true EXTRA_LINK_OPTS="-ccopt -static" VERSION=cvs`date +%Y%m%d`
	rm -Rf cduce-cvs
	mkdir cduce-cvs
61
	mkdir cduce-cvs/doc
62
	cp -R $(CVS_DISTRIB) cduce-cvs
63
	cp $(CVS_DOC) cduce-cvs/doc
64 65 66 67
	cp Makefile.binary cduce-cvs/Makefile
	tar czf cduce-cvs-linux-static.tar.gz --exclude CVS cduce-cvs
	rm -Rf cduce-cvs
	scp cduce-cvs-linux-static.tar.gz cduce@di.ens.fr:public_html/download
68 69

.PHONY: test
70
test: all
71 72 73 74
	@tests/test.sh

extendedtest: all
	@tests/test.sh -e
75

Pietro Abate's avatar
Pietro Abate committed
76
############ CGI DEMO ###################
77

Pietro Abate's avatar
Pietro Abate committed
78
cgi: webiface evaluator
79

80 81 82 83 84
install_cgi: cgi
	@echo "Install cgi scripts"
	$(HIDE)$(INSTALL) -m755 webiface $(CGIDIR)/cduce
	$(HIDE)$(INSTALL) -m755 evaluator $(CGIDIR)/demo_evaluator

85
driver/examples.ml: cduce web/xhtml.cdo web/examples/build.cd web/examples/examples.xml
86
	(cd web/examples; ../../cduce build.cd -I .. --arg examples.xml)
87 88 89 90

WEBIFACE  = $(OBJECTS) driver/examples.cmo driver/webiface.cmo
EVALUATOR = $(OBJECTS) driver/evaluator.cmo

Giuseppe Castagna's avatar
Giuseppe Castagna committed
91
webiface: $(WEBIFACE:.cmo=.$(EXTENSION))
92 93
	@echo "Build $@"
	$(HIDE)$(LINK) -verbose $(INCLUDES) -o $@ $^ $(EXTRA_OPTS_WEBIFACE)
94 95

evaluator: $(EVALUATOR:.cmo=.$(EXTENSION))
96 97
	@echo "Build $@"
	$(HIDE)$(LINK) -verbose $(INCLUDES) -o $@ $^ $(EXTRA_OPTS_WEBIFACE)
98 99 100 101

# webiface can be made static to be able to move it more easily
# (to compile it on a machine which is not the web server)
# Seems to be some problems with statically linking curl
102
# EXTRA_OPTS_WEBIFACE += -ccopt -static