-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOMakefile
162 lines (128 loc) · 3.14 KB
/
OMakefile
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
SRCDIR=$(dir .)
.PHONY: all install clean doc test-exec
all: nibkamec nibkametoplevel
.DEFAULT: all
.SUBDIRS: doc
########################################################################
# C configuration.
#
CFLAGS +=
ASFLAGS +=
LDFLAGS +=
INCLUDES +=
# LIBFILES[] =
# file1
# file2
#
# LIB = libxxx
#
# .DEFAULT: $(StaticCLibrary $(LIB), $(LIBFILES))
########################################################################
# OCaml configuration.
USE_OCAMLFIND = true
#
# OCAMLPACKS[] =
# pack1
# pack2
#
if $(not $(OCAMLFIND_EXISTS))
eprintln(This project requires ocamlfind, but is was not found.)
eprintln(You need to install ocamlfind and run "omake --configure".)
exit 1
#
# Include path
#
# OCAMLINCLUDES +=
NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
BYTE_ENABLED = true
#
# Various options
#
OCAMLFLAGS += -g -annot -warn-error "-a"
OCAMLCFLAGS += -g
OCAMLOPTFLAGS +=
OCAML_LINK_FLAGS +=
OCAML_BYTE_LINK_FLAGS +=
OCAML_NATIVE_LINK_FLAGS +=
################################################
# Generated files
#
# Workaround for the fact that ocamldep does not pay attention to .mll
# and .mly files.
#
# OCamlGeneratedFiles(parser.ml lexer.ml)
################################################
# Build an OCaml library
#
NIBKAMEFILES[] =
myUtilx
myUtil
sexpr
idx
id
debug
mangle
type
typingType
syntax
variant
sread
typingExpr
typing
lLifting
module
pattern
kNormal
closure
virtualAsm
basicblock
asmx86
instantiate
translationUnit
predefined
targetScheme
LIB = nibkame
.DEFAULT: $(OCamlLibrary $(LIB), $(NIBKAMEFILES))
nibkametoplevel: $(addsuffix .ml, $(NIBKAMEFILES)) $(addsuffix .cmi, $(NIBKAMEFILES))
ocamlmktop -o $@ $(addsuffix .ml, $(NIBKAMEFILES))
################################################
# Build an OCaml program
#
NIBKAMECFILES[] =
main
NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
BYTE_ENABLED = true
PROGRAM = nibkamec
NIBKAMEC = $(file nibkamec)
OCAML_LIBS +=nibkame
OCAML_CLIBS +=
OCAML_OTHER_LIBS +=
OCAML_LIB_FLAGS +=
nibkamec: nibkamec.run
OcamlSourceFiles(name) =
MLFILE = $(addsuffix .ml, $(name))
MLIFILE = $(addsuffix .mli, $(name))
MLLFILE = $(addsuffix .mll, $(name))
MLYFILE = $(addsuffix .mly, $(name))
FILES = $(MLFILE) $(MLIFILE) $(MLLFILE) $(MLYFILE)
return $(set-diff $(filter-exists $(FILES)), $(filter-proper-targets $(FILES)))
OcamlCompiledFiles(name) =
CMIFILE = $(addsuffix .cmi, $(name))
FILES = $(CMIFILE)
return $(filter-proper-targets $(FILES))
OcamldocLaTeX(name,files) =
SOURCES=$(OcamlSourceFiles $(files))
CMIFILES=$(OcamlCompiledFiles $(files))
doc/ocamldoc-$(name).tex: $(SOURCES) $(CMIFILES)
ocamldoc -d doc -latex -noheader -notrailer -notoc -o $@ $(SOURCES)
return doc/ocamldoc-$(name).tex
OCamlProgram($(PROGRAM), $(NIBKAMECFILES))
OcamldocLaTeX(nibkamec, $(NIBKAMEFILES) $(NIBKAMECFILES))
.PHONY: distclean
distclean:
rm $(filter-proper-targets $(ls R, .))
loads.tl: OMakefile
echo > $@
foreach(nm, $(addsuffix .cmo, $(NIBKAMEFILES)))
echo "$(nm)" | sed -e 's/.*/#load "&";;/' >> $@
.SUBDIRS: test-nkl