-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (43 loc) · 1.13 KB
/
Makefile
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
#
# Makefile
#
# Group Name: Mainframe
#
TARGETS = snick
TARGETS_BYTE=$(TARGETS:%=%.byte)
MODULES = snick_ast snick_lex snick_parse snick_pprint snick_br_ast snick_symbol snick_err snick_optimizer snick_analyze snick_codegen
MLFILES = $(addsuffix .ml, $(MODULES))
CMOFILES = $(addsuffix .cmo, $(MODULES))
CMXFILES = $(addsuffix .cmx, $(MODULES))
ALLMODULES = $(MODULES) snick
OCAMLLEX = ocamllex
OCAMLYACC = ocamlyacc
OCAMLDEP = ocamldep
OCAMLFLAGS =
all : opt byte
byte: $(TARGETS_BYTE)
opt: $(TARGETS)
%.cmi: %.mli
ocamlc $(OCAMLFLAGS) -c $<
%.cmo: %.ml
ocamlc $(OCAMLFLAGS) -g -c $<
%.cmx: %.ml
ocamlopt $(OCAMLOPTFLAGS) -g -c $<
%.ml: %.mll
$(OCAMLLEX) $^
%.ml %.mli: %.mly
$(OCAMLYACC) $^
snick.byte : $(CMOFILES) snick.cmo
ocamlc -g -o $@ $^
snick : $(CMXFILES) snick.cmx
ocamlopt -g -o $@ $^
clean :
rm -f *.cmo *.cmi *.cmx *.o
rm -f snick_lex.ml snick_parse.ml snick_parse.mli
clobber : clean
rm -f $(TARGETS) $(TARGETS_BYTE)
.PHONY : clean clobber depend
# include depend
depend: snick_lex.ml snick_parse.ml
$(OCAMLDEP) snick.ml snick.mli $(ALLMODULES:%=%.mli) $(ALLMODULES:%=%.ml) >Makefile.depend
-include Makefile.depend