-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
65 lines (47 loc) · 1.4 KB
/
Makefile
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
NAME = lasvegas-geom
OCAMLC = ocamlfind ocamlc
OCAMLL = $(OCAMLC) -package "$(REQUIRES)"
OCAMLOPT = ocamlfind ocamlopt
OCAMLDEP = ocamldep
EXECS = test
OBJECTS =
XOBJECTS =
ARCHIVE = $(NAME).cma
XARCHIVE = $(NAME).cmxa
REQUIRES = unix str getopt
PREDICATES =
.PHONY: all pkg optpkg
all: $(EXECS)
test: heap.cmo linearSort.cmo orderStatistics.cmo dynamic.cmo \
greedy.cmo test.cmo
$(OCAMLL) $^ -o $@
pkg: $(ARCHIVE)
optpkg: $(XARCHIVE)
$(ARCHIVE): $(OBJECTS)
$(OCAMLC) -a -o $(ARCHIVE) -package "$(REQUIRES)" -linkpkg \
-predicates "$(PREDICATES)" $(OBJECTS)
$(XARCHIVE): $(XOBJECTS)
$(OCAMLOPT) -a -o $(XARCHIVE) -package "$(REQUIRES)" -linkpkg \
-predicates "$(PREDICATES)" $(XOBJECTS)
.SUFFIXES: .cmo .cmi .cmx .ml .mli
.ml.cmo:
$(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
-c $<
.mli.cmi:
$(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
-c $<
.ml.cmx:
$(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
-c $<
include depend
depend: $(wildcard *.ml*)
if ! ($(OCAMLDEP) *.mli *.ml >depend); then rm depend; fi
.PHONY: install uninstall clean
install: all
{ test ! -f $(XARCHIVE) || extra="$(XARCHIVE) "`basename $(XARCHIVE) .cmxa`.a }; \
ocamlfind install $(NAME) *.mli *.cmi $(ARCHIVE) META $$extra
uninstall:
ocamlfind remove $(NAME)
clean:
rm -f depend *.cmi *.cmo *.cmx *.cma *.cmxa *.a $(EXECS)
rm -f depend *.dvi *.log *.aux *.ps