-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (51 loc) · 1.6 KB
/
Copy pathMakefile
File metadata and controls
67 lines (51 loc) · 1.6 KB
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
NAME = buddy
VERSION = 0.2
LIBS = _build/$(NAME).cma
LIBS_OPT = _build/$(NAME).cmxa _build/$(NAME).cmxs
#PROGS = _build/solver.byte
#PROGS_OPT = _build/solver.native
RESULTS = $(LIBS) #$(PROGS)
RESULTS_OPT = $(LIBS_OPT) #$(PROGS_OPT)
SOURCES = $(wildcard *.ml *.mli) *.c
OCAMLBUILD = ocamlbuild
OBFLAGS = -classic-display -use-ocamlfind
OCAMLFIND = ocamlfind
DESTDIR =
LIBDIR = $(DESTDIR)/$(shell ocamlc -where)
BINDIR = $(DESTDIR)/usr/bin
ifeq ($(DESTDIR),)
INSTALL = $(OCAMLFIND) install
UNINSTALL = $(OCAMLFIND) remove
else
INSTALL = $(OCAMLFIND) install -destdir $(LIBDIR)
UNINSTALL = $(OCAMLFIND) remove -destdir $(LIBDIR)
endif
DIST_DIR = $(NAME)-$(VERSION)
DIST_TARBALL = $(DIST_DIR).tar.gz
DEB_TARBALL = $(subst -,_,$(DIST_DIR).orig.tar.gz)
all: $(RESULTS)
opt: $(RESULTS_OPT)
$(RESULTS): $(SOURCES)
$(RESULTS_OPT): $(SOURCES)
clean:
$(OCAMLBUILD) $(OBFLAGS) -clean
_build/%:
$(OCAMLBUILD) $(OBFLAGS) $*
@touch $@
docs:
if [ ! -d doc ]; then mkdir doc; fi
ocamldoc $(OCFLAGS) -html -d doc $(NAME).mli
headers: header.txt .headache.conf
headache -h header.txt -c .headache.conf $(SOURCES)
INSTALL_STUFF = META
INSTALL_STUFF += $(wildcard _build/*$(NAME)*.cma _build/$(NAME).cmxa _build/*$(NAME)*.a)
INSTALL_STUFF += $(wildcard _build/*$(NAME)*.cmi) $(wildcard *.mli)
INSTALL_STUFF += $(wildcard _build/*$(NAME)*.cmx _build/dll$(NAME)_stubs.so)
# -ldconf ignore _build/dll$(NAME)_stubs.so
install:
test -d $(LIBDIR) || mkdir -p $(LIBDIR)
$(INSTALL) -ldconf ignore -patch-version $(VERSION) $(NAME) $(INSTALL_STUFF)
uninstall:
$(UNINSTALL) $(NAME)
test: _build/test.byte test.ml
_build/test.byte -verbose