Makefile 3.46 KB
Newer Older
1
include Makefile.distrib
2

3 4
# For development

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

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

10
profile: misc/q_symbol.cmo
11 12 13 14 15 16 17 18 19 20 21
	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
22 23 24 25 26
	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)
27

28
# Site-specific installation
29

30 31
charme_build:
	rsh charme ". .env; cd IMPLEM/CDUCE; $(MAKE) webiface webpages"
32
	scp CHANGES INSTALL INSTALL.WIN32 web/www/*.html web/cduce.css cduce@iris:public_html/
33
	scp webiface cduce@iris:cgi-bin/cduce
34

35
install_web_distant:
36
	$(MAKE) webpages
37
	scp CHANGES  INSTALL INSTALL.WIN32 web/www/*.html web/cduce.css cduce@iris:public_html/
38

39
SCRIPT =
40
INCLUDES_DEB = $(INCLUDES) $(shell ocamlfind query -i-format -recursive $(PACKAGES))
41 42
DEBUGGER = ocamldebug
debug:
43
	ledit $(DEBUGGER) $(INCLUDES_DEB) ./cduce $(SCRIPT)
44

45
# Packaging
46

47
DISTRIB = $(DIRS) cduce.spec expat tools web depend INSTALL INSTALL.WIN32 CHANGES LICENSE README Makefile.conf.template configure configure.ml doc
48

49
PACKAGE = cduce-$(VERSION)
50
.PHONY: package
51
package: clean
52 53 54 55 56 57 58
	rm -Rf $(PACKAGE)
	mkdir $(PACKAGE)
	cp -R $(DISTRIB) $(PACKAGE)/
	cp Makefile.distrib $(PACKAGE)/Makefile
	(cd $(PACKAGE); \
	rm -f types/IDEAS; \
	headache -h ../header $(DEPEND))
59
	tar czf $(PACKAGE).tar.gz --exclude CVS --exclude ".#*" $(PACKAGE)
60 61
	rm -Rf $(PACKAGE)

62 63 64
cvs_snapshot:
	$(MAKE) package VERSION=cvs`date +%Y%m%d`

65
OCAML_STDLIBDIR := $(shell ocamlc -where)
66 67 68
.PHONY: .ocamlinit
.ocamlinit:
	echo '(* AUTOMATICALLY GENERATED by Makefile: DO NOT EDIT! *)' > $@
69 70 71 72 73 74 75 76 77 78 79 80
	echo '#load "$(OCAML_STDLIBDIR)/pcre/pcre.cma";;' >> $@
	echo '#load "$(OCAML_STDLIBDIR)/unix.cma";;' >> $@
	echo '#load "$(OCAML_STDLIBDIR)/netstring/netstring.cma";;' >> $@
# 	echo '#load "$(OCAML_STDLIBDIR)/netstring/netstring_top.cmo";;' >> $@
	echo '#load "$(OCAML_STDLIBDIR)/pxp-engine/pxp_engine.cma";;' >> $@
# 	echo '#load "$(OCAML_STDLIBDIR)/pxp-engine/pxp_top.cmo";;' *)' >> $@
	echo '#load "$(OCAML_STDLIBDIR)/pxp-lex-iso88591/pxp_lex_iso88591.cma";;' >> $@
	echo '#load "$(OCAML_STDLIBDIR)/pxp-lex-iso88591/pxp_lex_link_iso88591.cmo";;' >> $@
	echo '#load "$(OCAML_STDLIBDIR)/ulex/ulexing.cma";;' >> $@
	echo '#load "$(OCAML_STDLIBDIR)/nums.cma";;' >> $@
# 	echo '#load "$(OCAML_STDLIBDIR)/num_top.cma";;' >> $@
	echo '#load "$(OCAML_STDLIBDIR)/cgi/cgi.cma";;' >> $@
81 82 83 84 85 86
	for o in $(VALIDATE_OBJECTS); do echo "prerr_endline \"Loading $$o ...\";;" >> $@; echo "#load \"$$o\";;" >> $@; done
	for d in $(DIRS); do echo "#directory \"$$d\";;" >> $@; done
	for p in pcre netstring pxp-engine ulex cgi; do echo "#directory \"`$(OCAMLFIND) query $$p`\";;" >> $@; done
	echo "prerr_endline \"All done!\"" >> $@
	echo '(* vim: set ft=ocaml: *)' >> $@

87
CVS_DISTRIB = web CHANGES LICENSE README doc cduce dtd2cduce
88
cvs_snapshot_bin: clean
89 90 91 92 93 94 95 96 97
	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
	cp -R $(CVS_DISTRIB) cduce-cvs
	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
98 99 100 101 102

.PHONY: test
test:
	$(MAKE) -C tests test