This repository has been archived by the owner on Mar 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 488
/
Makefile
76 lines (58 loc) · 2.4 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#
# Environment variables for overriding default behavior.
#
ifndef ANDROID_NDK_HOME
ANDROID_NDK_HOME = $(abspath $(dir $(realpath $(shell which ndk-build))))
endif
SCALA_VERSION=2.11
DJINNI_VERSION=0.1-SNAPSHOT
OUTPUT_JAR=src/target/scala-$(SCALA_VERSION)/djinni-assembly-$(DJINNI_VERSION).jar
#
# Global targets.
#
all: djinni example_ios example_android example_localhost test
clean: djinni_jar_clean 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
$(OUTPUT_JAR):
cd src && sbt assembly
djinni_jar: $(OUTPUT_JAR)
djinni_jar_clean:
cd src && sbt clean
# 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
test_clean:
make -C test-suite clean
.PHONY: example_android example_ios example_localhost test test_clean djinni clean all dinni_jar