make Android target

pull/597/head
chrox 10 years ago
parent eb1220d154
commit 54277974d2

@ -36,17 +36,17 @@ ifdef EMULATE_READER
# create symlink instead of copying files in development mode # create symlink instead of copying files in development mode
cd $(INSTALL_DIR)/koreader && \ cd $(INSTALL_DIR)/koreader && \
ln -sf ../../$(KOR_BASE)/$(OUTPUT_DIR)/* . ln -sf ../../$(KOR_BASE)/$(OUTPUT_DIR)/* .
# install front spec # install front spec only for the emulator
cd $(INSTALL_DIR)/koreader/spec && test -e front || \ cd $(INSTALL_DIR)/koreader/spec && test -e front || \
ln -sf ../../../../spec ./front ln -sf ../../../../spec ./front
cd $(INSTALL_DIR)/koreader/spec/front/unit && test -e data || \
ln -sf ../../test ./data
else else
cp -rfL $(KOR_BASE)/$(OUTPUT_DIR)/* $(INSTALL_DIR)/koreader/ cp -rfL $(KOR_BASE)/$(OUTPUT_DIR)/* $(INSTALL_DIR)/koreader/
endif endif
for f in $(INSTALL_FILES); do \ for f in $(INSTALL_FILES); do \
ln -sf ../../$$f $(INSTALL_DIR)/koreader/; \ ln -sf ../../$$f $(INSTALL_DIR)/koreader/; \
done done
cd $(INSTALL_DIR)/koreader/spec/front/unit && test -e data || \
ln -sf ../../test ./data
# install plugins # install plugins
cp -r plugins/* $(INSTALL_DIR)/koreader/plugins/ cp -r plugins/* $(INSTALL_DIR)/koreader/plugins/
cp -rpL resources/fonts/* $(INSTALL_DIR)/koreader/fonts/ cp -rpL resources/fonts/* $(INSTALL_DIR)/koreader/fonts/
@ -131,10 +131,16 @@ androidupdate: all
cd $(INSTALL_DIR)/koreader && 7z a -l -mx=1 \ cd $(INSTALL_DIR)/koreader && 7z a -l -mx=1 \
../../$(ANDROID_LAUNCHER_DIR)/assets/module/koreader-g$(REVISION).7z * \ ../../$(ANDROID_LAUNCHER_DIR)/assets/module/koreader-g$(REVISION).7z * \
-x!resources/fonts -x!resources/icons/src -x!spec -x!resources/fonts -x!resources/icons/src -x!spec
$(MAKE) -C $(ANDROID_LAUNCHER_DIR) apk
cp $(ANDROID_LAUNCHER_DIR)/bin/NativeActivity-debug.apk \
koreader-android-$(MACHINE)-$(VERSION).apk
androiddev: androidupdate androiddev: androidupdate
$(MAKE) -C $(ANDROID_LAUNCHER_DIR) dev $(MAKE) -C $(ANDROID_LAUNCHER_DIR) dev
android-toolchain:
$(MAKE) -C $(KOR_BASE) android-toolchain
pot: pot:
$(XGETTEXT_BIN) reader.lua `find frontend -iname "*.lua"` \ $(XGETTEXT_BIN) reader.lua `find frontend -iname "*.lua"` \
`find plugins -iname "*.lua"` \ `find plugins -iname "*.lua"` \

@ -1,17 +1,16 @@
KOReader [![Build Status][travis-icon]][travis-link] KOReader [![Build Status][travis-icon]][travis-link]
======== ========
This is a document viewer application, originally created for usage on the KOReader is a document viewer application, originally created for usage on the
Kindle e-ink reader. It currently supports Kindle 5 (Touch), Kindle Paperwhite Kindle e-ink reader. It currently supports Kindle 5 (Touch), Kindle Paperwhite
and Kobo devices. Kindles need to be jailbroken in order to install the , Kobo and Android devices.
application. Also, a kind of external launcher is needed.
KOReader started as the KindlePDFViewer application, but it supports much more KOReader started as the KindlePDFViewer application, but it supports much more
formats than PDF now. Among them are DJVU, FB2, EPUB, TXT, CBZ, HTML. formats than PDF now. Among them are DJVU, FB2, EPUB, TXT, CBZ, HTML.
KOReader is a frontend written in Lua and uses the API presented by the KOReader is a frontend written in Lua and uses the API presented by the
KOReader-base framework. KOReader implements a GUI and is currently targeted koreader-base framework. KOReader implements a GUI and is currently targeted
at Touch-based devices - for the classic user interface for button-driven at touch-based devices - for the classic user interface for button-driven
e-ink devices (like the Kindle 2, Kindle DX, Kindle 3, Kindle 4) see the e-ink devices (like the Kindle 2, Kindle DX, Kindle 3, Kindle 4) see the
KindlePDFviewer legacy project or - especially for the Kindle 4 - have a look KindlePDFviewer legacy project or - especially for the Kindle 4 - have a look
at its fork Librerator. at its fork Librerator.
@ -24,8 +23,8 @@ more about this project.
Prerequisites Prerequisites
======== ========
Instructions about how to get and compile the source are intended for a \*nix Instructions about how to get and compile the source are intended for a linux
OS. Windows users are suggested to develop in a [Linux VM](http://www.howtogeek.com/howto/11287/how-to-run-ubuntu-in-windows-7-with-vmware-player/) or use Wubi. OS. Windows users are suggested to develop in a [Linux VM][linux-vm] or use Wubi.
To get and compile the source you must have `patch`, `wget`, `unzip`, `git`, `autoconf`, To get and compile the source you must have `patch`, `wget`, `unzip`, `git`, `autoconf`,
`subversion` and `cmake` installed. Version of autoconf need to be greater than 2.64. `subversion` and `cmake` installed. Version of autoconf need to be greater than 2.64.
@ -35,7 +34,7 @@ Ubuntu users may need to run:
sudo apt-get install build-essential libtool sudo apt-get install build-essential libtool
``` ```
Cross toolchains are available to Ubuntu users through these commands: Cross compile toolchains are available for Ubuntu users through these commands:
``` ```
# for Kindle # for Kindle
sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
@ -43,9 +42,12 @@ sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
``` ```
A recent version of Android SDK/NDK is needed in order to build Koreader for Android
devices.
You might also need SDL library packages if you want to compile and run You might also need SDL library packages if you want to compile and run
Koreader on PC. Fedora users can install `SDL` and `SDL-devel`. Koreader on PC. Fedora users can install `SDL` and `SDL-devel`.
Ubuntu users probably have to run: Ubuntu users probably need to run:
``` ```
sudo apt-get install libsdl1.2-dev sudo apt-get install libsdl1.2-dev
``` ```
@ -66,19 +68,20 @@ Building & Running & Testing
For real eink devices For real eink devices
--------------------- ---------------------
If you already done an emulator build, you must do: If you have already built one package for a different target, remember to run
this command before you go further:
``` ```
make clean make clean
``` ```
To build for the Kindle: To build installable package for Kindle:
``` ```
make kindleupdate make TARGET=kindle kindleupdate
``` ```
To build for the Kobo: To build installable package for Kobo:
``` ```
make TARGET_DEVICE=KOBO koboupdate make TARGET=kobo koboupdate
``` ```
To run, you must call the script reader.lua. Run it without arguments to see To run, you must call the script reader.lua. Run it without arguments to see
@ -88,8 +91,31 @@ be in the same directory.
You may checkout our [nightlybuild script][nb-script] to see how to build a You may checkout our [nightlybuild script][nb-script] to see how to build a
package from scratch. package from scratch.
For Android devices
-------------------
Make sure the "android" tool is in your PATH variable and the NDK variable
points to the root directory of the Android NDK.
First, run this command to make a standalone android cross compiling toolchain
from NDK:
```
make android-toolchain
```
Also, if you have already built a different target, remember to clear the source
code tree with:
```
make clean
```
Then, build installable package for Android:
```
make TARGET=android androidupdate
```
For emulating For emulating
----------- -------------
If you already done a real device build, you must do: If you already done a real device build, you must do:
``` ```
@ -157,4 +183,5 @@ http://ccache.samba.org
[travis-icon]:https://travis-ci.org/koreader/koreader-base.png?branch=master [travis-icon]:https://travis-ci.org/koreader/koreader-base.png?branch=master
[travis-link]:https://travis-ci.org/koreader/koreader-base [travis-link]:https://travis-ci.org/koreader/koreader-base
[travis-conf]:https://github.com/koreader/koreader-base/blob/master/.travis.yml [travis-conf]:https://github.com/koreader/koreader-base/blob/master/.travis.yml
[linux-vm]:http://www.howtogeek.com/howto/11287/how-to-run-ubuntu-in-windows-7-with-vmware-player/

@ -1 +1 @@
Subproject commit 3153b92693a4a57cbe6e21d32f94b1f89e115633 Subproject commit f120e2a0b22e028a2e5ec41d3d5a89e9dc0561cb

@ -1 +1 @@
Subproject commit 3565578196c001d5a3099d3fa9a754e4c2832403 Subproject commit 664db11b0026757a303573c0f056d9180c21e4b8
Loading…
Cancel
Save