forked from ALSchwalm/dwarfexport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.osx
41 lines (33 loc) · 1.19 KB
/
Makefile.osx
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
CXX ?= clang++
MACSDK=$(shell xcrun --show-sdk-path --sdk macosx)
CXXFLAGS=-m32 -fPIC -shared -Wall -Wextra -std=c++14 -isysroot $(MACSDK) -stdlib=libc++ -DUSE_DANGEROUS_FUNCTIONS=1 -DUSE_STANDARD_FILE_FUNCTIONS=1
LDFLAGS=-Lthirdparty/libelf-0.8.13/lib -Lthirdparty/libdwarf/libdwarf
LIBS=-lelf -ldwarf -lz
INCLUDES=-I$(IDASDK_PATH)/include -I$(IDA_PATH)/plugins/hexrays_sdk/include -Ithirdparty/libdwarf -I/usr/local/include
DWARFEXPORT_SRC = $(wildcard src/*.cpp)
all: check-env bin/dwarfexport.pmc bin/dwarfexport.pmc64
bin/dwarfexport.pmc: $(DWARFEXPORT_SRC)
$(CXX) $(LDFLAGS) $(DWARFEXPORT_SRC) $(CXXFLAGS) \
-L. \
-L$(IDA_PATH) \
$(INCLUDES) \
-D__MAC__ $(LIBS) -lida -o bin/dwarfexport.pmc
bin/dwarfexport.pmc64: $(DWARFEXPORT_SRC)
$(CXX) $(LDFLAGS) $(DWARFEXPORT_SRC) $(CXXFLAGS) \
-L. \
-L$(IDA_PATH) \
$(INCLUDES) \
-D__MAC__ -D__EA64__ $(LIBS) -lida64 -o bin/dwarfexport.pmc64
clean:
rm -f bin/dwarfexport.pmc bin/dwarfexport.pmc64
install:
cp -f bin/dwarfexport.pmc $(IDA_PATH)/plugins/
cp -f bin/dwarfexport.pmc64 $(IDA_PATH)/plugins/
check-env:
ifndef IDASDK_PATH
$(error IDASDK_PATH is undefined)
endif
ifndef IDA_PATH
$(error IDA_PATH is undefined)
endif
.PHONY: check-env