forked from BinaryAnalysisPlatform/bap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OMakefile
99 lines (75 loc) · 2.92 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
# Include OASIS library:
if $(not $(file-exists _oasis_lib.om))
err. =
extends $(Exception)
message = $'Not set up. Run first: oasis setup'
raise $(err)
if $(not $(file-exists setup.data))
err. =
extends $(Exception)
message = $'Not configured. Run first: ocaml setup.ml -configure'
raise $(err)
include _oasis_lib.om
# Include the configuration, i.e. the output of "ocaml setup.ml -configure".
# The settings are written to a file setup.data. We need it in a different
# format, and convert the setup here. Note that the variables from setup.data
# are prefixed with "oasis_", e.g. "prefix" is made available as
# $(oasis_prefix). At this point we also initialize a number of build-related
# variables like BYTE_ENANBLED or OCAMLFLAGS.
.INCLUDE: _oasis_setup.om: setup.data
OASIS_generate_setup()
# At this point you may fine-tune the configuration, and modify defaults:
#
# OCAML_LIB_MODULE_SUFFIXES += .ml (install also .ml files with libs)
# OCAMLFINDFLAGS += -thread
OCAMLFLAGS += -bin-annot # (create .cmt/.cmti files)
OCAMLFLAGS_ANNOT = -annot -bin-annot
OCAMLFLAGS += $(OCAMLFLAGS_ANNOT)
OCAMLFLAGS += -opaque
OCAMLFLAGS += -w -6-16-58
OCAMLOPTFLAGS += -O3
# Until this point we allow to override variables via the command-line.
# That means all initializations from above can be changed by omake arguments
# here. E.g. invoke with "omake BYTE_ENABLED=false" to disable bytecode
# builds.
DefineCommandVars()
# Global phonies: This declaration is visible in the whole build tree.
.PHONY: build doc install uninstall reinstall clean distclean
.DEFAULT: build
# Define hierarchy (sets OASIS_SUBDIRS to the sub directories that are part
# of the build):
include _oasis_hier.om
# Include these subdirectories into the build. Normally, you only name
# direct subdirectories here. Also note that all definitions up to this
# point are automatically passed down to the OMakefiles in the subdirectories.
.SUBDIRS: $(OASIS_SUBDIRS)
# Local phonies: This declaration is only visible in this directory.
.PHONY: build-here doc-here install-here uninstall-here reinstall-here pre-install-here clean-here distclean-here
include _oasis_build.om
include _oasis_install.om
# These calls define the rules needed for "build", "install", etc.
DefineBuildRules()
DefineInstallRules()
build-here: $(BUILD_TARGETS)
doc-here: $(BUILD_DOC_TARGETS)
install-here: $(INSTALL_TARGETS)
uninstall-here: $(UNINSTALL_TARGETS)
reinstall-here: $(REINSTALL_TARGETS)
pre-install-here:
clean-here:
rm -f $(OASIS_clean_list)
rm -rf $(OASIS_rec_clean_list)
section
OASIS_rmdir($(OASIS_dir_clean_list))
distclean-here:
rm -f $(OASIS_distclean_list)
rm -rf $(OASIS_rec_distclean_list)
section
OASIS_rmdir($(OASIS_dir_distclean_list))
build: build-here
doc: doc-here
install: install-here
uninstall: uninstall-here
reinstall: reinstall-here
clean: clean-here
distclean: distclean-here