-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
56 lines (42 loc) · 1.26 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
# $Id$
VERSION = 0.0.0
FLAGS = -g
PACKS = biniou,yojson,unix
.PHONY: default all opt install
default: META all opt
all: jsondiff.byte
opt: jsondiff
ifndef PREFIX
PREFIX = $(shell dirname $$(dirname $$(which ocamlfind)))
export PREFIX
endif
ifndef BINDIR
BINDIR = $(PREFIX)/bin
export BINDIR
endif
META: META.in Makefile
sed -e 's:@@VERSION@@:$(VERSION):' META.in > META
install: META
test ! -f jsondiff || cp jsondiff $(BINDIR)/
test ! -f jsondiff.exe || cp jsondiff.exe $(BINDIR)/
ocamlfind install jsondiff META \
$$(ls jsondiff.cmi jsondiff.cmo jsondiff.cmx jsondiff.o)
uninstall:
test ! -f $(BINDIR)/jsondiff || rm $(BINDIR)/jsondiff
test ! -f $(BINDIR)/jsondiff.exe || rm $(BINDIR)/jsondiff.exe
ocamlfind remove jsondiff
jsondiff.cmo: jsondiff.cmi
jsondiff.cmi: jsondiff.ml
ocamlfind ocamlc -c $(FLAGS) -package $(PACKS) jsondiff.ml
jsondiff.cmx: jsondiff.cmi jsondiff.ml
ocamlfind ocamlopt -c $(FLAGS) -package $(PACKS) jsondiff.ml
jsondiff.byte: jsondiff.cmo
ocamlfind ocamlc -o jsondiff.byte -package $(PACKS) -linkpkg \
jsondiff.cmo
jsondiff: jsondiff.cmx
ocamlfind ocamlopt -o jsondiff -package $(PACKS) -linkpkg \
jsondiff.cmx
.PHONY: clean
clean:
rm -f *.o *.a *.cm* *~ *.annot jsondiff jsondiff.exe \
META jsondiff.byte