X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/b166b11b8612a2428d7b86bd3dd27207a3f60dab..794e88e774e5cf637db5199e4d9c6665b4fc5673:/Darwin.mk diff --git a/Darwin.mk b/Darwin.mk index a1773fd..20cff9b 100644 --- a/Darwin.mk +++ b/Darwin.mk @@ -1,20 +1,27 @@ -# XXX: objective-c exists on non-Darwin - dll := dylib -flags += -DCY_EXECUTE link += -lobjc -framework CoreFoundation console += -framework Foundation library += -install_name /usr/lib/libcycript.$(dll) -library += -framework Foundation -framework CFNetwork -library += -framework JavaScriptCore -framework WebCore -library += -lsubstrate -liconv +library += -framework Foundation +console += -framework JavaScriptCore +# XXX: do I just need WebCore? +console += -framework WebKit +library += -undefined dynamic_lookup +library += -liconv +flags += -I/usr/include/ffi +apr_config := /usr/bin/apr-1-config +flags += -arch i386 -arch x86_64 #-arch armv6 -flags += -DCY_ATTACH +flags += -DCY_ATTACH -DCY_LIBRARY='"/usr/lib/libcycript.dylib"' code += Handler.o inject += Mach/Inject.o Mach/Inject.o: Trampoline.t.hpp Baton.hpp -%.t.hpp: %.t.cpp - $(target)gcc -c -o $*.t.o $< && { $(target)otool -l $*.t.o | sed -e '/^ *segname __TEXT$$/ { x; s/^ *sectname //; p; }; /^ *sectname / x; d;' | while read -r sect; do otool -s __TEXT "$$sect" Trampoline.t.o; done | sed -e '/:$$/ d; / section$$/ d; s/^[^ \t]*[ \t]*//;s/ $$//;s/ /\n/g' | sed -e 's/\(..\)\(..\)\(..\)\(..\)/0\x\4,0\x\3,0\x\2,0\x\1/' | tr '\n' ',' | sed -e '$$ s/,$$//; s/^/static const char $*_[] = {/;s/$$/};\n/' && echo && echo "/*" && $(target)otool -vVt $*.t.o && echo "*/"; } >$@ && rm -f $*.t.o +%.t.hpp: %.t.cpp trampoline.sh Baton.hpp Trampoline.hpp Darwin.mk + ./trampoline.sh $@ $*.t.dylib $* sed $(target){otool,lipo,nm,gcc} $(flags) -dynamiclib -g0 -fno-stack-protector -fno-exceptions -Iinclude $< -o $*.t.dylib + +clean:: + rm -f Trampoline.t.hpp +include Execute.mk include ObjectiveC.mk