forked from BinaryAnalysisPlatform/bap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbapbuild
More file actions
executable file
·37 lines (32 loc) · 837 Bytes
/
bapbuild
File metadata and controls
executable file
·37 lines (32 loc) · 837 Bytes
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
#!/bin/sh
for target; do :; done
args=`echo "$@" | sed 's/\.plugin$/.cmxa/'`
ocamlbuild \
-use-ocamlfind \
-classic-display \
-syntax camlp4o \
-pkg bap \
-pkg bap.plugins \
-pkg core_kernel \
-pkg sexplib.syntax,comparelib.syntax,fieldslib.syntax,variantslib.syntax \
-pkg bin_prot.syntax \
-tag thread \
-tag debug \
-tag annot \
-tag bin_annot \
-tag short_paths \
-cflags "-w A-4-33-40-41-42-43-34-44" \
-cflags -strict-sequence \
$args
result=$?
name=`basename $target .plugin 2>/dev/null`
source="_build/$name.cmxa"
if [ -f "$source" ]; then
CMD=`grep -A1 "Target: $name.cmxa" _build/_log | grep -v "Target" | sed 's/.cmxa/.cmxs/' | sed 's/-a/-shared/'`
cd _build
$CMD
cp "$name.cmxs" "../$target"
cd ..
chmod a-x $target
fi
exit $result