forked from dropbox/djinni
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (48 loc) · 2.08 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#
# Environment variables for overriding default behavior.
#
ifndef ANDROID_NDK_HOME
ANDROID_NDK_HOME = $(abspath $(dir $(realpath $(shell which ndk-build))))
endif
#
# Global targets.
#
all: djinni example_ios example_android example_localhost test
clean:
-ndk-build -C example/android/app/ clean
-xcodebuild -workspace example/objc/TextSort.xcworkspace -scheme TextSort -configuration 'Debug' -sdk iphonesimulator clean
-rm -rf libs/
-rm -rf obj/
-rm -rf build/
-rm -rf build_ios/
-rm -f GypAndroid.mk
# rule to lazily clone gyp
# freeze gyp at the last version with android support
./deps/gyp:
git clone https://chromium.googlesource.com/external/gyp.git ./deps/gyp
cd deps/gyp && git checkout -q 0bb67471bca068996e15b56738fa4824dfa19de0
djinni:
cd src && ./build
# we specify a root target for android to prevent all of the targets from spidering out
GypAndroid.mk: ./deps/gyp example/libtextsort.gyp support-lib/support_lib.gyp example/example.djinni
./example/run_djinni.sh
ANDROID_BUILD_TOP=$(ANDROID_NDK_HOME) deps/gyp/gyp --depth=. -f android -DOS=android -Icommon.gypi example/libtextsort.gyp --root-target=libtextsort_jni
# we specify a root target for android to prevent all of the targets from spidering out
./build_ios/example/libtextsort.xcodeproj: ./deps/gyp example/libtextsort.gyp support-lib/support_lib.gyp example/example.djinni
./example/run_djinni.sh
deps/gyp/gyp --depth=. -f xcode -DOS=ios --generator-output ./build_ios -Icommon.gypi example/libtextsort.gyp
example_ios: ./build_ios/example/libtextsort.xcodeproj
xcodebuild -workspace example/objc/TextSort.xcworkspace \
-scheme TextSort \
-configuration 'Debug' \
-sdk iphonesimulator
# this target implicitly depends on GypAndroid.mk since gradle will try to make it
example_android: GypAndroid.mk
cd example/android/ && ./gradlew app:assembleDebug
@echo "Apks produced at:"
@python example/glob.py example/ '*.apk'
example_localhost: ./deps/java
cd example && make localhost
test: ./deps/java
make -C test-suite
.PHONY: example_android example_ios example_localhost test djinni clean all