Skip to content

Commit

Permalink
Initial setup to compile on SDK 10-21.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorccu committed Nov 5, 2014
1 parent 81fe8e6 commit d6f7974
Show file tree
Hide file tree
Showing 7 changed files with 257 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
/libs/
2 changes: 2 additions & 0 deletions .rsync-filter
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- .git
- libs
192 changes: 192 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
this_dir = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
SOURCES := $(shell find jni -name '*.cpp' -or -name '*.mk')

all: \
libs/android-10/armeabi-v7a/minicap \
libs/android-14/armeabi-v7a/minicap \
libs/android-14/x86/minicap \
libs/android-15/armeabi-v7a/minicap \
libs/android-15/x86/minicap \
libs/android-16/armeabi-v7a/minicap \
libs/android-16/x86/minicap \
libs/android-17/armeabi-v7a/minicap \
libs/android-17/x86/minicap \
libs/android-18/armeabi-v7a/minicap \
libs/android-18/x86/minicap \
libs/android-19/armeabi-v7a/minicap \
libs/android-19/x86/minicap \
libs/android-21/armeabi-v7a/minicap \
libs/android-21/arm64-v8a/minicap \
libs/android-21/x86/minicap \
libs/android-21/x86_64/minicap \

libs/android-10/armeabi-v7a/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-2.3.3_r1:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build generic-eng minicap

libs/android-14/armeabi-v7a/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-4.0.1_r1:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build full-eng minicap

libs/android-14/x86/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-4.0.1_r1:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build full_x86-eng minicap

libs/android-15/armeabi-v7a/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-4.0.3_r1:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build full-eng minicap

libs/android-15/x86/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-4.0.3_r1:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build full_x86-eng minicap

libs/android-16/armeabi-v7a/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-4.1.1_r1:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build full-eng minicap

libs/android-16/x86/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-4.1.1_r1:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build full_x86-eng minicap

libs/android-17/armeabi-v7a/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-4.2_r1:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build full-eng minicap

libs/android-17/x86/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-4.2_r1:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build full_x86-eng minicap

libs/android-18/armeabi-v7a/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-4.3_r1:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build aosp_arm-eng minicap

libs/android-18/x86/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-4.3_r1:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build aosp_x86-eng minicap

libs/android-19/armeabi-v7a/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-4.4_r1:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build aosp_arm-eng minicap

libs/android-19/x86/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-4.4_r1:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build aosp_x86-eng minicap

libs/android-21/armeabi-v7a/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-5.0.0_r2:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build aosp_arm-eng minicap

libs/android-21/arm64-v8a/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-5.0.0_r2:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build aosp_arm64-eng minicap

libs/android-21/x86/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-5.0.0_r2:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build aosp_x86-eng minicap

libs/android-21/x86_64/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-5.0.0_r2:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build aosp_x86_64-eng minicap

libs/android-21/mips/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-5.0.0_r2:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build aosp_mips-eng minicap

libs/android-21/mips64/minicap: $(SOURCES)
mkdir -p $(@D)
docker run --rm \
-a stdout -a stderr \
-v /srv/aosp/android-5.0.0_r2:/aosp \
-v $(this_dir)jni:/app \
-v $(this_dir)$(@D):/artifacts \
sorccu/aosp:jdk6 /aosp.sh build aosp_mips64-eng minicap
29 changes: 29 additions & 0 deletions build-remote.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

set -xueo pipefail

TARGET=/tmp/minicap

rsync \
--rsync-path='nice rsync' \
--recursive \
--copy-links \
--perms \
--times \
-FF ./ "$BUILD_HOST":$TARGET

ssh -T "$BUILD_HOST" "docker run --rm \
-a stdout -a stderr \
-v $TARGET:$TARGET \
-v \$(which docker):\$(which docker) \
-v /usr/lib:/usr/lib \
-v /var/run/docker.sock:/var/run/docker.sock \
sorccu/aosp:latest bash -c 'cd $TARGET && make -j 4'"

rsync \
--rsync-path='nice rsync' \
--recursive \
--copy-links \
--perms \
--times \
"$BUILD_HOST":$TARGET/libs/ libs/
1 change: 1 addition & 0 deletions jni/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(call all-subdir-makefiles)
27 changes: 27 additions & 0 deletions jni/minicap/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := minicap

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := \
minicap.cpp \

LOCAL_PRELINK_MODULE := false

LOCAL_SHARED_LIBRARIES := \
libcutils \
libutils \
libbinder \
libui \

ifeq ($(PLATFORM_SDK_VERSION),10)
LOCAL_SHARED_LIBRARIES += libsurfaceflinger_client
else
LOCAL_SHARED_LIBRARIES += libgui
endif

LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)

include $(BUILD_EXECUTABLE)
4 changes: 4 additions & 0 deletions jni/minicap/minicap.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
int main(int argc, char* argv[])
{
return 0;
}

0 comments on commit d6f7974

Please sign in to comment.