2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00
koreader/Makefile

125 lines
3.9 KiB
Makefile
Raw Normal View History

2013-03-24 21:27:20 +00:00
# koreader-base directory
KOR_BASE?=koreader-base
2013-03-24 21:27:20 +00:00
# the repository might not have been checked out yet, so make this
# able to fail:
2013-03-24 21:04:32 +00:00
-include $(KOR_BASE)/Makefile.defs
# we want VERSION to carry the version of koreader, not koreader-base
VERSION=$(shell git describe HEAD)
# subdirectory we use to build the installation bundle
INSTALL_DIR=koreader-$(MACHINE)
# files to link from main directory
INSTALL_FILES=reader.lua frontend resources defaults.lua \
git-rev README.md COPYING
2013-04-07 19:05:32 +00:00
# for gettext
DOMAIN=koreader
TEMPLATE_DIR=l10n/templates
KOREADER_MISC_TOOL=../misc
XGETTEXT_BIN=$(KOREADER_MISC_TOOL)/gettext/lua_xgettext.py
MO_DIR=$(INSTALL_DIR)/koreader/i18n
2013-04-07 19:05:32 +00:00
all: $(KOR_BASE)/$(OUTPUT_DIR)/luajit po mo
$(MAKE) -C $(KOR_BASE)
echo $(VERSION) > git-rev
mkdir -p $(INSTALL_DIR)/koreader
ifdef EMULATE_READER
cp -f $(KOR_BASE)/ev_replay.py $(INSTALL_DIR)/koreader/
# create symlink instead of copying files in development mode
cd $(INSTALL_DIR)/koreader && \
ln -sf ../../$(KOR_BASE)/$(OUTPUT_DIR)/* .
else
cp -rfL $(KOR_BASE)/$(OUTPUT_DIR)/* $(INSTALL_DIR)/koreader/
endif
for f in $(INSTALL_FILES); do \
2013-08-07 19:58:15 +00:00
ln -sf ../../$$f $(INSTALL_DIR)/koreader/; \
done
# install plugins
cp -r plugins/* $(INSTALL_DIR)/koreader/plugins/
cp -rpL resources/fonts/* $(INSTALL_DIR)/koreader/fonts/
2013-08-07 19:58:15 +00:00
mkdir -p $(INSTALL_DIR)/koreader/screenshots
mkdir -p $(INSTALL_DIR)/koreader/data/dict
mkdir -p $(INSTALL_DIR)/koreader/data/tessdata
mkdir -p $(INSTALL_DIR)/koreader/fonts/host
ifndef EMULATE_READER
# clean up, remove unused files for releases
rm -rf $(INSTALL_DIR)/koreader/data/{cr3.ini,cr3skin-format.txt,desktop,devices,manual}
rm $(INSTALL_DIR)/koreader/fonts/droid/DroidSansFallbackFull.ttf
endif
$(KOR_BASE)/$(OUTPUT_DIR)/luajit:
$(MAKE) -C $(KOR_BASE)
test:
$(MAKE) -C $(KOR_BASE) test
.PHONY: test
fetchthirdparty:
git submodule init
git submodule update
$(MAKE) -C $(KOR_BASE) fetchthirdparty
clean:
2013-08-07 19:58:15 +00:00
rm -rf $(INSTALL_DIR)
$(MAKE) -C $(KOR_BASE) clean
kindleupdate: all
# ensure that the binaries were built for ARM
file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1
# remove old package if any
rm -f koreader-kindle-$(MACHINE)-$(VERSION).zip
# Kindle launching scripts
ln -sf ../kindle/extensions $(INSTALL_DIR)/
ln -sf ../kindle/launchpad $(INSTALL_DIR)/
ln -sf ../../kindle/koreader.sh $(INSTALL_DIR)/koreader
# create new package
cd $(INSTALL_DIR) && \
zip -9 -r \
../koreader-kindle-$(MACHINE)-$(VERSION).zip \
extensions koreader launchpad \
-x "koreader/resources/fonts/*" "koreader/resources/icons/src/*" "koreader/spec/*"
2013-03-24 21:06:49 +00:00
# @TODO write an installation script for KUAL (houqp)
2013-03-24 21:04:32 +00:00
2013-08-06 10:03:10 +00:00
koboupdate: all
# ensure that the binaries were built for ARM
file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1
# remove old package if any
rm -f koreader-kobo-$(MACHINE)-$(VERSION).zip
# Kobo launching scripts
mkdir -p $(INSTALL_DIR)/kobo/mnt/onboard/.kobo
ln -sf ../../../../../kobo/fmon $(INSTALL_DIR)/kobo/mnt/onboard/.kobo/
cd $(INSTALL_DIR)/kobo && tar -czhf ../KoboRoot.tgz mnt
cp resources/koreader.png $(INSTALL_DIR)/koreader.png
cp kobo/fmon/README.txt $(INSTALL_DIR)/README_kobo.txt
cp kobo/koreader_kobo.sh $(INSTALL_DIR)/koreader
cp kobo/kobo_suspend.sh $(INSTALL_DIR)/koreader
cp kobo/*.bin $(INSTALL_DIR)/koreader
# create new package
cd $(INSTALL_DIR) && \
zip -9 -r \
../koreader-kobo-$(MACHINE)-$(VERSION).zip \
2013-09-30 21:03:39 +00:00
KoboRoot.tgz koreader koreader.png README_kobo.txt \
-x "koreader/resources/fonts/*" "koreader/resources/icons/src/*" "koreader/spec/*"
2013-04-07 19:05:32 +00:00
pot:
$(XGETTEXT_BIN) reader.lua `find frontend -iname "*.lua"` \
2014-04-23 15:02:45 +00:00
`find plugins -iname "*.lua"` \
2013-04-07 19:05:32 +00:00
> $(TEMPLATE_DIR)/$(DOMAIN).pot
po:
$(MAKE) -i -C l10n bootstrap update
2013-04-07 19:21:03 +00:00
mo:
for po in `find l10n -iname '*.po'`; do \
resource=`basename $$po .po` ; \
lingua=`dirname $$po | xargs basename` ; \
mkdir -p $(MO_DIR)/$$lingua/LC_MESSAGES/ ; \
msgfmt -o $(MO_DIR)/$$lingua/LC_MESSAGES/$$resource.mo $$po ; \
done
2013-04-07 19:05:32 +00:00