summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2017-06-23 18:36:37 -0400
committerRusty Wagner <rusty@vector35.com>2017-06-23 18:36:37 -0400
commitc51f3bed6bdef577253feee0e85a71fda1931bd7 (patch)
tree1cf26ff28e0b9bfb6bfbed044ba7ca520d63f862 /Makefile
parent4b988c0d24c8d8c8dc67485f3aaeb7106eb4af18 (diff)
parentcca0fe6ea60eb7f6b35cc433a6fff96cc65b3ff8 (diff)
Merge branch 'dev'
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile45
1 files changed, 45 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..23414c45
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,45 @@
+#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) json.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 $@ $<
+
+json.o: ./json/jsoncpp.cpp ./json/json.h ./json/json-forwards.h
+ $(CC) $(CFLAGS) -I. -c -o $@ $<
+
+clean:
+ @echo " Cleaning...";
+ $(RM) -r *.o $(TARGETDIR)
+
+.PHONY: clean