forked from andrejbauer/marshall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
63 lines (49 loc) · 1.79 KB
/
Makefile.am
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
ACLOCAL_AMFLAGS = -I build-aux
bin_PROGRAMS = marshall
marshall_SOURCES =
marshall_DATA = prelude.asd
EXTRA_DIST = prelude.asd tests examples src etc COPYRIGHT.txt README.md
marshalldir=$(datarootdir)/marshall
# The main program (without the .ml extension)
MARSHALLTARGET=src/marshall
# How to compile
MARSHALLOCAMLBUILD=$(OCAMLBUILD) -use-menhir -lib nums -lib unix
.PHONY: test test-validate test-clean src/version.ml \
marshall.byte marshall.native marshall.d.byte marshall.p.native
marshall: marshall.$(BUILDBEST)
cd $(srcdir) && \
cp marshall.$(BUILDBEST) marshall
marshall.byte: src/version.ml
cd $(srcdir) && \
$(MARSHALLOCAMLBUILD) $(MARSHALLTARGET).byte
marshall.native: src/version.ml
cd $(srcdir) && \
$(MARSHALLOCAMLBUILD) $(MARSHALLTARGET).native
marshall.d.byte: src/version.ml
cd $(srcdir) && $(MARSHALLOCAMLBUILD) $(MARSHALLTARGET).d.byte
marshall.p.native: src/version.ml
cd $(srcdir) && $(MARSHALLOCAMLBUILD) $(MARSHALLTARGET).p.native
src/version.ml:
echo "let version=\"$(PACKAGE_VERSION)\";; let marshalldir=\"$(marshalldir)\";;" > src/version.ml
# Explain parser conflicts in the file parser.conflicts
conflicts:
cd $(srcdir) ; \
$(MARSHALLOCAMLBUILD) -yaccflags "--explain" src/parser.mli ; \
if [ -f $(srcdir)/_build/src/parser.conflicts ]; \
then \
mv -f $(srcdir)/_build/src/parser.conflicts .; \
fi
# "make test" to see if anything broke
test: marshall.$(BUILDBEST)
cd $(srcdir)/tests && sh ./test.sh
# "make test-validate" to see if anything broke and ask for validation of possibly
# broken things.
test-validate:
cd $(srcdir)/tests && sh ./test.sh -v
# Clean up tests
test-clean:
cd $(srcdir) && rm -f tests/*.out tests/*/*.out
clean: test-clean
cd $(srcdir) && \
rm -f marshall marshall-$(PACKAGE_VERSION) src/version.ml && \
ocamlbuild -clean && rm -f parser.conflicts