]> git.saurik.com Git - cycript.git/blame_incremental - Darwin.mk
Progress on autoconf doom!
[cycript.git] / Darwin.mk
... / ...
CommitLineData
1# XXX: objective-c exists on non-Darwin
2
3dll := dylib
4link += -lobjc -framework CoreFoundation
5console += -framework Foundation
6library += -install_name /usr/lib/libcycript.$(dll)
7library += -framework Foundation
8library += -framework JavaScriptCore
9# XXX: do I just need WebCore?
10library += -framework WebKit
11library += -liconv
12
13flags += -DCY_ATTACH
14code += Handler.o
15inject += Mach/Inject.o
16Mach/Inject.o: Trampoline.t.hpp Baton.hpp
17
18%.t.hpp: %.t.cpp
19 $(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
20
21include Execute.mk
22include ObjectiveC.mk