forked from Vector35/binaryninja-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (34 loc) · 894 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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