forked from ALSchwalm/dwarfexport
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.osx
41 lines (33 loc) · 1.26 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=-fPIC -shared -Wall -Wextra -std=c++11 -isysroot $(MACSDK) -stdlib=libc++ -DUSE_DANGEROUS_FUNCTIONS=1 -DUSE_STANDARD_FILE_FUNCTIONS=1
LDFLAGS=-L/opt/local/lib/
LIBS=-lelf -ldwarf -lz
INCLUDES=-I$(IDASDK_PATH)/include -I$(IDA_PATH)/plugins/hexrays_sdk/include -I/opt/local/include/libelf -I/opt/local/include
DWARFEXPORT_SRC = $(wildcard src/*.cpp)
all: check-env bin/dwarfexport.dylib bin/dwarfexport64.dylib
bin/dwarfexport.dylib: $(DWARFEXPORT_SRC)
$(CXX) $(LDFLAGS) $(DWARFEXPORT_SRC) $(CXXFLAGS) \
-L. \
-L$(IDA_PATH) -L$(IDASDK_PATH)/lib/x64_mac_gcc_32/ \
$(INCLUDES) \
-D__MAC__ -D__X64__ $(LIBS) -lida -o bin/dwarfexport.dylib
bin/dwarfexport64.dylib: $(DWARFEXPORT_SRC)
$(CXX) $(LDFLAGS) $(DWARFEXPORT_SRC) $(CXXFLAGS) \
-L. \
-L$(IDA_PATH) -L$(IDASDK_PATH)/lib/x64_mac_gcc_64/ \
$(INCLUDES) \
-D__MAC__ -D__X64__ -D__EA64__ $(LIBS) -lida64 -o bin/dwarfexport64.dylib
clean:
rm -f bin/dwarfexport.dylib bin/dwarfexport64.dylib
install:
cp -f bin/dwarfexport.dylib $(IDA_PATH)/plugins/
cp -f bin/dwarfexport64.dylib $(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