1 # Cycript - Optimizing JavaScript Compiler/Runtime
2 # Copyright (C) 2009-2013 Jay Freeman (saurik)
4 # GNU General Public License, Version 3 {{{
6 # Cycript is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published
8 # by the Free Software Foundation, either version 3 of the License,
9 # or (at your option) any later version.
11 # Cycript is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Cycript. If not, see <http://www.gnu.org/licenses/>.
25 libs += .libs/libcycript.dylib
26 libs += .libs/libcycript-any.dylib
27 libs += .libs/libcycript-sys.dylib
28 libs += .libs/libcycript-sim.dylib
29 libs += .libs/libcycript.o
45 # make stubbornly refuses to believe that these @'s are bugs
46 # http://osdir.com/ml/help-make-gnu/2012-04/msg00008.html
48 build.mac/.libs/cycript: build-mac
50 build.mac/.libs/libcycript.dylib: build-mac
52 build.mac/.libs/libcycript-any.dylib: build-mac
55 build.ios/.libs/cycript: build-ios
57 build.ios/.libs/libcycript.dylib: build-ios
59 build.ios/.libs/libcycript-any.dylib: build-ios
61 build.ios/.libs/libcycript.a: build-ios
64 build.sim/.libs/libcycript.dylib: build-sim
66 build.sim/.libs/libcycript.a: build-sim
69 .libs/%: build.mac/.libs/% build.ios/.libs/%
71 lipo -create -output $@ $^
73 .libs/%-ios.a: build.ios/.libs/%.a build.sim/.libs/%.a
75 lipo -create -output $@ $^
77 .libs/libcycript-sys.dylib:
79 ln -sf libcycript.dylib $@
81 .libs/libcycript-sim.dylib: build.sim/.libs/libcycript.dylib
85 .libs/libcycript-%.o: build.%/.libs/libcycript.a
87 ld -r -arch $$(lipo -detailed_info $< | sed -e '/^Non-fat file: / ! d; s/.*: //') -o $@ -all_load $< libffi.a
89 .libs/libcycript.o: .libs/libcycript-ios.o .libs/libcycript-sim.o
90 lipo -create -output $@ $^
96 .PHONY: all clean build-mac build-ios build-sim