Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
75 lines (52 sloc) 1.99 KB
#
# setup your build environment to build for Android:
# 1. Install NDK and Android git (at least the openssl fork)
# 2. symlink $NDK/platforms/android-19/arch-arm/usr/include/openssl to /path/to/android.git/external/openssl/include/openssl/
# 3. copy emulators libssl.so and libcrypto.so to $NDK/platforms/android-19/arch-arm/usr/lib/
ROOT=/opt
NDK=android-ndk-r9d
PREFIX=$(ROOT)/$(NDK)/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
SYSROOT=--sysroot=$(ROOT)/$(NDK)/platforms/android-19/arch-arm/
INC=-I$(ROOT)/$(NDK)/sources/cxx-stl/gnu-libstdc++/include\
-I$(ROOT)/$(NDK)/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include\
-I$(ROOT)/$(NDK)/sources/cxx-stl/stlport/stlport
LIB=-Wl,$(ROOT)/$(NDK)/sources/cxx-stl/stlport/libs/armeabi/libstlport_static.a
CXX=$(PREFIX)c++ $(INC) $(SYSROOT)
CFLAGS=-Wall -O2 -DHAVE_UNIX98 -std=c++11 -pedantic -DANDROID
LD=$(PREFIX)c++ $(SYSROOT)
STRIP=strip
all: crashd crashc
clean:
rm -rf *.o
crashc: net.o misc.o crashc.o config.o global.o
$(LD) net.o misc.o crashc.o config.o pty.o global.o pty98.o $(LIB) -lssl -ldl -lcrypto -o crashc
$(STRIP) crashc
crashd: server.o session.o net.o misc.o crashd.o config.o pty.o pty98.o global.o log.o dh.o iobox.o
$(LD) server.o session.o net.o misc.o crashd.o config.o pty.o pty98.o global.o log.o dh.o iobox.o $(LIB) -lssl -ldl -lcrypto -o crashd
$(STRIP) crashd
iobox.o: iobox.cc
$(CXX) $(CFLAGS) -c iobox.cc
server.o: server.cc
$(CXX) $(CFLAGS) -c server.cc
session.o: session.cc
$(CXX) $(CFLAGS) -c session.cc
net.o: net.cc
$(CXX) $(CFLAGS) -c net.cc
misc.o: misc.cc
$(CXX) $(CFLAGS) -c misc.cc
config.o: config.cc
$(CXX) $(CFLAGS) -c config.cc
pty.o: pty.cc
$(CXX) $(CFLAGS) -c pty.cc
pty98.o: pty98.cc
$(CXX) $(CFLAGS) -c pty98.cc
global.o: global.cc
$(CXX) $(CFLAGS) -c global.cc
log.o: log.cc
$(CXX) $(CFLAGS) -c log.cc
crashd.o: crashd.cc
$(CXX) $(CFLAGS) -c crashd.cc
crashc.o: crashc.cc
$(CXX) $(CFLAGS) -c crashc.cc
dh.o: dh.cc dh2048.cc
$(CXX) $(CFLAGS) -c dh.cc