]> git.saurik.com Git - cycript.git/blame - Darwin.mk
Fixed a few bugs in the cross-compile and a GNUstep related casting issue.
[cycript.git] / Darwin.mk
CommitLineData
4de0686f
JF
1# XXX: objective-c exists on non-Darwin
2
9185d5ef 3dll := dylib
b166b11b 4flags += -DCY_EXECUTE
dfa452c2
JF
5link += -lobjc -framework CoreFoundation
6console += -framework Foundation
9185d5ef
JF
7library += -install_name /usr/lib/libcycript.$(dll)
8library += -framework Foundation -framework CFNetwork
9library += -framework JavaScriptCore -framework WebCore
28926538 10library += -lsubstrate -liconv
1e7ce557 11
b166b11b
JF
12flags += -DCY_ATTACH
13code += Handler.o
14inject += Mach/Inject.o
15Mach/Inject.o: Trampoline.t.hpp Baton.hpp
16
17%.t.hpp: %.t.cpp
95678376 18 $(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 $(target)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
b166b11b 19
cbaa5f0f 20include ObjectiveC.mk