Skip to content

Commit

Permalink
Merge pull request CovenantSQL#328 from CovenantSQL/feature/android_c…
Browse files Browse the repository at this point in the history
…ross_compile

Support android arm64 system compatible ELF binary release
  • Loading branch information
leventeliu authored May 14, 2019
2 parents 8761528 + 22a0156 commit 8f1ac9c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,22 @@ build-release: bin/cqld bin/cql-minerd bin/cql bin/cql-fuse bin/cql-mysql-adapte
release:
make -j$(JOBS) build-release

android-release: status
docker build \
--tag $(BUILDER):android-$(VERSION) \
-f docker/android-builder.Dockerfile \
.
temp_container=$$(docker create $(BUILDER):android-$(VERSION)) ; \
docker cp $${temp_container}:/CovenantSQL.tar.gz CovenantSQL-android-$(VERSION).tar.gz && \
docker rm $${temp_container} && \
docker rmi $(BUILDER):android-$(VERSION)

clean:
rm -rf bin/cql*
rm -f *.cover.out
rm -f coverage.txt

.PHONY: status start stop logs push push_testnet clean \
bin/cqld.test bin/cqld bin/cql-minerd.test bin/cql-minerd \
bin/cql bin/cql.test bin/cql-fuse bin/cql-mysql-adapter bin/cql-faucet
bin/cql bin/cql.test bin/cql-fuse bin/cql-mysql-adapter bin/cql-faucet \
release android-release
9 changes: 9 additions & 0 deletions docker/android-builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Stage: builder
FROM karalabe/xgo-latest

RUN $ANDROID_NDK_ROOT/build/tools/make-standalone-toolchain.sh --ndk-dir=$ANDROID_NDK_ROOT --install-dir=/usr/$ANDROID_CHAIN_ARM64 --toolchain=$ANDROID_CHAIN_ARM64 --arch=arm64
WORKDIR /go/src/github.com/CovenantSQL/CovenantSQL
COPY . .
RUN make clean
RUN GOOS=android GOARCH=arm64 CC=aarch64-linux-android-gcc make release
RUN tar cvfz /CovenantSQL.tar.gz bin/cql*

0 comments on commit 8f1ac9c

Please sign in to comment.