summaryrefslogtreecommitdiff
path: root/examples/cmdline_disasm
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2020-07-10 23:36:26 -0400
committerRusty Wagner <rusty@vector35.com>2020-07-17 18:31:55 -0400
commit308caf1f5b3f8f02ebb44c0c43a838e0709200a1 (patch)
tree2b04f6b809eedf88285eab69c662035ec6ce200d /examples/cmdline_disasm
parentb3d490e9e7f21a90922973a617a89a8620f5778b (diff)
Switch build system to cmake
Diffstat (limited to 'examples/cmdline_disasm')
-rw-r--r--examples/cmdline_disasm/CMakeLists.txt2
-rw-r--r--examples/cmdline_disasm/Makefile51
2 files changed, 1 insertions, 52 deletions
diff --git a/examples/cmdline_disasm/CMakeLists.txt b/examples/cmdline_disasm/CMakeLists.txt
index 98e5f535..c76d49fc 100644
--- a/examples/cmdline_disasm/CMakeLists.txt
+++ b/examples/cmdline_disasm/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(cmdline_disasm CXX)
diff --git a/examples/cmdline_disasm/Makefile b/examples/cmdline_disasm/Makefile
deleted file mode 100644
index 12931876..00000000
--- a/examples/cmdline_disasm/Makefile
+++ /dev/null
@@ -1,51 +0,0 @@
-# Path to prebuilt libbinaryninjaapi.a
-BINJA_API_A := ../../bin/libbinaryninjaapi.a
-
-# Path to binaryninjaapi.h and json
-INC := -I../../
-
-UNAME_S := $(shell uname -s)
-ifeq ($(UNAME_S),Linux)
- # Path to binaryninja install
- BINJAPATH := $(HOME)/binaryninja/
- CC := gcc
-else
- BINJAPATH := /Applications/Binary\ Ninja.app/Contents/MacOS
- CC := clang
-endif
-
-SRCDIR := src
-BUILDDIR := build
-TARGETDIR := bin
-
-TARGETNAME := disasm
-TARGET := $(TARGETDIR)/$(TARGETNAME)
-
-SRCEXT := cpp
-SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
-OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
-
-LIBS := -L $(BINJAPATH) -lbinaryninjacore
-CPPFLAGS := -c -O2 -Wall -W -fPIC --std=c++11 -pipe
-
-all: $(TARGET)
-
-ifeq ($(UNAME_S),Linux)
-$(TARGET): $(OBJECTS)
- @mkdir -p $(TARGETDIR)
- $(CC) $^ $(BINJA_API_A) $(LIBS) -Wl,-rpath=$(BINJAPATH) -ldl -o $@
-else
-$(TARGET): $(OBJECTS)
- @mkdir -p $(TARGETDIR)
- $(CC) $^ $(BINJA_API_A) $(LIBS) -o $@
- install_name_tool -change @rpath/libbinaryninjacore.dylib $(BINJAPATH)/libbinaryninjacore.dylib $@
-endif
-
-$(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
- @mkdir -p $(BUILDDIR)
- $(CC) $(CPPFLAGS) $(INC) -c -o $@ $<
-
-clean:
- $(RM) -r $(BUILDDIR) $(TARGETDIR)
-
-.PHONY: clean