forked from mirage/ocaml-dns
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
41 lines (30 loc) · 972 Bytes
/
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
.PHONY: all clean distclean setup build doc install test
all: build
J ?= 2
PREFIX ?= /usr/local
NAME=dns
LWT ?= $(shell if ocamlfind query lwt.unix >/dev/null 2>&1; then echo --enable-lwt; fi)
MIRAGE ?= $(shell if ocamlfind query mirage-net >/dev/null 2>&1; then echo --enable-mirage; fi)
ifneq ($(MIRAGE_OS),xen)
TESTS ?= --enable-tests
endif
-include Makefile.config
setup.data: setup.bin
./setup.bin -configure $(LWT) $(ASYNC) $(MIRAGE) $(TESTS) $(NETTESTS) --prefix $(PREFIX)
distclean: setup.data setup.bin
./setup.bin -distclean $(OFLAGS)
$(RM) setup.bin
setup: setup.data
build: setup.data setup.bin
./setup.bin -build -j $(J) $(OFLAGS)
clean:
ocamlbuild -clean
rm -f setup.data setup.bin
doc: setup.data setup.bin
./setup.bin -doc -j $(J) $(OFLAGS)
install:
ocamlfind remove $(NAME) $(OFLAGS)
./setup.bin -install
setup.bin: setup.ml
ocamlopt.opt -o $@ $< || ocamlopt -o $@ $< || ocamlc -o $@ $<
$(RM) setup.cmx setup.cmi setup.o setup.cmo