Makefile 979 Bytes
Newer Older
Bruno Guillaume's avatar
Bruno Guillaume committed
1 2 3 4
PREFIX?=/usr/local
BINDIR=$(PREFIX)/bin
DATADIR=$(PREFIX)/share/libgrew/

bguillaum's avatar
bguillaum committed
5
OCB_FLAGS = -use-ocamlfind -use-menhir -I src
bguillaum's avatar
bguillaum committed
6
OCB = ocamlbuild $(OCB_FLAGS)
bguillaum's avatar
bguillaum committed
7

Bruno Guillaume's avatar
Bruno Guillaume committed
8
LIB_FILES = libgrew.cma libgrew.cmxa libgrew.a libgrew.cmi libgrew_types.cmi libgrew.cmx libgrew.cmxs
bguillaum's avatar
bguillaum committed
9 10 11 12
INSTALL_FILES = $(LIB_FILES:%=_build/src/%)

VERSION = `cat VERSION`

Bruno Guillaume's avatar
Bruno Guillaume committed
13
build: datadir
bguillaum's avatar
bguillaum committed
14 15
	$(OCB) $(LIB_FILES)

Bruno Guillaume's avatar
Bruno Guillaume committed
16 17 18
datadir:
	echo $(DATADIR) > DATADIR

bguillaum's avatar
bguillaum committed
19 20 21 22
install: build uninstall
	cp META_STD META
	ocamlfind install -patch-version $(VERSION) libgrew META $(INSTALL_FILES)
	rm -f META
Bruno Guillaume's avatar
Bruno Guillaume committed
23 24
	mkdir -p $(DATADIR)
	cp -rf grs/* $(DATADIR)
bguillaum's avatar
bguillaum committed
25 26 27 28 29

install_dev: build uninstall_dev
	cp META_DEV META
	ocamlfind install -patch-version $(VERSION) libgrew_dev META $(INSTALL_FILES)
	rm -f META
Bruno Guillaume's avatar
Bruno Guillaume committed
30 31
	mkdir -p $(DATADIR)
	cp -rf grs/* $(DATADIR)
bguillaum's avatar
bguillaum committed
32 33 34

uninstall:
	ocamlfind remove libgrew
Bruno Guillaume's avatar
Bruno Guillaume committed
35
	rm -rf $(DATADIR)
bguillaum's avatar
bguillaum committed
36 37 38

uninstall_dev:
	ocamlfind remove libgrew_dev
Bruno Guillaume's avatar
Bruno Guillaume committed
39
	rm -rf $(DATADIR)
bguillaum's avatar
bguillaum committed
40 41 42 43 44 45 46 47

doc:
	$(OCB) libgrew.docdir/index.html

.PHONY:	all clean build sanity

clean:
	$(OCB) -clean