Makefile 989 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
PREFIX?=/usr/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)" grew_gui.native

datadir:
	echo $(DATA_DIR) > DATA_DIR

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

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
	rm -f src/grew_glade.ml

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

# glade file are not handle by ocamlbuild
39 40 41 42 43 44 45 46 47
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

# 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