]> git.saurik.com Git - cycript.git/blob - Darwin.mk
Actually committing the file that fixed the int to size_t for the lexer warning.
[cycript.git] / Darwin.mk
1 dll := dylib
2 link += -lobjc -framework CoreFoundation
3 console += -framework Foundation
4 library += -install_name /usr/lib/libcycript.$(dll)
5 library += -framework Foundation
6 library += -framework JavaScriptCore
7 # XXX: do I just need WebCore?
8 library += -framework WebKit
9 library += -liconv
10 flags += -I/usr/include/ffi
11
12 ifeq ($(uname_m),i386)
13 flags += -DCY_ATTACH
14 code += Handler.o
15 inject += Mach/Inject.o
16 Mach/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 endif
21
22 include Execute.mk
23 include ObjectiveC.mk