2013-03-24 21:27:20 +00:00
|
|
|
# koreader-base directory
|
2014-10-04 12:52:06 +00:00
|
|
|
KOR_BASE?=base
|
2013-03-24 21:27:20 +00:00
|
|
|
|
2013-03-24 14:08:42 +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
|
|
|
|
|
2013-03-24 14:08:42 +00:00
|
|
|
# we want VERSION to carry the version of koreader, not koreader-base
|
2018-03-07 18:26:56 +00:00
|
|
|
VERSION:=$(shell git describe HEAD)
|
|
|
|
VERSION:=$(VERSION)_$(shell git describe HEAD | xargs git show -s --format=format:"%cd" --date=short)
|
2014-05-25 08:18:55 +00:00
|
|
|
REVISION=$(shell git rev-parse --short HEAD)
|
2013-03-24 14:08:42 +00:00
|
|
|
|
2015-01-17 01:09:36 +00:00
|
|
|
# set PATH to find CC in managed toolchains
|
|
|
|
ifeq ($(TARGET), android)
|
2016-10-10 06:28:16 +00:00
|
|
|
PATH:=$(ANDROID_TOOLCHAIN)/bin:$(PATH)
|
2015-01-17 01:09:36 +00:00
|
|
|
else ifeq ($(TARGET), pocketbook)
|
2016-10-10 06:28:16 +00:00
|
|
|
PATH:=$(POCKETBOOK_TOOLCHAIN)/bin:$(PATH)
|
2015-01-17 01:09:36 +00:00
|
|
|
endif
|
|
|
|
|
2016-02-18 23:32:04 +00:00
|
|
|
MACHINE=$(shell PATH=$(PATH) $(CC) -dumpmachine 2>/dev/null)
|
2017-10-27 18:36:36 +00:00
|
|
|
ifdef KODEBUG
|
|
|
|
MACHINE:=$(MACHINE)-debug
|
|
|
|
endif
|
2015-10-03 06:18:47 +00:00
|
|
|
|
|
|
|
ifdef TARGET
|
|
|
|
DIST:=$(TARGET)
|
|
|
|
else
|
|
|
|
DIST:=emulator
|
|
|
|
endif
|
|
|
|
|
|
|
|
INSTALL_DIR=koreader-$(DIST)-$(MACHINE)
|
2013-03-24 14:08:42 +00:00
|
|
|
|
2014-10-03 10:02:50 +00:00
|
|
|
# platform directories
|
|
|
|
PLATFORM_DIR=platform
|
|
|
|
KINDLE_DIR=$(PLATFORM_DIR)/kindle
|
|
|
|
KOBO_DIR=$(PLATFORM_DIR)/kobo
|
2015-01-12 16:14:56 +00:00
|
|
|
POCKETBOOK_DIR=$(PLATFORM_DIR)/pocketbook
|
2015-10-03 06:18:47 +00:00
|
|
|
UBUNTUTOUCH_DIR=$(PLATFORM_DIR)/ubuntu-touch
|
2014-10-03 10:02:50 +00:00
|
|
|
ANDROID_DIR=$(PLATFORM_DIR)/android
|
2014-06-01 15:53:09 +00:00
|
|
|
ANDROID_LAUNCHER_DIR:=$(ANDROID_DIR)/luajit-launcher
|
2015-10-03 06:18:47 +00:00
|
|
|
UBUNTUTOUCH_SDL_DIR:=$(UBUNTUTOUCH_DIR)/ubuntu-touch-sdl
|
2014-10-03 10:02:50 +00:00
|
|
|
WIN32_DIR=$(PLATFORM_DIR)/win32
|
2014-05-26 15:38:51 +00:00
|
|
|
|
2013-08-07 18:40:00 +00:00
|
|
|
# files to link from main directory
|
2016-11-13 07:44:06 +00:00
|
|
|
INSTALL_FILES=reader.lua setupkoenv.lua frontend resources defaults.lua datastorage.lua \
|
|
|
|
l10n tools README.md COPYING
|
2011-11-16 22:52:26 +00:00
|
|
|
|
2013-04-07 19:05:32 +00:00
|
|
|
|
2011-11-14 18:17:14 +00:00
|
|
|
|
2014-06-05 12:54:36 +00:00
|
|
|
all: $(if $(ANDROID),,$(KOR_BASE)/$(OUTPUT_DIR)/luajit)
|
2013-09-21 13:31:22 +00:00
|
|
|
$(MAKE) -C $(KOR_BASE)
|
2016-01-03 06:28:24 +00:00
|
|
|
install -d $(INSTALL_DIR)/koreader
|
2018-03-07 18:26:56 +00:00
|
|
|
rm -f $(INSTALL_DIR)/koreader/git-rev; echo "$(VERSION)" > $(INSTALL_DIR)/koreader/git-rev
|
2014-09-25 14:25:43 +00:00
|
|
|
ifneq ($(or $(EMULATE_READER),$(WIN32)),)
|
2013-08-07 18:40:00 +00:00
|
|
|
cp -f $(KOR_BASE)/ev_replay.py $(INSTALL_DIR)/koreader/
|
2016-01-31 22:24:26 +00:00
|
|
|
@echo "[*] create symlink instead of copying files in development mode"
|
2014-01-01 21:07:28 +00:00
|
|
|
cd $(INSTALL_DIR)/koreader && \
|
|
|
|
ln -sf ../../$(KOR_BASE)/$(OUTPUT_DIR)/* .
|
2016-01-31 22:24:26 +00:00
|
|
|
@echo "[*] install front spec only for the emulator"
|
2014-05-25 08:18:55 +00:00
|
|
|
cd $(INSTALL_DIR)/koreader/spec && test -e front || \
|
|
|
|
ln -sf ../../../../spec ./front
|
2014-05-29 13:09:22 +00:00
|
|
|
cd $(INSTALL_DIR)/koreader/spec/front/unit && test -e data || \
|
|
|
|
ln -sf ../../test ./data
|
2014-01-01 21:07:28 +00:00
|
|
|
else
|
2016-04-14 17:18:19 +00:00
|
|
|
$(RCP) -fL $(KOR_BASE)/$(OUTPUT_DIR)/* $(INSTALL_DIR)/koreader/
|
2013-08-07 18:40:00 +00:00
|
|
|
endif
|
|
|
|
for f in $(INSTALL_FILES); do \
|
2013-08-07 19:58:15 +00:00
|
|
|
ln -sf ../../$$f $(INSTALL_DIR)/koreader/; \
|
2014-01-01 21:07:28 +00:00
|
|
|
done
|
2014-06-01 15:53:09 +00:00
|
|
|
ifdef ANDROID
|
|
|
|
cd $(INSTALL_DIR)/koreader && \
|
|
|
|
ln -sf ../../$(ANDROID_DIR)/*.lua .
|
2014-09-25 14:25:43 +00:00
|
|
|
endif
|
|
|
|
ifdef WIN32
|
2016-01-31 22:24:26 +00:00
|
|
|
@echo "[*] Install runtime libraries for win32..."
|
2014-10-03 10:02:50 +00:00
|
|
|
cd $(INSTALL_DIR)/koreader && cp ../../$(WIN32_DIR)/*.dll .
|
2014-06-01 15:53:09 +00:00
|
|
|
endif
|
2016-01-31 22:24:26 +00:00
|
|
|
@echo "[*] Install plugins"
|
2016-10-01 08:07:31 +00:00
|
|
|
@# TODO: link istead of cp?
|
2016-04-14 17:18:19 +00:00
|
|
|
$(RCP) plugins/* $(INSTALL_DIR)/koreader/plugins/
|
2017-04-06 09:12:35 +00:00
|
|
|
@# purge deleted plugins
|
|
|
|
for d in $$(ls $(INSTALL_DIR)/koreader/plugins); do \
|
|
|
|
test -d plugins/$$d || rm -rf $(INSTALL_DIR)/koreader/plugins/$$d ; done
|
2016-01-31 22:24:26 +00:00
|
|
|
@echo "[*] Installresources"
|
2016-04-14 17:18:19 +00:00
|
|
|
$(RCP) -pL resources/fonts/* $(INSTALL_DIR)/koreader/fonts/
|
2016-01-03 06:28:24 +00:00
|
|
|
install -d $(INSTALL_DIR)/koreader/{screenshots,data/{dict,tessdata},fonts/host,ota}
|
2014-09-25 14:25:43 +00:00
|
|
|
ifeq ($(or $(EMULATE_READER),$(WIN32)),)
|
2016-01-31 22:24:26 +00:00
|
|
|
@echo "[*] Clean up, remove unused files for releases"
|
2013-08-07 18:40:00 +00:00
|
|
|
rm -rf $(INSTALL_DIR)/koreader/data/{cr3.ini,cr3skin-format.txt,desktop,devices,manual}
|
2015-09-04 21:11:25 +00:00
|
|
|
rm -rf $(INSTALL_DIR)/koreader/fonts/droid/DroidSansFallbackFull.ttf
|
2014-01-01 21:07:28 +00:00
|
|
|
endif
|
2013-08-07 18:40:00 +00:00
|
|
|
|
2013-08-15 13:55:50 +00:00
|
|
|
$(KOR_BASE)/$(OUTPUT_DIR)/luajit:
|
2013-08-07 18:40:00 +00:00
|
|
|
$(MAKE) -C $(KOR_BASE)
|
2011-12-02 22:10:59 +00:00
|
|
|
|
2016-02-04 04:23:46 +00:00
|
|
|
$(INSTALL_DIR)/koreader/.busted: .busted
|
|
|
|
ln -sf ../../.busted $(INSTALL_DIR)/koreader
|
2014-05-15 08:07:38 +00:00
|
|
|
|
2014-10-06 13:31:04 +00:00
|
|
|
$(INSTALL_DIR)/koreader/.luacov:
|
|
|
|
test -e $(INSTALL_DIR)/koreader/.luacov || \
|
|
|
|
ln -sf ../../.luacov $(INSTALL_DIR)/koreader
|
|
|
|
|
2014-05-15 08:07:38 +00:00
|
|
|
testfront: $(INSTALL_DIR)/koreader/.busted
|
2016-08-12 06:05:18 +00:00
|
|
|
# sdr files may have unexpected impact on unit testing
|
2016-08-14 16:32:23 +00:00
|
|
|
-rm -rf spec/unit/data/*.sdr
|
2016-04-19 06:54:09 +00:00
|
|
|
cd $(INSTALL_DIR)/koreader && ./luajit $(shell which busted) \
|
2016-08-12 06:05:18 +00:00
|
|
|
--sort-files \
|
2016-04-19 06:54:09 +00:00
|
|
|
--no-auto-insulate \
|
2017-10-11 06:38:30 +00:00
|
|
|
--output=gtest \
|
|
|
|
--exclude-tags=notest $(BUSTED_OVERRIDES) $(BUSTED_SPEC_FILE)
|
2014-05-15 08:07:38 +00:00
|
|
|
|
2016-10-01 08:07:31 +00:00
|
|
|
test: $(INSTALL_DIR)/koreader/.busted
|
2014-03-25 14:26:36 +00:00
|
|
|
$(MAKE) -C $(KOR_BASE) test
|
2014-05-15 08:07:38 +00:00
|
|
|
$(MAKE) testfront
|
2014-03-25 14:26:36 +00:00
|
|
|
|
2014-10-06 13:31:04 +00:00
|
|
|
coverage: $(INSTALL_DIR)/koreader/.luacov
|
2016-08-14 16:32:23 +00:00
|
|
|
-rm -rf $(INSTALL_DIR)/koreader/luacov.*.out
|
2016-04-21 06:56:38 +00:00
|
|
|
cd $(INSTALL_DIR)/koreader && \
|
2017-10-11 07:08:18 +00:00
|
|
|
./luajit $(shell which busted) --output=gtest \
|
2016-08-14 16:32:23 +00:00
|
|
|
--sort-files \
|
2016-04-21 06:56:38 +00:00
|
|
|
--no-auto-insulate \
|
|
|
|
--coverage --exclude-tags=nocov
|
2014-10-06 13:31:04 +00:00
|
|
|
# coverage report summary
|
|
|
|
cd $(INSTALL_DIR)/koreader && tail -n \
|
2017-02-02 11:13:13 +00:00
|
|
|
+$$(($$(grep -nm1 -e "^Summary$$" luacov.report.out|cut -d: -f1)-1)) \
|
2014-10-06 13:31:04 +00:00
|
|
|
luacov.report.out
|
|
|
|
|
2011-11-14 18:17:14 +00:00
|
|
|
fetchthirdparty:
|
2012-03-08 13:03:18 +00:00
|
|
|
git submodule init
|
2014-06-09 00:35:31 +00:00
|
|
|
git submodule sync
|
2012-03-07 16:19:52 +00:00
|
|
|
git submodule update
|
2013-08-07 18:40:00 +00:00
|
|
|
$(MAKE) -C $(KOR_BASE) fetchthirdparty
|
2011-11-14 18:17:14 +00:00
|
|
|
|
2014-10-25 23:57:31 +00:00
|
|
|
VERBOSE ?= @
|
|
|
|
Q = $(VERBOSE:1=)
|
2011-11-14 18:17:14 +00:00
|
|
|
clean:
|
2013-08-07 19:58:15 +00:00
|
|
|
rm -rf $(INSTALL_DIR)
|
2014-10-25 23:57:31 +00:00
|
|
|
$(Q:@=@echo 'MAKE -C base clean'; &> /dev/null) \
|
|
|
|
$(MAKE) -C $(KOR_BASE) clean
|
2016-10-02 04:42:00 +00:00
|
|
|
ifeq ($(TARGET), android)
|
|
|
|
$(MAKE) -C $(CURDIR)/platform/android/luajit-launcher clean
|
|
|
|
endif
|
2013-03-24 16:18:53 +00:00
|
|
|
|
2016-01-05 07:52:47 +00:00
|
|
|
dist-clean: clean
|
|
|
|
rm -rf $(INSTALL_DIR)
|
|
|
|
$(MAKE) -C $(KOR_BASE) dist-clean
|
2016-02-04 18:24:39 +00:00
|
|
|
$(MAKE) -C doc clean
|
2016-01-05 07:52:47 +00:00
|
|
|
|
2016-10-22 07:04:37 +00:00
|
|
|
ZIP_EXCLUDE=-x "*.swp" -x "*.swo" -x "*.orig" -x "*.un~"
|
2014-10-20 06:17:57 +00:00
|
|
|
# Don't bundle launchpad on touch devices..
|
|
|
|
ifeq ($(TARGET), kindle-legacy)
|
|
|
|
KINDLE_LEGACY_LAUNCHER:=launchpad
|
|
|
|
endif
|
2014-05-08 13:05:19 +00:00
|
|
|
kindleupdate: all
|
2012-10-24 10:24:05 +00:00
|
|
|
# ensure that the binaries were built for ARM
|
2013-08-07 18:40:00 +00:00
|
|
|
file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1
|
|
|
|
# remove old package if any
|
2016-10-10 08:12:53 +00:00
|
|
|
rm -f koreader-$(DIST)-$(MACHINE)-$(VERSION).zip
|
2014-05-08 13:05:19 +00:00
|
|
|
# Kindle launching scripts
|
2014-10-03 10:02:50 +00:00
|
|
|
ln -sf ../$(KINDLE_DIR)/extensions $(INSTALL_DIR)/
|
|
|
|
ln -sf ../$(KINDLE_DIR)/launchpad $(INSTALL_DIR)/
|
|
|
|
ln -sf ../../$(KINDLE_DIR)/koreader.sh $(INSTALL_DIR)/koreader
|
|
|
|
ln -sf ../../$(KINDLE_DIR)/libkohelper.sh $(INSTALL_DIR)/koreader
|
|
|
|
ln -sf ../../$(KINDLE_DIR)/kotar_cpoint $(INSTALL_DIR)/koreader
|
2013-08-07 18:40:00 +00:00
|
|
|
# create new package
|
2014-10-20 06:17:57 +00:00
|
|
|
cd $(INSTALL_DIR) && pwd && \
|
2013-08-07 18:40:00 +00:00
|
|
|
zip -9 -r \
|
2016-10-10 08:12:53 +00:00
|
|
|
../koreader-$(DIST)-$(MACHINE)-$(VERSION).zip \
|
2014-07-04 01:53:53 +00:00
|
|
|
extensions koreader $(KINDLE_LEGACY_LAUNCHER) \
|
2014-08-01 04:36:32 +00:00
|
|
|
-x "koreader/resources/fonts/*" "koreader/ota/*" \
|
2016-10-22 07:04:37 +00:00
|
|
|
"koreader/resources/icons/src/*" "koreader/spec/*" \
|
|
|
|
$(ZIP_EXCLUDE)
|
2014-08-01 04:36:32 +00:00
|
|
|
# generate kindleupdate package index file
|
2016-10-10 08:12:53 +00:00
|
|
|
zipinfo -1 koreader-$(DIST)-$(MACHINE)-$(VERSION).zip > \
|
2014-08-01 04:36:32 +00:00
|
|
|
$(INSTALL_DIR)/koreader/ota/package.index
|
|
|
|
echo "koreader/ota/package.index" >> $(INSTALL_DIR)/koreader/ota/package.index
|
|
|
|
# update index file in zip package
|
2016-10-10 08:12:53 +00:00
|
|
|
cd $(INSTALL_DIR) && zip -u ../koreader-$(DIST)-$(MACHINE)-$(VERSION).zip \
|
2014-08-01 04:36:32 +00:00
|
|
|
koreader/ota/package.index
|
|
|
|
# make gzip kindleupdate for zsync OTA update
|
2015-10-03 07:07:31 +00:00
|
|
|
# note that the targz file extension is intended to keep ISP from caching
|
|
|
|
# the file, see koreader#1644.
|
2014-08-01 04:36:32 +00:00
|
|
|
cd $(INSTALL_DIR) && \
|
2016-10-10 08:12:53 +00:00
|
|
|
tar czafh ../koreader-$(DIST)-$(MACHINE)-$(VERSION).targz \
|
2014-08-01 04:36:32 +00:00
|
|
|
-T koreader/ota/package.index --no-recursion
|
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
|
2013-08-15 13:55:50 +00:00
|
|
|
file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1
|
|
|
|
# remove old package if any
|
|
|
|
rm -f koreader-kobo-$(MACHINE)-$(VERSION).zip
|
2014-05-08 13:05:19 +00:00
|
|
|
# Kobo launching scripts
|
|
|
|
mkdir -p $(INSTALL_DIR)/kobo/mnt/onboard/.kobo
|
2014-10-03 10:02:50 +00:00
|
|
|
ln -sf ../../../../../$(KOBO_DIR)/fmon $(INSTALL_DIR)/kobo/mnt/onboard/.kobo/
|
2014-05-08 13:05:19 +00:00
|
|
|
cd $(INSTALL_DIR)/kobo && tar -czhf ../KoboRoot.tgz mnt
|
|
|
|
cp resources/koreader.png $(INSTALL_DIR)/koreader.png
|
2014-10-03 10:02:50 +00:00
|
|
|
cp $(KOBO_DIR)/fmon/README.txt $(INSTALL_DIR)/README_kobo.txt
|
2016-09-01 07:05:40 +00:00
|
|
|
cp $(KOBO_DIR)/*.sh $(INSTALL_DIR)/koreader
|
2013-08-15 13:55:50 +00:00
|
|
|
# create new package
|
|
|
|
cd $(INSTALL_DIR) && \
|
|
|
|
zip -9 -r \
|
|
|
|
../koreader-kobo-$(MACHINE)-$(VERSION).zip \
|
2014-08-19 07:55:17 +00:00
|
|
|
koreader -x "koreader/resources/fonts/*" \
|
2016-10-22 07:04:37 +00:00
|
|
|
"koreader/resources/icons/src/*" "koreader/spec/*" \
|
|
|
|
$(ZIP_EXCLUDE)
|
2014-08-01 04:36:32 +00:00
|
|
|
# generate koboupdate package index file
|
|
|
|
zipinfo -1 koreader-kobo-$(MACHINE)-$(VERSION).zip > \
|
|
|
|
$(INSTALL_DIR)/koreader/ota/package.index
|
|
|
|
echo "koreader/ota/package.index" >> $(INSTALL_DIR)/koreader/ota/package.index
|
|
|
|
# update index file in zip package
|
|
|
|
cd $(INSTALL_DIR) && zip -u ../koreader-kobo-$(MACHINE)-$(VERSION).zip \
|
2014-08-19 07:55:17 +00:00
|
|
|
koreader/ota/package.index KoboRoot.tgz koreader.png README_kobo.txt
|
2014-08-01 04:36:32 +00:00
|
|
|
# make gzip koboupdate for zsync OTA update
|
|
|
|
cd $(INSTALL_DIR) && \
|
2015-09-26 04:21:00 +00:00
|
|
|
tar czafh ../koreader-kobo-$(MACHINE)-$(VERSION).targz \
|
2014-08-01 04:36:32 +00:00
|
|
|
-T koreader/ota/package.index --no-recursion
|
2013-04-07 19:05:32 +00:00
|
|
|
|
2015-01-12 16:14:56 +00:00
|
|
|
pbupdate: 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-pocketbook-$(MACHINE)-$(VERSION).zip
|
|
|
|
# Pocketbook launching script
|
|
|
|
mkdir -p $(INSTALL_DIR)/applications
|
2015-01-17 01:09:36 +00:00
|
|
|
mkdir -p $(INSTALL_DIR)/system/bin
|
|
|
|
mkdir -p $(INSTALL_DIR)/system/config
|
|
|
|
|
2015-01-12 16:14:56 +00:00
|
|
|
cp $(POCKETBOOK_DIR)/koreader.app $(INSTALL_DIR)/applications
|
2015-01-17 01:09:36 +00:00
|
|
|
cp $(POCKETBOOK_DIR)/koreader.app $(INSTALL_DIR)/system/bin
|
|
|
|
cp $(POCKETBOOK_DIR)/extensions.cfg $(INSTALL_DIR)/system/config
|
|
|
|
cp -rfL $(INSTALL_DIR)/koreader $(INSTALL_DIR)/applications
|
2015-01-12 16:14:56 +00:00
|
|
|
# create new package
|
|
|
|
cd $(INSTALL_DIR) && \
|
|
|
|
zip -9 -r \
|
|
|
|
../koreader-pocketbook-$(MACHINE)-$(VERSION).zip \
|
2015-01-21 16:12:55 +00:00
|
|
|
applications -x "applications/koreader/resources/fonts/*" \
|
2016-10-22 07:04:37 +00:00
|
|
|
"applications/koreader/resources/icons/src/*" "applications/koreader/spec/*" \
|
|
|
|
$(ZIP_EXCLUDE)
|
2015-01-12 16:14:56 +00:00
|
|
|
# generate koboupdate package index file
|
|
|
|
zipinfo -1 koreader-pocketbook-$(MACHINE)-$(VERSION).zip > \
|
2015-01-17 01:09:36 +00:00
|
|
|
$(INSTALL_DIR)/applications/koreader/ota/package.index
|
|
|
|
echo "applications/koreader/ota/package.index" >> \
|
|
|
|
$(INSTALL_DIR)/applications/koreader/ota/package.index
|
2015-01-19 16:07:36 +00:00
|
|
|
# hack file path when running tar in parent directory of koreader
|
|
|
|
sed -i -e 's/^/..\//' \
|
|
|
|
$(INSTALL_DIR)/applications/koreader/ota/package.index
|
2015-01-12 16:14:56 +00:00
|
|
|
# update index file in zip package
|
2015-01-21 16:12:55 +00:00
|
|
|
cd $(INSTALL_DIR) && zip -ru ../koreader-pocketbook-$(MACHINE)-$(VERSION).zip \
|
|
|
|
applications/koreader/ota/package.index system
|
2015-01-12 16:14:56 +00:00
|
|
|
# make gzip pbupdate for zsync OTA update
|
2015-01-21 16:12:55 +00:00
|
|
|
cd $(INSTALL_DIR)/applications && \
|
2015-09-26 04:21:00 +00:00
|
|
|
tar czafh ../../koreader-pocketbook-$(MACHINE)-$(VERSION).targz \
|
2015-01-21 16:12:55 +00:00
|
|
|
-T koreader/ota/package.index --no-recursion
|
2015-01-12 16:14:56 +00:00
|
|
|
|
2015-10-03 06:18:47 +00:00
|
|
|
utupdate: 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-ubuntu-touch-$(MACHINE)-$(VERSION).click
|
|
|
|
|
|
|
|
ln -sf ../../$(UBUNTUTOUCH_DIR)/koreader.sh $(INSTALL_DIR)/koreader
|
|
|
|
ln -sf ../../$(UBUNTUTOUCH_DIR)/manifest.json $(INSTALL_DIR)/koreader
|
|
|
|
ln -sf ../../$(UBUNTUTOUCH_DIR)/koreader.apparmor $(INSTALL_DIR)/koreader
|
2015-10-06 14:15:38 +00:00
|
|
|
ln -sf ../../$(UBUNTUTOUCH_DIR)/koreader.apparmor.openstore $(INSTALL_DIR)/koreader
|
2015-10-03 06:18:47 +00:00
|
|
|
ln -sf ../../$(UBUNTUTOUCH_DIR)/koreader.desktop $(INSTALL_DIR)/koreader
|
|
|
|
ln -sf ../../$(UBUNTUTOUCH_DIR)/koreader.png $(INSTALL_DIR)/koreader
|
2016-07-05 14:15:52 +00:00
|
|
|
ln -sf ../../$(UBUNTUTOUCH_DIR)/libSDL2.so $(INSTALL_DIR)/koreader/libs
|
2015-10-03 06:18:47 +00:00
|
|
|
|
|
|
|
# create new package
|
|
|
|
cd $(INSTALL_DIR) && pwd && \
|
|
|
|
zip -9 -r \
|
|
|
|
../koreader-$(DIST)-$(MACHINE)-$(VERSION).zip \
|
|
|
|
koreader -x "koreader/resources/fonts/*" "koreader/ota/*" \
|
2016-10-22 07:04:37 +00:00
|
|
|
"koreader/resources/icons/src/*" "koreader/spec/*" \
|
|
|
|
$(ZIP_EXCLUDE)
|
2015-10-03 06:18:47 +00:00
|
|
|
|
|
|
|
# generate update package index file
|
|
|
|
zipinfo -1 koreader-$(DIST)-$(MACHINE)-$(VERSION).zip > \
|
|
|
|
$(INSTALL_DIR)/koreader/ota/package.index
|
|
|
|
echo "koreader/ota/package.index" >> $(INSTALL_DIR)/koreader/ota/package.index
|
|
|
|
# update index file in zip package
|
|
|
|
cd $(INSTALL_DIR) && zip -u ../koreader-$(DIST)-$(MACHINE)-$(VERSION).zip \
|
|
|
|
koreader/ota/package.index
|
|
|
|
# make gzip update for zsync OTA update
|
|
|
|
cd $(INSTALL_DIR) && \
|
|
|
|
tar czafh ../koreader-$(DIST)-$(MACHINE)-$(VERSION).targz \
|
|
|
|
-T koreader/ota/package.index --no-recursion
|
|
|
|
|
|
|
|
# generate ubuntu touch click package
|
|
|
|
rm -rf $(INSTALL_DIR)/tmp && mkdir -p $(INSTALL_DIR)/tmp
|
|
|
|
cd $(INSTALL_DIR)/tmp && \
|
|
|
|
unzip ../../koreader-$(DIST)-$(MACHINE)-$(VERSION).zip && \
|
|
|
|
click build koreader && \
|
|
|
|
mv *.click ../../koreader-$(DIST)-$(MACHINE)-$(VERSION).click
|
|
|
|
|
|
|
|
|
2014-05-26 15:38:51 +00:00
|
|
|
androidupdate: all
|
|
|
|
mkdir -p $(ANDROID_LAUNCHER_DIR)/assets/module
|
|
|
|
-rm $(ANDROID_LAUNCHER_DIR)/assets/module/koreader-*
|
2017-09-23 21:58:34 +00:00
|
|
|
# in runtime luajit-launcher's libluajit.so will be loaded
|
|
|
|
-rm $(INSTALL_DIR)/koreader/libs/libluajit.so
|
2016-03-13 15:42:58 +00:00
|
|
|
# create zip package
|
|
|
|
cd $(INSTALL_DIR)/koreader && \
|
|
|
|
zip -9 -r \
|
|
|
|
../../koreader-android-$(MACHINE)-$(VERSION).zip \
|
2016-10-22 07:04:37 +00:00
|
|
|
* -x "resources/fonts/*" "resources/icons/src/*" "spec/*" \
|
|
|
|
$(ZIP_EXCLUDE)
|
2016-03-13 15:42:58 +00:00
|
|
|
# generate android update package index file
|
|
|
|
zipinfo -1 koreader-android-$(MACHINE)-$(VERSION).zip > \
|
|
|
|
$(INSTALL_DIR)/koreader/ota/package.index
|
|
|
|
rm -f koreader-android-$(MACHINE)-$(VERSION).zip
|
|
|
|
echo "ota/package.index" >> $(INSTALL_DIR)/koreader/ota/package.index
|
|
|
|
cp $(INSTALL_DIR)/koreader/git-rev $(INSTALL_DIR)/koreader/ota-rev
|
2016-03-15 12:43:12 +00:00
|
|
|
# don't update the git-rev so that the next start won't revert back
|
|
|
|
# the older 7z version in the assets
|
2017-11-27 18:23:54 +00:00
|
|
|
$(ISED) '/git-rev/d' $(INSTALL_DIR)/koreader/ota/package.index
|
2016-03-13 15:42:58 +00:00
|
|
|
# make gzip android update for zsync OTA update
|
2017-11-27 18:23:54 +00:00
|
|
|
-cd $(INSTALL_DIR)/koreader && \
|
2016-03-13 15:42:58 +00:00
|
|
|
tar czafh ../../koreader-android-$(MACHINE)-$(VERSION).targz \
|
|
|
|
-T ota/package.index --no-recursion
|
|
|
|
# make android update apk
|
2014-05-29 08:04:00 +00:00
|
|
|
cd $(INSTALL_DIR)/koreader && 7z a -l -mx=1 \
|
|
|
|
../../$(ANDROID_LAUNCHER_DIR)/assets/module/koreader-g$(REVISION).7z * \
|
|
|
|
-x!resources/fonts -x!resources/icons/src -x!spec
|
2014-05-29 13:09:22 +00:00
|
|
|
$(MAKE) -C $(ANDROID_LAUNCHER_DIR) apk
|
|
|
|
cp $(ANDROID_LAUNCHER_DIR)/bin/NativeActivity-debug.apk \
|
|
|
|
koreader-android-$(MACHINE)-$(VERSION).apk
|
2014-05-26 15:38:51 +00:00
|
|
|
|
2015-10-03 06:18:47 +00:00
|
|
|
update:
|
|
|
|
ifeq ($(TARGET), kindle)
|
|
|
|
make kindleupdate
|
2016-02-01 06:43:46 +00:00
|
|
|
else ifeq ($(TARGET), kindle-legacy)
|
|
|
|
make kindleupdate
|
2015-10-03 06:18:47 +00:00
|
|
|
else ifeq ($(TARGET), kobo)
|
|
|
|
make koboupdate
|
|
|
|
else ifeq ($(TARGET), pocketbook)
|
|
|
|
make pbupdate
|
|
|
|
else ifeq ($(TARGET), ubuntu-touch)
|
|
|
|
make utupdate
|
|
|
|
else ifeq ($(TARGET), android)
|
|
|
|
make androidupdate
|
|
|
|
endif
|
|
|
|
|
2014-05-26 15:38:51 +00:00
|
|
|
androiddev: androidupdate
|
|
|
|
$(MAKE) -C $(ANDROID_LAUNCHER_DIR) dev
|
2014-05-25 08:18:55 +00:00
|
|
|
|
2014-05-29 13:09:22 +00:00
|
|
|
android-toolchain:
|
|
|
|
$(MAKE) -C $(KOR_BASE) android-toolchain
|
|
|
|
|
2015-01-17 16:17:17 +00:00
|
|
|
pocketbook-toolchain:
|
|
|
|
$(MAKE) -C $(KOR_BASE) pocketbook-toolchain
|
|
|
|
|
2017-05-08 09:37:29 +00:00
|
|
|
|
|
|
|
# for gettext
|
|
|
|
DOMAIN=koreader
|
|
|
|
TEMPLATE_DIR=l10n/templates
|
|
|
|
KOREADER_MISC_TOOL=../koreader-misc
|
|
|
|
XGETTEXT_BIN=$(KOREADER_MISC_TOOL)/gettext/lua_xgettext.py
|
|
|
|
|
2013-04-07 19:05:32 +00:00
|
|
|
pot:
|
2014-08-26 06:27:38 +00:00
|
|
|
mkdir -p $(TEMPLATE_DIR)
|
2013-04-07 19:05:32 +00:00
|
|
|
$(XGETTEXT_BIN) reader.lua `find frontend -iname "*.lua"` \
|
2014-04-23 15:02:45 +00:00
|
|
|
`find plugins -iname "*.lua"` \
|
2016-08-11 11:29:09 +00:00
|
|
|
`find tools -iname "*.lua"` \
|
2013-04-07 19:05:32 +00:00
|
|
|
> $(TEMPLATE_DIR)/$(DOMAIN).pot
|
2014-08-26 01:59:24 +00:00
|
|
|
# push source file to Transifex
|
2017-05-08 09:37:29 +00:00
|
|
|
$(MAKE) -i -C l10n bootstrap
|
|
|
|
$(MAKE) -C l10n push
|
2013-04-07 19:05:32 +00:00
|
|
|
|
2013-11-29 14:41:56 +00:00
|
|
|
po:
|
2017-05-08 09:37:29 +00:00
|
|
|
$(MAKE) -i -C l10n bootstrap
|
|
|
|
$(MAKE) -C l10n pull
|
|
|
|
|
2014-10-25 23:57:31 +00:00
|
|
|
|
2015-04-27 00:43:32 +00:00
|
|
|
static-check:
|
2016-03-29 07:56:29 +00:00
|
|
|
@if which luacheck > /dev/null; then \
|
2016-11-13 07:44:06 +00:00
|
|
|
luacheck -q {reader,setupkoenv,datastorage}.lua frontend plugins; \
|
2016-03-29 07:56:29 +00:00
|
|
|
else \
|
|
|
|
echo "[!] luacheck not found. "\
|
|
|
|
"you can install it with 'luarocks install luacheck'"; \
|
|
|
|
fi
|
2015-04-27 00:43:32 +00:00
|
|
|
|
2016-02-04 18:24:39 +00:00
|
|
|
doc:
|
|
|
|
make -C doc
|
|
|
|
|
|
|
|
.PHONY: test doc
|