-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
61 lines (48 loc) · 1.42 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
NAME = minisat
VERSION = 0.3
LIBS = _build/minisat.cma
LIBS_OPT = _build/minisat.cmxa
PROGS = _build/solver.byte
PROGS_OPT = _build/solver.native
RESULTS = $(LIBS) $(PROGS)
RESULTS_OPT = $(LIBS_OPT) $(PROGS_OPT)
SOURCES = $(wildcard *.ml *.mli)
OCAMLBUILD = ocamlbuild
#OBFLAGS = -classic-display
OBFLAGS =
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 minisat.mli
INSTALL_STUFF = META
INSTALL_STUFF += $(wildcard _build/*minisat*.cma _build/minisat.cmxa _build/*minisat*.a)
INSTALL_STUFF += $(wildcard _build/*minisat*.cmi) $(wildcard *.mli)
INSTALL_STUFF += $(wildcard _build/*minisat*.cmx _build/dllminisat_stubs.so)
# -ldconf ignore _build/dllminisat_stubs.so
install:
test -d $(LIBDIR) || mkdir -p $(LIBDIR)
$(INSTALL) -ldconf ignore -patch-version $(VERSION) $(NAME) $(INSTALL_STUFF)
uninstall:
$(UNINSTALL) $(NAME)