-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (35 loc) · 948 Bytes
/
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
OCAMLC=ocamlc
OCAMLOPT=ocamlopt
OCAMLDEP=ocamldep
INCLUDES= # all relevant -I options here
OCAMLFLAGS=$(INCLUDES) # add other options for ocamlc here
OCAMLOPTFLAGS=$(INCLUDES) # add other options for ocamlopt here
# The list of object files for asmfx
ASMFX_CMO=lib.cmo isa.cmo machine.cmo
ASMFX_CMX=$(ASMFX_CMO:.cmo=.cmx)
ASMFX_ML=$(ASMFX_CMO:.cmo=.ml)
ASMFX_MLI=$(ASMFX_CMO:.cmo=.mli)
ML=$(ASMFX_ML)
MLI=$(ASMFX_MLI)
asmfx: $(ASMFX_CMO)
$(OCAMLC) -o asmfx $(OCAMLFLAGS) $(ASMFX_CMO)
asmfx.opt: $(ASMFX_CMX)
$(OCAMLOPT) -o asmfx $(OCAMLFLAGS) $(ASMFX_CMX)
# Common rules
%.cmo: %.ml
$(OCAMLC) $(OCAMLFLAGS) -c $<
%.cmi: %.mli
$(OCAMLC) $(OCAMLFLAGS) -c $<
%.cmx: %.ml
$(OCAMLOPT) $(OCAMLOPTFLAGS) -c $<
all: asmfx
opt: asmfx.opt
# Clean up
clean:
rm -f asmfx asmfx.opt
rm -f *.cm[iox]
# Dependencies
.depend: $(ML) $(MLI)
$(OCAMLDEP) $(INCLUDES) *.mli *.ml > .depend
.PHONY: all opt clean
include .depend