forked from mirage/ocaml-cohttp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (32 loc) · 1.17 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
.PHONY: all clean install build
all: build test doc
PREFIX ?= /usr/local
NAME=cohttp
LWT ?= $(shell if ocamlfind query lwt >/dev/null 2>&1; then echo --enable-lwt; fi)
LWT_UNIX ?= $(shell if ocamlfind query lwt.ssl >/dev/null 2>&1; then echo --enable-lwt-unix; fi)
ASYNC ?= $(shell if ocamlfind query async >/dev/null 2>&1; then echo --enable-async; fi)
JS ?= $(shell if ocamlfind query js_of_ocaml >/dev/null 2>&1; then echo --enable-js; fi)
#NETTESTS ?= --enable-tests --enable-nettests
setup.bin: setup.ml
ocamlopt.opt -o $@ $< 2>/dev/null || ocamlopt -o $@ $< 2>/dev/null || ocamlc -o $@ $<
rm -f setup.cmx setup.cmi setup.o setup.cmo
setup.data: setup.bin
./setup.bin -configure $(LWT) $(ASYNC) $(LWT_UNIX) $(JS) $(TESTS) $(NETTESTS) --prefix $(PREFIX)
build: setup.data setup.bin
./setup.bin -build -classic-display
doc: setup.data setup.bin
./setup.bin -doc
install: setup.bin
./setup.bin -install
test: setup.bin build
./setup.bin -test
fulltest: setup.bin build
./setup.bin -test
reinstall: setup.bin
ocamlfind remove $(NAME) || true
./setup.bin -reinstall
generate:
cd scripts && ocaml generate.ml
clean:
ocamlbuild -clean
rm -f setup.data setup.log setup.bin