src/HexRaysCodeXplorer/makefile7.mac
CXX ?= clang++
MACSDK=$(shell xcrun --show-sdk-path --sdk macosx)
CXXFLAGS=-m64 -fPIC -shared -D__PLUGIN__ -D__X64__ -Wall -Wextra -std=c++11 -isysroot $(MACSDK) -static-libstdc++ -DUSE_DANGEROUS_FUNCTIONS=1 -DUSE_STANDARD_FILE_FUNCTIONS=1
LDFLAGS=-shared -m64
LIBS=-lc -lpthread -ldl -lc++ -liconv
INCLUDES=-I$(IDA_SDK)/include -I$(IDA_DIR)/plugins/hexrays_sdk/include
SRCDIR=./
SRC=$(SRCDIR)CodeXplorer.cpp \
$(SRCDIR)CtreeExtractor.cpp \
$(SRCDIR)CtreeGraphBuilder.cpp \
$(SRCDIR)Debug.cpp \
$(SRCDIR)GCCObjectFormatParser.cpp \
$(SRCDIR)GCCTypeInfo.cpp \
$(SRCDIR)GCCVtableInfo.cpp \
$(SRCDIR)IObjectFormatParser.cpp \
$(SRCDIR)MSVCObjectFormatParser.cpp \
$(SRCDIR)ObjectExplorer.cpp \
$(SRCDIR)ReconstructableType.cpp \
$(SRCDIR)reconstructed_place_t.cpp \
$(SRCDIR)TypeExtractor.cpp \
$(SRCDIR)TypeReconstructor.cpp \
$(SRCDIR)MicrocodeExtractor.cpp \
$(SRCDIR)Utility.cpp
#SRC = $(wildcard src/*.cpp)
#OBJS=$(subst .cpp,.o,$(SRC))
all: check-env HexRaysCodeXplorer.dylib HexRaysCodeXplorer64.dylib
HexRaysCodeXplorer.dylib: $(SRC)
$(CXX) $(LDFLAGS) $(SRC) $(CXXFLAGS) -L. -L$(IDA_DIR) $(INCLUDES) -D__MAC__=1 $(LIBS) -lida -o HexRaysCodeXplorer.dylib
HexRaysCodeXplorer64.dylib: $(SRC)
$(CXX) $(LDFLAGS) $(SRC) $(CXXFLAGS) -L. -L$(IDA_DIR) $(INCLUDES) -D__MAC__=1 -D__EA64__=1 $(LIBS) -lida64 -o HexRaysCodeXplorer64.dylib
clean:
rm -f HexRaysCodeXplorer.dylib HexRaysCodeXplorer64.dylib
install:
cp -f HexRaysCodeXplorer.dylib $(IDA_DIR)/plugins/
cp -f HexRaysCodeXplorer64.dylib $(IDA_DIR)/plugins/
check-env:
ifndef IDA_SDK
$(error IDA_SDK is undefined)
endif
ifndef IDA_DIR
$(error IDA_DIR is undefined)
endif
# pwd && cp -f $(IDA_SDK)/lib/x64_mac_clang_64/pro.a libpro.a
.PHONY: check-env