summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2017-03-24 11:20:39 -0400
committerPeter LaFosse <peter@vector35.com>2017-03-24 11:20:39 -0400
commit435e937c9705bc71cf1e7da1e08b23345a131360 (patch)
tree5a4d729acb0404c4c4059f0c7e8aa7c22136b649 /Makefile
parent1e8e975ed8100c7a6186e8b27833a067ceaf05be (diff)
parentddaf7506e1802cfd4f9c78bcfb14deb0180b04d8 (diff)
Merge branch 'dev' into staging
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..0b18c061
--- /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