-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (48 loc) · 1.46 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
62
63
64
65
66
67
68
69
70
#######################
# OCAML Programs #
#######################
OCAMLC = ocamlc
OCAMLOPT = ocamlopt
OCAMLDEP = ocamldep
#######################
# OCAML Flags #
#######################
INCLUDES = #all relevant -I options here
OCAMLFLAGS = $(INCLUDES) #add other options for ocamlc here
OCAMLOPTFLAGS = $(INCLUDES) #add other options for ocamlopt here
#######################
# Sources files #
#######################
MLFILES = common.ml config.ml collection.ml bio_objects.ml conversionES.ml input.ml compute_exproj.ml output.ml main.ml
CMXAFILES = $(CMAFILES:%.cma=%.cmxa)
CMOFILES = $(MLFILES:%.ml=%.cmo)
CMXFILES = $(MLFILES:%.ml=%.cmx)
CMIFILES = $(MLFILES:%.ml=%.cmi) $(MLIFILES:%.mli=%.cmi)
OBJFILES = $(CMIFILES:%.cmi=%.o)
BINFILE = makeSP
#######################
# Rules #
#######################
makeSP: $(CMXFILES)
@echo "LNKOPT $(BINFILE)"
@$(OCAMLOPT) $(CMXAFILES) $(CMXFILES) $(OCAMLOPTFLAGS) -o $(BINFILE)
# Common rules
.SUFFIXES: .ml .cmo .cmi .cmx
.ml.cmo:
@echo "OCAMLC $<"
@$(OCAMLC) $(OCAMLFLAGS) -c $<
.mli.cmi:
@echo "OCAMLC $<"
@$(OCAMLC) $(OCAMLFLAGS) -c $<
.ml.cmx:
@echo "OCAMLOPT $<"
@$(OCAMLOPT) $(OCAMLOPTFLAGS) -c $<
# Clean up
clean:
@echo "Cleaning .cmo .cmx .o .cmi and binary"
@rm -f $(BINFILE) $(CMOFILES) $(CMXFILES) $(CMIFILES) $(OBJFILES)
# Dependencies
depend:
@echo "Calculating dependencies"
@$(OCAMLDEP) $(INCLUDES) $(MLFILES) $(MLIFILES) > $(DEPENDFILE)
# include $(DEPENDFILE)