Makefile_dev 1009 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
PREFIX?=/Users/guillaum/.local
BINDIR=$(PREFIX)/bin
DATA_DIR=$(PREFIX)/share/grew/

OCB_FLAGS = -use-ocamlfind -I src
OCB = ocamlbuild $(OCB_FLAGS)

VERSION = `cat VERSION`

all: native

native: src/grew_glade.ml datadir
	$(OCB) -tag-line "true:	package(libgrew_dev)" grew_gui.native

datadir:
	echo $(DATA_DIR) > DATA_DIR

install: native
	cp grew_gui.native $(BINDIR)/grew_gui_dev
	mkdir -p $(DATA_DIR)
21
	cp src/grew.glade $(DATA_DIR)
22 23 24 25 26 27 28 29 30 31

uninstall:
	rm -f $(BINDIR)/grew
	rm -f $(DATA_DIR)/grew.glade

.PHONY:	all clean byte native install uninstall

clean:
	$(OCB) -clean
	rm -f DATA_DIR
32
	rm -f src/grew_glade.ml
33 34

info:
35 36
	@echo "BINDIR   = $(BINDIR)"
	@echo "DATA_DIR = $(DATA_DIR)"
37 38

# glade file are not handle by ocamlbuild
39 40
src/grew_glade.ml : src/grew_glade_init.ml
	sed 's|src/grew.glade|$(DATA_DIR)grew.glade|g' src/grew_glade_init.ml > src/grew_glade.ml
41

42 43 44 45 46 47
# Special target to use before release
glade_build:
	lablgladecc2 src/grew.glade > src/grew_glade_init.ml

glade_clean:
	rm -f src/grew_glade_init.ml