summaryrefslogtreecommitdiff
path: root/Makefile
blob: 44750534d74967519a07d515d523a5cb328a677a (plain)
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
CMO=typing.cmo utils.cmo lexer.cmo parser.cmo \
    mips.cmo mipshelpers.cmo primitives.cmo \
    closure.cmo optimize.cmo compile.cmo \
    main.cmo
CMI=ast.cmi
CMO_DEP=typing.cmo utils.cmo
GENERATED = lexer.ml parser.ml parser.mli
BIN=petit-caml
FLAGS=

all: $(BIN)

test: $(BIN)
	@python runtests.py

$(BIN):$(CMI) $(CMO)
	ocamlc $(FLAGS) -o $(BIN) $(CMO)

.SUFFIXES: .mli .ml .cmi .cmo .mll .mly  

.mli.cmi:
	ocamlc $(FLAGS) -c  $<

.ml.cmo:
	ocamlc $(FLAGS) -c  $<

.mll.ml:
	ocamllex $<

.mly.ml:
	menhir --infer -v $<

.mly.mli:
	ocamlyacc -v $<

release:
	rm -rf seguin
	mkdir -p seguin
	git archive HEAD | tar -xC seguin
	make --directory=seguin
	make --directory=seguin clean
	tar -czf seguin.tgz seguin

clean:
	rm -f *.cm[io] *.o *~ $(BIN) $(GENERATED) parser.output parser.automaton

.depend depend:$(CMI) $(CMO_DEP) $(GENERATED)
	rm -f .depend
	ocamldep *.ml *.mli > .depend

include .depend