summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAndrew Lamoureux <lwerdna@users.noreply.github.com>2017-03-15 20:33:55 -0400
committerGitHub <noreply@github.com>2017-03-15 20:33:55 -0400
commit31d34d5d067ed4c5fe071eb8637b10ed50607555 (patch)
tree9347ba4e5e6a2b26baf620f59e56db7965bb47b5 /Makefile
parent164c7a680697be72d7f42af28b89012e5c6dd53b (diff)
parent1f7523ce2b1edac1014d781fc771d5b82568e2f1 (diff)
Merge branch 'dev' into dev
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..9eb2d52a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,42 @@
+UNAME_S := $(shell uname -s)
+ifeq ($(UNAME_S),Darwin)
+ LIB := -L/Applications/Binary\ Ninja.app/Contents/MacOS/ -lbinaryninjacore
+else
+ LIB := -L$(HOME)/binaryninja/ -lbinaryninjacore
+endif
+
+
+TARGETDIR := bin
+TARGETNAME := libbinaryninjaapi
+TARGET := $(TARGETDIR)/$(TARGETNAME)
+
+SRCEXT = .cpp
+SOURCES = $(wildcard *$(SRCEXT))
+OBJECTS = $(SOURCES:.cpp=.o)
+
+
+CFLAGS := -c -fPIC -O2 -pipe -std=gnu++11 -Wall -W
+ifeq ($(UNAME_S),Darwin)
+ CC := $(shell xcrun -f g++)
+ AR := $(shell xcrun -f ar)
+ CFLAGS += -stdlib=libc++
+else
+ CC := g++
+ AR := ar
+endif
+
+all: $(TARGET).a
+
+$(TARGET).a: $(OBJECTS)
+ @mkdir -p $(TARGETDIR)
+ $(AR) rcs $@ $^
+
+%.o: %.cpp
+ @echo " Compiling... $@ $<"
+ $(CC) $(CFLAGS) $(INC) -c -o $@ $<
+
+clean:
+ @echo " Cleaning...";
+ $(RM) -r *.o $(TARGETDIR)
+
+.PHONY: clean