My favorites | Sign in
Project Logo
                
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
TEST_SOURCES=${wildcard test/*Test.ml}
TEST_BYTE =${TEST_SOURCES:.ml=.byte}
TEST_SHELL =${wildcard test/*.sh}

EX_ML_SOURCES=${wildcard ex/*.ml}
EX_BYTE =${EX_ML_SOURCES:.ml=.byte}
EX_BEAM =$(patsubst ex/%.erl,beam/%.beam,$(wildcard ex/*.erl))

OCAMLBUILD=ocamlbuild -classic-display

NAME=ocamerl
ARCHIVE=$(NAME).cma
XARCHIVE=$(NAME).cmxa

LIB_TARGETS=\
$(ARCHIVE) \
$(XARCHIVE) \
ocamerl/ocamerl.docdir/index.html

TARGETS=\
$(LIB_TARGETS) \
$(EX_BYTE)

TEST_TARGETS=\
$(LIB_TARGETS) \
$(EX_BYTE) \
$(TEST_BYTE)


.PHONY: main
main: main_build test

.PHONY: main_build
main_build: ex_build
$(OCAMLBUILD) $(TARGETS)


.PHONY: dev
dev: dev_build utest test

.PHONY: dev_build
dev_build: ERLBUILDOPT = +debug_info -DEUNIT -Wall
dev_build: generated ex_build
$(OCAMLBUILD) $(TEST_TARGETS)


.PHONY: ex_build
ex_build: ERLBUILDOPT = +debug_info -DEUNIT -Wall
ex_build: $(EX_BEAM)


.PHONY: install
install: uninstall main_build
test ! -f _build/$(XARCHIVE) || extra="_build/$(XARCHIVE) _build/"`basename $(XARCHIVE) .cmxa`".a" ; \
ocamlfind install $(NAME) META _build/$(NAME)/*.mli _build/$(NAME)/*.cmi _build/$(NAME).cmi _build/$(ARCHIVE) $$extra

.PHONY: uninstall
uninstall:
ocamlfind remove $(NAME)


.PHONY: clean
clean:
$(OCAMLBUILD) -clean
@rm -vf test/dataSet.ml
@rm -vf beam/*.beam


.PHONY: test
# no rule dependency ... rule used as a function
test:
# start erlang first (ensure epmd is running)
@echo "Run and stop a distributed erlang node to ensure epmd is running."
erl -sname e1 -setcookie cookie -noshell -s init stop
@for i in ${TEST_SHELL} ; do \
echo -n "Running '$$i': " ; \
$$i > /dev/null 2>&1 ; \
r=$$? && echo "$$r" ; \
done

.PHONY: utest
# no rule dependency ... rule used as a function
utest:
@for i in ${TEST_BYTE} ; do ./`basename $$i` ; done


.PHONY: generated
generated: test/dataSet.ml

test/dataSet.ml: beam/datagen.beam
erl -noshell -pa beam -s datagen doit -s init stop > test/dataSet.ml

beam/%.beam : test/%.erl
mkdir -p beam
erlc ${ERLBUILDOPT} -o beam $<

beam/%.beam : ex/%.erl
mkdir -p beam
erlc ${ERLBUILDOPT} -o beam $<


Show details Hide details

Change log

r50 by lcoquelle on May 20, 2008   Diff
trunk/lib/ocamerl: changed test build in
Makefile (ensure EPMD running in main run,
not each test: run test is little bit
faster).
Go to: 
Project members, sign in to write a code review

Older revisions

r47 by lcoquelle on May 13, 2008   Diff
trunk/lib/ocamerl: minor tweaks,
mainly in Trace module (removing debug
message display by default).
r45 by lcoquelle on May 08, 2008   Diff
trunk/lib/ocamerl: added native code
compilation; fix install by adding
forgotten META file for findlib.
r44 by lcoquelle on May 08, 2008   Diff
trunk/lib/ocamerl: added simple
install rule (using findlib) ...
Makefile is not clean!
All revisions of this file

File info

Size: 2123 bytes, 101 lines
Hosted by Google Code