Skip to content
This repository was archived by the owner on Aug 2, 2019. It is now read-only.

Commit c18ed6d

Browse files
committed
Add Android build script
1 parent 1d34071 commit c18ed6d

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed

src/Makefile.android

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
# files
3+
4+
EXE = fruit-reloaded-$(target)
5+
6+
OBJS = attack.o board.o book.o egbb.o engine.o eval.o fen.o hash.o list.o main.o \
7+
material.o move.o move_check.o move_do.o move_evasion.o move_gen.o move_legal.o \
8+
option.o pawn.o piece.o posix.o protocol.o pst.o pv.o random.o recog.o search.o \
9+
search_full.o see.o sort.o square.o tb.o test.o thread.o trans.o util.o \
10+
value.o vector.o
11+
12+
# rules
13+
14+
all: $(EXE) .depend
15+
16+
clean:
17+
$(RM) *.o .depend gmon.out fruit-reloaded
18+
19+
# general
20+
21+
CXXFLAGS = -Wall -static
22+
LDFLAGS = -lm
23+
24+
# C++
25+
26+
CXXFLAGS += -fno-exceptions -fno-rtti
27+
28+
# optimisation
29+
30+
CXXFLAGS += -O3 -fstrict-aliasing
31+
32+
# strip
33+
34+
LDFLAGS += -s -pthread
35+
36+
# dependencies
37+
38+
$(EXE): $(OBJS)
39+
$(CXX) $(LDFLAGS) -o $@ $(OBJS) -ldl
40+
41+
.depend:
42+
$(CXX) -MM $(OBJS:.o=.cpp) > $@
43+
44+
include .depend
45+

src/build-android.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
#
3+
# Build script for Android
4+
#
5+
# $NDK must be set to NDK home directory.
6+
# For example NDK=/home/daniel/android/android-ndk-r9d
7+
#
8+
9+
export PATH=$(pwd)/ndk-toolchain/bin:$PATH
10+
11+
# armeabi
12+
13+
export CXX=arm-linux-androideabi-g++
14+
export target="armeabi"
15+
16+
rm -rf ndk-toolchain 2>/dev/null
17+
$NDK/build/tools/make-standalone-toolchain.sh --arch=armeabi --platform=android-9 --install-dir=./ndk-toolchain
18+
19+
make -f Makefile.android
20+
make -f Makefile.android clean
21+
22+
# armv7-a
23+
24+
export CXX=arm-linux-androideabi-g++
25+
export target="armeabi-v7a"
26+
27+
rm -rf ndk-toolchain 2>/dev/null
28+
$NDK/build/tools/make-standalone-toolchain.sh --arch=armeabi-v7a --platform=android-9 --install-dir=./ndk-toolchain
29+
30+
make -f Makefile.android
31+
make -f Makefile.android clean
32+
33+
# x86
34+
35+
export CXX=i686-linux-android-g++
36+
export target="x86"
37+
38+
rm -rf ndk-toolchain 2>/dev/null
39+
$NDK/build/tools/make-standalone-toolchain.sh --arch=x86 --platform=android-9 --install-dir=./ndk-toolchain
40+
41+
make -f Makefile.android
42+
make -f Makefile.android clean
43+
44+
# mips
45+
46+
export CXX=mipsel-linux-android-g++
47+
export target="mips"
48+
49+
rm -rf ndk-toolchain 2>/dev/null
50+
$NDK/build/tools/make-standalone-toolchain.sh --arch=mips --platform=android-9 --install-dir=./ndk-toolchain
51+
52+
make -f Makefile.android
53+
make -f Makefile.android clean

0 commit comments

Comments
 (0)