aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 4 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index beeae99..c66bce7 100644
--- a/Makefile
+++ b/Makefile
@@ -10,12 +10,11 @@ IMAON2 := /Users/comex/c/imaon2
GEN_JS := node --harmony --harmony_arrow_functions $(IMAON2)/tables/gen.js
all: \
- generateds \
out/libsubstitute.dylib
$(shell mkdir -p out generated)
-HEADERS := lib/*.h
+HEADERS := lib/*.h lib/darwin/*.h
GENERATED := generated/generic-dis-arm.inc.h generated/generic-dis-thumb.inc.h generated/generic-dis-thumb2.inc.h generated/generic-dis-arm64.inc.h
define do_prefix
generated/generic-dis-$(1).inc.h:
@@ -47,6 +46,7 @@ LIB_OBJS := \
out/darwin/read.o \
out/darwin/substrate-compat.o \
out/darwin/stop-other-threads.o \
+ out/darwin/execmem.o \
out/darwin-inject-asm.o \
out/jump-dis.o \
out/transform-dis.o \
@@ -61,7 +61,7 @@ out/libsubstitute.dylib: $(LIB_OBJS)
# architectures or something - meh
# Did you know? With -Oz + -marm, Apple clang-600.0.56 actually generated
# wrong code for the ARM version. It works with -Os and with newer clang.
-IACLANG := clang -Os -dynamiclib -nostartfiles -nodefaultlibs -isysroot /dev/null -fPIC
+IACLANG := clang -Os -dynamiclib -nostartfiles -nodefaultlibs -isysroot /dev/null -Ilib -fPIC
out/inject-asm-raw-x86_64.o: lib/darwin/inject-asm-raw.c Makefile
$(IACLANG) -arch x86_64 -o $@ $<
out/inject-asm-raw-i386.o: lib/darwin/inject-asm-raw.c Makefile
@@ -101,6 +101,7 @@ $(eval $(call define_test,objc-hook,objc-hook,$(CC) -std=c11 -framework Foundati
$(eval $(call define_test,interpose,interpose,$(CC) -std=c11 -lsubstitute))
$(eval $(call define_test,inject,inject,$(CC) -std=c11 -lsubstitute out/darwin/inject.o out/darwin/read.o))
$(eval $(call define_test,stop-threads,stop-threads,$(CC) -std=c11 out/darwin/stop-other-threads.o -framework CoreFoundation))
+$(eval $(call define_test,execmem,execmem,$(CC) -std=c11 out/darwin/execmem.o -segprot __TEST rwx rx))
out/insns-arm.o: test/insns-arm.S Makefile
clang -arch armv7 -c -o $@ $<