diff options
| author | Andrew Lamoureux <andrew@vector35.com> | 2017-03-15 13:41:40 -0400 |
|---|---|---|
| committer | Andrew Lamoureux <andrew@vector35.com> | 2017-03-15 13:41:40 -0400 |
| commit | 14fe0e379f5c9f10011750232c63d4f057dcf26d (patch) | |
| tree | 0bfa07702311c257d8295d1301c07c72e54d8d07 /Makefile | |
| parent | 2f71ffd2a1ab18eeaf9c3c7821343c7a820679b9 (diff) | |
| parent | 5a42aec73a77a3a54baf054cde9047533709be31 (diff) | |
Merge branch 'dev' of https://github.com/bambu/binaryninja-api into bambu-dev
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 42 |
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 |
