-
Notifications
You must be signed in to change notification settings - Fork 60
/
OMakefile
221 lines (181 loc) · 4.85 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
########################################################################
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this file, to deal in the File without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the File, and to permit persons to whom the
# File is furnished to do so, subject to the following condition:
#
# THE FILE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE FILE OR
# THE USE OR OTHER DEALINGS IN THE FILE.
########################################################################
# The standard OMakefile.
# You will usually need to modify this file for your project.
########################################################################
# Phony targets are scoped, so you probably want to declare them first.
#
# .PHONY: all install clean
.PHONY: clean install uninstall
# choose event library
if $(not $(defined EV))
EV = FALSE
export
if $(equal $(EV), TRUE)
echo "*** linking with libev ***"
LDFLAGS += -lev
CXXFLAGS += -DEV_MULTIPLICITY=0
export
else
echo "*** linking with libevent ***"
LDFLAGS += -levent
export
# add debugging information
if $(not $(defined DEBUG))
DEBUG = FALSE
export
if $(equal $(DEBUG), TRUE)
CXXFLAGS += -O0 -g
export
else
CXXFLAGS += -O3
export
clean:
rm -f *~
mkdir(include -p)
if $(equal $(test -L include/libcage), true)
else
rm(include/libcage -f)
symlink(src, include/libcage)
if $(not $(defined PREFIX))
PREFIX = /usr/local
export
install:
mkdir($(PREFIX)/include/libcage -p)
mkdir($(PREFIX)/lib -p)
if $(equal $(SYSNAME), Darwin)
cp src/*.a src/*.dylib $(PREFIX)/lib
else
cp src/*.a src/*.so $(PREFIX)/lib
cp -f src/*.hpp $(PREFIX)/include/libcage
uninstall:
rm -rf $(PREFIX)/include/libcage
rm -f $(PREFIX)/lib/libcage.a
rm -f $(PREFIX)/lib/libcage.so
rm -f $(PREFIX)/lib/libcage.dylib
########################################################################
# Subdirectories.
# You may want to include some subdirectories in this project.
# If so, define the subdirectory targets and uncomment this section.
#
.SUBDIRS: src example test
########################################################################
# C configuration.
# Delete this section if you are not building C files.
#
################################################
# Configuration. You might want to modify any of these
# configuration variables.
#
# CFLAGS +=
# ASFLAGS +=
# LDFLAGS +=
# INCLUDES +=
################################################
# Uncomment the following section if you want
# to build a C program in the current directory.
#
# CFILES[] =
# file1
# main
#
# MAIN = main
#
# .DEFAULT: $(CProgram $(MAIN), $(CFILES))
################################################
# Uncomment the following section if you want to build a C library
# in the current directory.
#
# LIBFILES[] =
# file1
# file2
#
# LIB = libxxx
#
# .DEFAULT: $(StaticCLibrary $(LIB), $(LIBFILES))
########################################################################
# OCaml configuration.
# Delete this section if you are not building OCaml files.
#
################################################
# Configuration. You may want to modify any of these configuration
# variables.
#
#
# This project requires ocamlfind (default - false).
#
# 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 +=
#
# Compile native or byte code?
#
# The default values are defined as follows:
#
# NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
# BYTE_ENABLED = $(not $(OCAMLOPT_EXISTS))
#
# Various options
#
# OCAMLFLAGS +=
# OCAMLCFLAGS +=
# 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
#
# FILES[] =
# file1
# file2
#
# LIB = main
#
# .DEFAULT: $(OCamlLibrary $(LIB), $(FILES))
################################################
# Build an OCaml program
#
# FILES[] =
# file1
# file2
#
# PROGRAM =
# OCAML_LIBS +=
# OCAML_CLIBS +=
# OCAML_OTHER_LIBS +=
# OCAML_LIB_FLAGS +=
#
# .DEFAULT: $(OCamlProgram $(PROGRAM), $(FILES))