diff options
| author | Rusty Wagner <rusty@vector35.com> | 2020-07-10 23:36:26 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2020-07-17 18:31:55 -0400 |
| commit | 308caf1f5b3f8f02ebb44c0c43a838e0709200a1 (patch) | |
| tree | 2b04f6b809eedf88285eab69c662035ec6ce200d /examples/print_syscalls | |
| parent | b3d490e9e7f21a90922973a617a89a8620f5778b (diff) | |
Switch build system to cmake
Diffstat (limited to 'examples/print_syscalls')
| -rw-r--r-- | examples/print_syscalls/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/print_syscalls/Makefile | 54 |
2 files changed, 1 insertions, 55 deletions
diff --git a/examples/print_syscalls/CMakeLists.txt b/examples/print_syscalls/CMakeLists.txt index d8495b3c..166017fe 100644 --- a/examples/print_syscalls/CMakeLists.txt +++ b/examples/print_syscalls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.9 FATAL_ERROR) project(print_syscalls CXX) diff --git a/examples/print_syscalls/Makefile b/examples/print_syscalls/Makefile deleted file mode 100644 index 54fd1237..00000000 --- a/examples/print_syscalls/Makefile +++ /dev/null @@ -1,54 +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 := g++ -else - BINJAPATH := /Applications/Binary\ Ninja.app/Contents/MacOS - CC := $(shell xcrun -f clang++) -endif - -SRCDIR := src -BUILDDIR := build -TARGETDIR := bin - -TARGETNAME := print_syscalls -TARGET := $(TARGETDIR)/$(TARGETNAME) - -SRCEXT := cpp -SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT)) -OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o)) - -LIBS := -L $(BINJAPATH) -lbinaryninjacore -CFLAGS := -c -std=gnu++11 -O2 -Wall -W -fPIC -pipe -ggdb -ifeq ($(UNAME_S),Darwin) - CFLAGS += -arch x86_64 -pipe -stdlib=libc++ -endif - -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) $(CFLAGS) $(INC) -c -o $@ $< - -clean: - $(RM) -r $(BUILDDIR) $(TARGETDIR) - -.PHONY: clean |
