Permalink
Browse files

update makefile to allow static linking of of distorm on mac. default…

… behaviour is unchanged
  • Loading branch information...
jonasmr committed Dec 9, 2018
1 parent eec1181 commit 0343d10507ff9734a51bda73c4189f71d10647f7
Showing with 6 additions and 2 deletions.
  1. +6 −2 make/mac/Makefile
@@ -2,23 +2,27 @@
# diStorm3 (Mac Port)
#

DISTORM_MODE ?= DISTORM_DYNAMIC
TARGET = libdistorm3.dylib
PYTHON_BUILD_DIR = ../../Python/macosx-x86
COBJS = ../../src/mnemonics.o ../../src/wstring.o ../../src/textdefs.o ../../src/prefix.o ../../src/operands.o ../../src/insts.o ../../src/instructions.o ../../src/distorm.o ../../src/decoder.o
CC = gcc
CFLAGS = -arch i386 -arch x86_64 -O2 -Wall -fPIC -DSUPPORT_64BIT_OFFSET -DDISTORM_DYNAMIC
CFLAGS = -arch i386 -arch x86_64 -O2 -Wall -fPIC -DSUPPORT_64BIT_OFFSET -D${DISTORM_MODE}

all: clib

clean:
/bin/rm -rf ../../src/*.o ${TARGET} ../../libdistorm3.dylib ../../distorm3.a ../../*.a

clib: ${COBJS}
ifeq '$(DISTORM_MODE)' 'DISTORM_DYNAMIC'
${CC} ${CFLAGS} ${VERSION} ${COBJS} -fPIC -dynamiclib -o ${TARGET}
[ -d ${PYTHON_BUILD_DIR} ] && rm -rf ${PYTHON_BUILD_DIR} || true
mkdir ${PYTHON_BUILD_DIR}
cp ${TARGET} ${PYTHON_BUILD_DIR}/
#ar rs ../../distorm3.a ${COBJS}
else
ar rs ../../distorm3.a ${COBJS}
endif

.c.o:
${CC} ${CFLAGS} ${VERSION} -c $< -o $@

0 comments on commit 0343d10

Please sign in to comment.