Makefile 3.25 KB
Newer Older
1
NATIVE=false
2

3
include Makefile.distrib
4

5 6
# For development

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

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

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

30
# Site-specific installation
31 32

cedre_build:
33
	rsh cedre ". .env; cd IMPLEM/CDUCE; $(MAKE) webiface webpages"
34
	scp CHANGES web/www/*.html web/cduce.css cduce@iris:public_html/
35
	scp webiface cduce@iris:cgi-bin/cduce
36

37
install_web_distant:
38
	$(MAKE) webpages
39
	scp CHANGES web/www/*.html web/cduce.css cduce@iris:public_html/
40

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

47
# Packaging
48

49
DISTRIB = $(DIRS) cduce.spec expat tools web depend INSTALL INSTALL.WIN32 CHANGES LICENSE README Makefile.conf doc
50

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

64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
.PHONY: .ocamlinit
.ocamlinit:
	echo '(* AUTOMATICALLY GENERATED by Makefile: DO NOT EDIT! *)' > $@
	echo '#load "/usr/lib/ocaml/3.07/pcre/pcre.cma";;' >> $@
	echo '#load "/usr/lib/ocaml/3.07/unix.cma";;' >> $@
	echo '#load "/usr/lib/ocaml/3.07/netstring/netstring.cma";;' >> $@
# 	echo '#load "/usr/lib/ocaml/3.07/netstring/netstring_top.cmo";;' >> $@
	echo '#load "/usr/lib/ocaml/3.07/pxp-engine/pxp_engine.cma";;' >> $@
# 	echo '#load "/usr/lib/ocaml/3.07/pxp-engine/pxp_top.cmo";;' *)' >> $@
	echo '#load "/usr/lib/ocaml/3.07/pxp-lex-iso88591/pxp_lex_iso88591.cma";;' >> $@
	echo '#load "/usr/lib/ocaml/3.07/pxp-lex-iso88591/pxp_lex_link_iso88591.cmo";;' >> $@
	echo '#load "/usr/lib/ocaml/3.07/ulex/ulexing.cma";;' >> $@
	echo '#load "/usr/lib/ocaml/3.07/nums.cma";;' >> $@
# 	echo '#load "/usr/lib/ocaml/3.07/num_top.cma";;' >> $@
	echo '#load "/usr/lib/ocaml/3.07/cgi/cgi.cma";;' >> $@
	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: *)' >> $@

85 86 87 88 89 90 91 92 93 94 95
CVS_DISTRIB = web CHANGES LICENSE README doc cduce dtd2cduce
cvs_snapshot: clean
	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