X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/4de0686f54039cd5211daebcf5a51ad475594170..c074e774a5364a868ddde950b37342f89ae936ce:/Darwin.mk diff --git a/Darwin.mk b/Darwin.mk index 7a63d7d..af4bdc1 100644 --- a/Darwin.mk +++ b/Darwin.mk @@ -1,10 +1,22 @@ +# 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 +library += -framework JavaScriptCore +# XXX: do I just need WebCore? +library += -framework WebKit +library += -liconv -# XXX: objective-c exists on non-Darwin +flags += -DCY_ATTACH +code += Handler.o +inject += Mach/Inject.o +Mach/Inject.o: Trampoline.t.hpp Baton.hpp -header += Struct.hpp ObjectiveC.hpp -code += ObjectiveC.o -filters += ObjC +%.t.hpp: %.t.cpp + $(target)gcc -c -fno-exceptions -Iinclude -o $*.t.o $< && { file=($$($(target)otool -l $*.t.o | sed -e 'x; /^1/ { x; /^ *filesize / { s/^.* //; p; }; /^ *fileoff / { s/^.* //; p; }; x; }; x; /^ *cmd LC_SEGMENT$$/ { s/.*/1/; x; }; d;')); od -t x1 -j $${file[0]} -N $${file[1]} $*.t.o | sed -e 's/^[^ ]*//' | tr $$'\n' ' ' | sed -e 's/ */ /g;s/^ *//;s/ $$//;s/ /,/g;s/\([^,][^,]\)/0x\1/g' | sed -e 's/^/static const char $*_[] = {/;s/$$/};/' && echo && echo "/*" && $(target)otool -vVt $*.t.o && echo "*/"; } >$@ && rm -f $*.t.o -Struct.hpp: - $$($(target)gcc -print-prog-name=cc1obj) -print-objc-runtime-info $@ +include ObjectiveC.mk