Makefile.code 1.38 KB
Newer Older
gerd's avatar
gerd committed
1 2 3
#----------------------------------------------------------------------
# specific rules for this package:

gerd's avatar
gerd committed
4
OBJECTS  = to_html.cmo to_latex.cmo dtd.cmo
gerd's avatar
gerd committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
XOBJECTS = $(OBJECTS:.cmo=.cmx)
ARCHIVE  = presentation.cma
XARCHIVE = presentation.cmxa
NAME     = presentation
REQUIRES = unix pcre pxp

presentation.bin: $(ARCHIVE) main.cmo
	ocamlfind ocamlc -o presentation.bin -g -custom -package "$(REQUIRES)" \
		-linkpkg $(ARCHIVE) main.cmo 

presentation.bin.opt: $(XARCHIVE) main.cmx
	ocamlfind ocamlopt -o presentation.bin.opt -package "$(REQUIRES)" \
		-linkpkg $(XARCHIVE) main.cmx 

$(ARCHIVE): $(OBJECTS)
	$(OCAMLC) -a -o $(ARCHIVE) $(OBJECTS)

$(XARCHIVE): $(XOBJECTS)
	$(OCAMLOPT) -a -o $(XARCHIVE) $(XOBJECTS)

gerd's avatar
gerd committed
25 26 27 28 29
dtd.ml: presentation.dtd
	printf 'let dtd_1 = "' >dtd.ml
	sed -e 's/["\]/\\\0/g' presentation.dtd >>dtd.ml
	echo '";;' >>dtd.ml

gerd's avatar
gerd committed
30 31 32 33
#----------------------------------------------------------------------
# general rules:

OPTIONS   =
34 35
OCAMLC    = ocamlfind ocamlc -g -safe-string $(OPTIONS)   -package "$(REQUIRES)"
OCAMLOPT  = ocamlfind ocamlopt -p -safe-string $(OPTIONS) -package "$(REQUIRES)"
gerd's avatar
gerd committed
36 37 38
OCAMLDEP  = ocamldep $(OPTIONS)
OCAMLFIND = ocamlfind

gerd's avatar
gerd committed
39 40
.PRECIOUS: depend

gerd's avatar
gerd committed
41
depend: *.ml dtd.ml
gerd's avatar
gerd committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
	$(OCAMLDEP) *.ml *.mli >depend

.SUFFIXES: .cmo .cmi .cmx .ml .mli .mll .mly

.ml.cmx:
	$(OCAMLOPT) -c $<

.ml.cmo:
	$(OCAMLC) -c -g $<

.mli.cmi:
	$(OCAMLC) -c $<

.mll.ml:
	ocamllex $<

*.mli:

gerd's avatar
gerd committed
60
-include depend