desktop: po*: added TRANSLATORS comment tag, to explain some strings in code
[barry.git] / android / Makefile
blobf23a1e2b1d64704d458cc2454c579a6606e02529
2 # \file Makefile
3 # Make rules for building Barry and dependent libraries for Android
5 # Copyright (C) 2011-2012 RealVNC Ltd.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 # See the GNU General Public License in the COPYING file at the
17 # root directory of this project for more details.
19 LIBUSB_NAME=libusb-1.0.8
20 LIBICONV_NAME=libiconv-1.13.1
21 NDK_OUTPUT_FILES=libusb1.0.so lsusb libiconv.so \
22 btool brawchannel bidentify bjavaloader bjvmdebug \
23 upldif bktrans breset bcharge pppob brecsum
24 include jni/Application.mk
25 NDK_OUTPUT_ARCHES=$(APP_ABI)
26 NDK_BINARIES=$(addprefix libs/, $(foreach ARCH,$(NDK_OUTPUT_ARCHES),$(addprefix $(ARCH)/, $(NDK_OUTPUT_FILES))))
27 ANDROID_TOOLCHAIN_DIR=android-ndk-tools
28 ANDROID_NDK_PATH=$(dir $(shell which ndk-build))
29 WGET=wget
31 EXTRA_DIST = \
32 jni/Android.mk \
33 jni/Application.mk \
34 jni/BarryTool.mk \
35 jni/barry/config.h \
36 jni/libusb/config.h \
37 README
39 all: android-binaries
41 .PHONY: android-binaries
43 $(LIBUSB_NAME).tar.bz2:
44 $(WGET) http://sourceforge.net/projects/libusb/files/libusb-1.0/$(LIBUSB_NAME)/$(LIBUSB_NAME).tar.bz2/download -O $(LIBUSB_NAME).tar.bz2
46 $(LIBICONV_NAME).tar.gz:
47 $(WGET) http://ftp.gnu.org/pub/gnu/libiconv/$(LIBICONV_NAME).tar.gz -O $(LIBICONV_NAME).tar.gz
49 $(LIBUSB_NAME): $(LIBUSB_NAME).tar.bz2
50 tar jxf $(LIBUSB_NAME).tar.bz2
51 touch $(LIBUSB_NAME)
53 $(LIBICONV_NAME): $(LIBICONV_NAME).tar.gz
54 tar zxf $(LIBICONV_NAME).tar.gz
55 touch $(LIBICONV_NAME)
57 $(ANDROID_TOOLCHAIN_DIR):
58 $(ANDROID_NDK_PATH)/build/tools/make-standalone-toolchain.sh --install-dir="$(ANDROID_TOOLCHAIN_DIR)"
60 jni/barry_root:
61 ln -s ../../ jni/barry_root
63 jni/barry/barry:
64 ln -s ../../../src jni/barry/barry
67 android-binaries: jni/barry_root jni/barry/barry $(LIBUSB_NAME) $(LIBICONV_NAME) $(ANDROID_TOOLCHAIN_DIR)
68 +ANDROID_TOOLCHAIN_DIR="$(realpath $(ANDROID_TOOLCHAIN_DIR))" ndk-build
70 distclean: clean
71 -$(RM) $(LIBUSB_NAME).tar.bz2
72 -$(RM) $(LIBICONV_NAME).tar.gz
73 -$(RM) -rf libs
75 clean:
76 -$(RM) -rf $(LIBUSB_NAME)
77 -$(RM) -rf $(LIBICONV_NAME)
78 -$(RM) jni/barry_root
79 -$(RM) jni/barry/barry
80 -$(RM) -rf obj
81 -$(RM) -rf $(NDK_BINARIES)
82 -$(RM) -rf $(ANDROID_TOOLCHAIN_DIR)