Skip to content

Commit

Permalink
bindings/ocaml: use Dune and Opam
Browse files Browse the repository at this point in the history
  • Loading branch information
XVilka committed Apr 9, 2024
1 parent a94ae9e commit e153952
Show file tree
Hide file tree
Showing 44 changed files with 133 additions and 410 deletions.
18 changes: 1 addition & 17 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,7 @@ bindings/python/capstone.egg-info/
bindings/java/capstone.jar

# ocaml
bindings/ocaml/*.cmi
bindings/ocaml/*.cmx
bindings/ocaml/*.cmxa
bindings/ocaml/*.mli
bindings/ocaml/test
bindings/ocaml/test_arm
bindings/ocaml/test_aarch64
bindings/ocaml/test_basic
bindings/ocaml/test_mips
bindings/ocaml/test_x86
bindings/ocaml/test_detail
bindings/ocaml/test_ppc
bindings/ocaml/test_sparc
bindings/ocaml/test_systemz
bindings/ocaml/test_xcore
bindings/ocaml/test_m680x

bindings/ocaml/_build

# test binaries
tests/test_basic
Expand Down
299 changes: 0 additions & 299 deletions bindings/ocaml/Makefile

This file was deleted.

12 changes: 6 additions & 6 deletions bindings/ocaml/README
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
To compile Ocaml binding, Ocaml toolchain is needed. On Ubuntu Linux,
To compile OCaml bindings, OCaml toolchain is needed. On Ubuntu Linux,
you can install Ocaml with:

$ sudo apt-get install ocaml-nox
$ sudo apt-get install ocaml opam

To compile Ocaml binding, simply run "make" on the command line.
To compile OCaml bindings, simply run "opam install ." on the command line.


This directory also contains some test code to show how to use Capstone API.

- test_basic.ml
- test/test_basic.ml
This code shows the most simple form of API where we only want to get basic
information out of disassembled instruction, such as address, mnemonic and
operand string.

- test_detail.ml:
- test/test_detail.ml:
This code shows how to access to architecture-neutral information in disassembled
instructions, such as implicit registers read/written, or groups of instructions
that this instruction belong to.

- test_<arch>.ml
- test/test_<arch>.ml
These code show how to access architecture-specific information for each
architecture.
24 changes: 24 additions & 0 deletions bindings/ocaml/capstone.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
opam-version: "2.0"
maintainer: "Capstone developers"
authors: ["Capstone developers"]
homepage: "https://github.com/capstone-engine/capstone"
bug-reports: "https://github.com/capstone-engine/capstone/issues"
dev-repo: "git+https://github.com/capstone-engine/capstone.git"
license: "MIT"
build: [
["dune" "build" "-p" name "-j" jobs]
]
depends: [
"ocaml" {>= "4.14.0"}
"dune" {>= "2.0.0"}
"dune-configurator"
]
depexts: [
["capstone"] {os-family = "bsd"}
["capstone-dev"] {os-family = "debian"}
["capstone"] {os-distribution = "homebrew"}
["capstone-dev"] {os-distribution = "alpine"}
["capstone-devel"] {os-family = "suse" | os-family = "opensuse"}
["capstone-devel"] {os-distribution = "centos" | os-distribution = "fedora"}
]
synopsis: "OCaml bindings for Capstone, a disassembly framework"
2 changes: 2 additions & 0 deletions bindings/ocaml/dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(lang dune 3.10)
(name capstone)
2 changes: 0 additions & 2 deletions bindings/ocaml/aarch64.ml → bindings/ocaml/src/aarch64.ml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
(* Capstone Disassembly Engine
* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 *)

open Aarch64_const

(* architecture specific info of instruction *)
type aarch64_op_shift = {
shift_type: int;
Expand Down
File renamed without changes.
Loading

0 comments on commit e153952

Please sign in to comment.