File: Makefile

package info (click to toggle)
xml-light 2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 212 kB
  • ctags: 352
  • sloc: ml: 1,691; makefile: 171
file content (115 lines) | stat: -rw-r--r-- 3,389 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Makefile generated by OCamake 
# http://tech.motion-twin.com
VERSION=2.4
OCAMLOPT=ocamlopt
OCAMLC=ocamlc
OCAMLFIND=ocamlfind

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

INSTALLDIR=`$(OCAMLC) -where`
XML_LIGHT_OCAML_CFLAGS= $(OCAML_CFLAGS)
XML_LIGHT_OCAML_LFLAGS= $(OCAML_LFLAGS) -a
LIBS=

NATDYNLINK := $(shell if [ -f `ocamlc -where`/dynlink.cmxa ]; then echo YES; else echo NO; fi)

ifeq "${NATDYNLINK}" "YES"
CMXS=xml-light.cmxs
endif


all: xml-light.cma test.exe doc

opt: xml-light.cmxa $(CMXS) test_opt.exe

installcommon: all
	cp xml.mli xmlParser.mli dtd.mli xml.cmi xmlParser.cmi dtd.cmi $(INSTALLDIR)

installbyte: all installcommon
	cp xml-light.cma $(INSTALLDIR)

installopt: opt installcommon
	cp xml-light.a xml-light.cmxa $(CMXS) xml.cmx dtd.cmx xmlParser.cmx $(INSTALLDIR)

install: installbyte installopt

wininstall: all opt
	cp xml-light.cmxa xml-light.lib xml-light.cma xml.mli xmlParser.mli dtd.mli xml.cmi xmlParser.cmi dtd.cmi xml.cmx dtd.cmx xmlParser.cmx c:\ocaml\lib

install_ocamlfind: all opt
	cp META.in META
	sed -itmp "s|@VERSION@|$(VERSION)|g" META
	rm -rf METAtmp
	$(OCAMLFIND) install xml-light META xml-light.a xml-light.cma xml-light.cmxa $(CMXS) xml.cmx dtd.cmx xmlParser.cmx xml.mli xmlParser.mli dtd.mli xml.cmi xmlParser.cmi dtd.cmi

doc:
	mkdir doc
	ocamldoc -sort -html -d doc xml.mli dtd.mli xmlParser.mli

test.exe: xml-light.cma
	$(OCAMLC) xml-light.cma test.ml -o test.exe

test_opt.exe: xml-light.cmxa
	$(OCAMLOPT) xml-light.cmxa test.ml -o test_opt.exe

xml-light.cma: xml_parser.cmo xml_lexer.cmo dtd.cmo xmlParser.cmo xml.cmo 
	$(OCAMLC) -o xml-light.cma $(XML_LIGHT_OCAML_LFLAGS) $(LIBS) xml_parser.cmo xml_lexer.cmo dtd.cmo xmlParser.cmo xml.cmo

xml-light.cmxa: xml_parser.cmx xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx 
	$(OCAMLOPT) -o xml-light.cmxa $(XML_LIGHT_OCAML_LFLAGS) $(LIBS) xml_parser.cmx xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx

xml-light.cmxs: xml-light.cmxa
	$(OCAMLOPT) -shared -linkall -I . -o xml-light.cmxs xml-light.cmxa

dtd.cmo: xml.cmi xml_lexer.cmi dtd.cmi

dtd.cmx: xml.cmi xml_lexer.cmi dtd.cmi

xml.cmo: dtd.cmi xmlParser.cmi xml_lexer.cmi xml.cmi

xml.cmx: dtd.cmi xmlParser.cmi xml_lexer.cmi xml.cmi

xmlParser.cmo: dtd.cmi xml.cmi xml_lexer.cmi xmlParser.cmi

xmlParser.cmx: dtd.cmi xml.cmi xml_lexer.cmi xmlParser.cmi

dtd.cmi: xml.cmi

xml.cmi: 

xmlParser.cmi: dtd.cmi xml.cmi

xml_lexer.cmi: dtd.cmi

xml_parser.cmo: xml_parser.ml dtd.cmi xml_parser.mli xml_parser.cmi

xml_parser.cmx: xml_parser.ml dtd.cmi xml_parser.mli xml_parser.cmi

xml_parser.cmi: xml_parser.mli dtd.cmi xml.cmi

xml_lexer.cmo: xml_lexer.ml xml_lexer.cmi

xml_lexer.cmx: xml_lexer.ml xml_lexer.cmi

clean:
	rm -f xml-light.cma test.exe dtd.cmo dtd.cmi test.cmo test.cmi xml.cmo xml.cmi xmlParser.cmo xmlParser.cmi dtd.cmi xml.cmi xmlParser.cmi xml_lexer.cmi xml_lexer.cmo xml_lexer.ml xml_parser.mli xml_parser.cmi xml_parser.ml xml_parser.cmo
	rm -f xml-light.lib xml-light.a xml-light.cmxa test_opt.exe dtd.cmx dtd.obj dtd.o test.cmx test.obj test.o xml.cmx xml.obj xml.o xmlParser.cmx xmlParser.obj xmlParser.o xml_lexer.cmx xml_lexer.obj xml_lexer.o xml_parser.cmx xml_parser.obj xml_parser.o


# SUFFIXES
.ml.cmo:
	$(OCAMLC) $(XML_LIGHT_OCAML_CFLAGS) -c $<

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

.mli.cmi:
	$(OCAMLC) $(XML_LIGHT_OCAML_CFLAGS) $<

.mll.ml:
	ocamllex $<

.mly.ml:
	ocamlyacc $<