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
|
|
|
|
|
2018-10-31 22:34:11 +00:00
|
|
|
# We want VERSION to carry the version of the KOReader main repo, not that of koreader-base
|
2018-03-07 18:26:56 +00:00
|
|
|
VERSION:=$(shell git describe HEAD)
|
2018-10-31 22:34:11 +00:00
|
|
|
# Only append date if we're not on a whole version, like v2018.11
|
|
|
|
ifneq (,$(findstring -,$(VERSION)))
|
|
|
|
VERSION:=$(VERSION)_$(shell git describe HEAD | xargs git show -s --format=format:"%cd" --date=short)
|
|
|
|
endif
|
2013-03-24 14:08:42 +00:00
|
|
|
|
2020-05-14 12:26:00 +00:00
|
|
|
# releases do not contain tests and misc data
|
|
|
|
IS_RELEASE := $(if $(or $(EMULATE_READER),$(WIN32)),,1)
|
2020-07-10 14:05:54 +00:00
|
|
|
IS_RELEASE := $(if $(or $(IS_RELEASE),$(APPIMAGE),$(DEBIAN),$(MACOS)),1,)
|
2020-05-14 12:26:00 +00:00
|
|
|
|
2019-08-26 18:29:08 +00:00
|
|
|
ANDROID_ARCH?=arm
|
2019-02-03 19:19:52 +00:00
|
|
|
# Use the git commit count as the (integer) Android version code
|
2019-02-04 12:52:20 +00:00
|
|
|
ANDROID_VERSION?=$(shell git rev-list --count HEAD)
|
2019-02-03 19:19:52 +00:00
|
|
|
ANDROID_NAME?=$(VERSION)
|
|
|
|
|
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
|
|
|
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
|
2019-08-26 18:29:08 +00:00
|
|
|
KODEDUG_SUFFIX:=-debug
|
2017-10-27 18:36:36 +00:00
|
|
|
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
|
2018-09-05 23:35:48 +00:00
|
|
|
COMMON_DIR=$(PLATFORM_DIR)/common
|
2018-10-31 22:48:36 +00:00
|
|
|
ANDROID_DIR=$(PLATFORM_DIR)/android
|
|
|
|
ANDROID_LAUNCHER_DIR:=$(ANDROID_DIR)/luajit-launcher
|
|
|
|
APPIMAGE_DIR=$(PLATFORM_DIR)/appimage
|
|
|
|
CERVANTES_DIR=$(PLATFORM_DIR)/cervantes
|
2019-01-03 17:21:35 +00:00
|
|
|
DEBIAN_DIR=$(PLATFORM_DIR)/debian
|
2014-10-03 10:02:50 +00:00
|
|
|
KINDLE_DIR=$(PLATFORM_DIR)/kindle
|
|
|
|
KOBO_DIR=$(PLATFORM_DIR)/kobo
|
2020-07-10 14:05:54 +00:00
|
|
|
MACOS_DIR=$(PLATFORM_DIR)/mac
|
2015-01-12 16:14:56 +00:00
|
|
|
POCKETBOOK_DIR=$(PLATFORM_DIR)/pocketbook
|
2020-02-08 00:58:10 +00:00
|
|
|
REMARKABLE_DIR=$(PLATFORM_DIR)/remarkable
|
2018-10-31 22:48:36 +00:00
|
|
|
SONY_PRSTUX_DIR=$(PLATFORM_DIR)/sony-prstux
|
2015-10-03 06:18:47 +00:00
|
|
|
UBUNTUTOUCH_DIR=$(PLATFORM_DIR)/ubuntu-touch
|
|
|
|
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
|
|
|
|
2018-04-08 20:39:52 +00:00
|
|
|
# appimage setup
|
|
|
|
APPIMAGETOOL=appimagetool-x86_64.AppImage
|
2019-08-27 12:31:59 +00:00
|
|
|
APPIMAGETOOL_URL=https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage
|
2018-04-08 20:39:52 +00:00
|
|
|
|
2018-04-09 21:17:06 +00:00
|
|
|
# set to 1 if in Docker
|
2018-12-18 10:31:31 +00:00
|
|
|
DOCKER:=$(shell grep -q docker /proc/1/cgroup 2>/dev/null && echo 1)
|
2018-04-09 21:17:06 +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
|
|
|
|
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
|
2019-04-02 16:28:46 +00:00
|
|
|
ifdef ANDROID
|
|
|
|
rm -f android-fdroid-version; echo -e "$(ANDROID_NAME)\n$(ANDROID_VERSION)" > koreader-android-fdroid-latest
|
|
|
|
endif
|
2020-05-14 12:26:00 +00:00
|
|
|
ifeq ($(IS_RELEASE),1)
|
|
|
|
$(RCP) -fL $(KOR_BASE)/$(OUTPUT_DIR)/. $(INSTALL_DIR)/koreader/.
|
|
|
|
else
|
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 && \
|
2020-07-09 06:39:36 +00:00
|
|
|
bash -O extglob -c "ln -sf ../../$(KOR_BASE)/$(OUTPUT_DIR)/!(cache) ."
|
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
|
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 .
|
2020-06-19 19:23:47 +00:00
|
|
|
@echo "[*] Install afterupdate marker"
|
|
|
|
@echo "# If this file is here, there are no afterupdate scripts in /sdcard/koreader/scripts/afterupdate." > $(INSTALL_DIR)/koreader/afterupdate.marker
|
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?
|
2018-07-07 15:06:58 +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
|
2020-06-19 19:23:47 +00:00
|
|
|
@echo "[*] Install resources"
|
2018-07-07 15:06:58 +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}
|
2020-05-14 12:26:00 +00:00
|
|
|
ifeq ($(IS_RELEASE),1)
|
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}
|
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 \
|
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
|
|
|
--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
|
|
|
|
2019-08-27 13:22:34 +00:00
|
|
|
KINDLE_PACKAGE:=koreader-$(DIST)$(KODEDUG_SUFFIX)-$(VERSION).zip
|
|
|
|
KINDLE_PACKAGE_OTA:=koreader-$(DIST)$(KODEDUG_SUFFIX)-$(VERSION).targz
|
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
|
2019-08-27 13:22:34 +00:00
|
|
|
rm -f $(KINDLE_PACKAGE)
|
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
|
2019-12-31 16:07:33 +00:00
|
|
|
ln -sf ../../../../../$(KINDLE_DIR)/libkohelper.sh $(INSTALL_DIR)/extensions/koreader/bin
|
2018-09-05 23:35:48 +00:00
|
|
|
ln -sf ../../$(COMMON_DIR)/spinning_zsync $(INSTALL_DIR)/koreader
|
2020-03-15 00:28:37 +00:00
|
|
|
ln -sf ../../$(KINDLE_DIR)/wmctrl $(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 \
|
2019-08-27 13:22:34 +00:00
|
|
|
../$(KINDLE_PACKAGE) \
|
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
|
2019-08-27 13:22:34 +00:00
|
|
|
zipinfo -1 $(KINDLE_PACKAGE) > \
|
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
|
2019-08-27 13:22:34 +00:00
|
|
|
cd $(INSTALL_DIR) && zip -u ../$(KINDLE_PACKAGE) \
|
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) && \
|
2020-01-11 03:05:14 +00:00
|
|
|
tar --hard-dereference -I"gzip --rsyncable" -cah --no-recursion -f ../$(KINDLE_PACKAGE_OTA) \
|
2018-04-19 19:08:55 +00:00
|
|
|
-T koreader/ota/package.index
|
2013-03-24 21:04:32 +00:00
|
|
|
|
2019-08-27 13:22:34 +00:00
|
|
|
KOBO_PACKAGE:=koreader-kobo$(KODEDUG_SUFFIX)-$(VERSION).zip
|
|
|
|
KOBO_PACKAGE_OTA:=koreader-kobo$(KODEDUG_SUFFIX)-$(VERSION).targz
|
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
|
2019-08-27 13:22:34 +00:00
|
|
|
rm -f $(KOBO_PACKAGE)
|
2014-05-08 13:05:19 +00:00
|
|
|
# Kobo launching scripts
|
2018-04-17 22:32:40 +00:00
|
|
|
cp $(KOBO_DIR)/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
|
2018-09-05 23:35:48 +00:00
|
|
|
cp $(COMMON_DIR)/spinning_zsync $(INSTALL_DIR)/koreader
|
2013-08-15 13:55:50 +00:00
|
|
|
# create new package
|
|
|
|
cd $(INSTALL_DIR) && \
|
|
|
|
zip -9 -r \
|
2019-08-27 13:22:34 +00:00
|
|
|
../$(KOBO_PACKAGE) \
|
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
|
2019-08-27 13:22:34 +00:00
|
|
|
zipinfo -1 $(KOBO_PACKAGE) > \
|
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
|
2019-08-27 13:22:34 +00:00
|
|
|
cd $(INSTALL_DIR) && zip -u ../$(KOBO_PACKAGE) \
|
[chore] A round of Kobo specific script cleanup (#3876)
* Flag those scripts as executable in git
Somewhat irrelevant because we'll end up living on a FAT32 drive, but,
still.
* Cleanup Kobo startup script
Support KFMon >= 0.9.5
Don't siphon PRODUCT from nickel, it's exported by rcS, so fmon/KFMon
already inherit it.
Siphon NICKEL_HOME, on the off-chance nickel fails to figure that one
out for itself on restart.
Siphon LANG (This may be a terrible idea, rcS sets LANG to en_US.UTF-8,
while we set LC_ALL to en_US.UTF-8, but I don't know if nickel itself
ever updates LANG, since I have mine set to en_US also ;)).
My secret hope if that everything's working as it should and this ensures
we default to Nickel's locale on fresh installs?
Remove the extra sync on startup, both @Baskerville's fmon and KFMon are
smart enough not to do anything overly stupid, and recent FW versions
have a slightly more resilient DB anyway (rollback journal -> WAL).
This effectively shaves over a second off our startup time.
* Slimmed down the nickel restart script.
Based on current rcS
Scrapped a bucketload of irrelevant & legacy crap, since we're never
bootstrapping nickel, only restarting it.
* Update Kobo install instrcutions.
Point to KSM09, @Baskerville's fmon, and KFMon.
Deprecate legacy fmon, and as such, stop shipping a useless KoboRoot
tarball.
2018-04-15 13:05:45 +00:00
|
|
|
koreader/ota/package.index koreader.png README_kobo.txt
|
2014-08-01 04:36:32 +00:00
|
|
|
# make gzip koboupdate for zsync OTA update
|
|
|
|
cd $(INSTALL_DIR) && \
|
2020-01-11 03:05:14 +00:00
|
|
|
tar --hard-dereference -I"gzip --rsyncable" -cah --no-recursion -f ../$(KOBO_PACKAGE_OTA) \
|
2018-04-19 19:08:55 +00:00
|
|
|
-T koreader/ota/package.index
|
2013-04-07 19:05:32 +00:00
|
|
|
|
2019-08-27 13:22:34 +00:00
|
|
|
PB_PACKAGE:=koreader-pocketbook$(KODEDUG_SUFFIX)-$(VERSION).zip
|
|
|
|
PB_PACKAGE_OTA:=koreader-pocketbook$(KODEDUG_SUFFIX)-$(VERSION).targz
|
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
|
2019-08-27 13:22:34 +00:00
|
|
|
rm -f $(PB_PACKAGE)
|
2020-09-12 08:47:35 +00:00
|
|
|
# Pocketbook launching scripts
|
2015-01-12 16:14:56 +00:00
|
|
|
mkdir -p $(INSTALL_DIR)/applications
|
2015-01-17 01:09:36 +00:00
|
|
|
mkdir -p $(INSTALL_DIR)/system/bin
|
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
|
2020-09-27 21:15:48 +00:00
|
|
|
cp $(COMMON_DIR)/spinning_zsync $(INSTALL_DIR)/koreader
|
2015-01-17 01:09:36 +00:00
|
|
|
cp -rfL $(INSTALL_DIR)/koreader $(INSTALL_DIR)/applications
|
2020-09-12 08:47:35 +00:00
|
|
|
find $(INSTALL_DIR)/applications/koreader \
|
|
|
|
-type f \( -name "*.gif" -o -name "*.html" -o -name "*.md" -o -name "*.txt" \) \
|
|
|
|
-exec rm -vf {} \;
|
2015-01-12 16:14:56 +00:00
|
|
|
# create new package
|
|
|
|
cd $(INSTALL_DIR) && \
|
|
|
|
zip -9 -r \
|
2019-08-27 13:22:34 +00:00
|
|
|
../$(PB_PACKAGE) \
|
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
|
2019-08-27 13:22:34 +00:00
|
|
|
zipinfo -1 $(PB_PACKAGE) > \
|
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
|
2019-08-27 13:22:34 +00:00
|
|
|
cd $(INSTALL_DIR) && zip -ru ../$(PB_PACKAGE) \
|
2015-01-21 16:12:55 +00:00
|
|
|
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 && \
|
2020-01-11 03:05:14 +00:00
|
|
|
tar --hard-dereference -I"gzip --rsyncable" -cah --no-recursion -f ../../$(PB_PACKAGE_OTA) \
|
2018-04-19 19:08:55 +00:00
|
|
|
-T koreader/ota/package.index
|
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
|
2019-04-19 20:14:59 +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 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
|
|
|
|
|
2018-04-08 20:39:52 +00:00
|
|
|
appimageupdate: all
|
|
|
|
# remove old package if any
|
|
|
|
rm -f koreader-appimage-$(MACHINE)-$(VERSION).appimage
|
|
|
|
|
|
|
|
ln -sf ../../$(APPIMAGE_DIR)/AppRun $(INSTALL_DIR)/koreader
|
|
|
|
ln -sf ../../$(APPIMAGE_DIR)/koreader.appdata.xml $(INSTALL_DIR)/koreader
|
|
|
|
ln -sf ../../$(APPIMAGE_DIR)/koreader.desktop $(INSTALL_DIR)/koreader
|
2018-04-15 21:39:42 +00:00
|
|
|
ln -sf ../../resources/koreader.png $(INSTALL_DIR)/koreader
|
2018-04-08 20:39:52 +00:00
|
|
|
# TODO at best this is DebUbuntu specific
|
2018-04-18 14:21:53 +00:00
|
|
|
ln -sf /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 $(INSTALL_DIR)/koreader/libs/libSDL2.so
|
2019-01-17 14:28:18 +00:00
|
|
|
# required for our stock Ubuntu SDL even though we don't use sound
|
2019-01-17 15:04:34 +00:00
|
|
|
# the readlink is a half-hearted attempt at being generic; the echo libsndio.so.6.1 is specific to the nightly builds
|
|
|
|
ln -sf /usr/lib/x86_64-linux-gnu/$(shell readlink /usr/lib/x86_64-linux-gnu/libsndio.so || echo libsndio.so.6.1) $(INSTALL_DIR)/koreader/libs/
|
2019-02-21 19:14:20 +00:00
|
|
|
# also copy libbsd.so.0, cf. https://github.com/koreader/koreader/issues/4627
|
|
|
|
ln -sf /lib/x86_64-linux-gnu/libbsd.so.0 $(INSTALL_DIR)/koreader/libs/
|
2018-04-08 20:39:52 +00:00
|
|
|
ifeq ("$(wildcard $(APPIMAGETOOL))","")
|
|
|
|
# download appimagetool
|
|
|
|
wget "$(APPIMAGETOOL_URL)"
|
|
|
|
chmod a+x "$(APPIMAGETOOL)"
|
2018-04-09 21:17:06 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(DOCKER), 1)
|
|
|
|
# remove previously extracted appimagetool, if any
|
|
|
|
rm -rf squashfs-root
|
|
|
|
./$(APPIMAGETOOL) --appimage-extract
|
2018-04-08 20:39:52 +00:00
|
|
|
endif
|
|
|
|
cd $(INSTALL_DIR) && pwd && \
|
|
|
|
rm -rf tmp && mkdir -p tmp && \
|
|
|
|
cp -Lr koreader tmp && \
|
|
|
|
rm -rf tmp/koreader/ota && \
|
|
|
|
rm -rf tmp/koreader/resources/icons/src && \
|
|
|
|
rm -rf tmp/koreader/spec
|
|
|
|
|
|
|
|
# generate AppImage
|
|
|
|
cd $(INSTALL_DIR)/tmp && \
|
2018-04-09 21:17:06 +00:00
|
|
|
ARCH=x86_64 ../../$(if $(DOCKER),squashfs-root/AppRun,$(APPIMAGETOOL)) koreader && \
|
2018-04-08 20:39:52 +00:00
|
|
|
mv *.AppImage ../../koreader-$(DIST)-$(MACHINE)-$(VERSION).AppImage
|
2015-10-03 06:18:47 +00:00
|
|
|
|
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
|
2019-08-29 19:59:00 +00:00
|
|
|
|
2019-08-24 08:22:16 +00:00
|
|
|
# assets are compressed manually and stored inside the APK.
|
2020-08-29 14:38:29 +00:00
|
|
|
cd $(INSTALL_DIR)/koreader && 7z a -l -mx=9 -mfb=256 -mmt=on \
|
2019-08-29 19:59:00 +00:00
|
|
|
../../$(ANDROID_LAUNCHER_DIR)/assets/module/koreader-$(VERSION).zip * \
|
2020-08-29 14:38:29 +00:00
|
|
|
-xr!*resources/fonts* \
|
|
|
|
-xr!*resources/icons/src* \
|
|
|
|
-xr!*share/man* \
|
|
|
|
-xr!*spec$ \
|
|
|
|
-xr!*COPYING$ \
|
|
|
|
-xr!*README.md$ \
|
|
|
|
-xr!git$ \
|
|
|
|
-xr!gitiginore$
|
2019-08-29 19:59:00 +00:00
|
|
|
|
|
|
|
# make the android APK
|
|
|
|
$(MAKE) -C $(ANDROID_LAUNCHER_DIR) $(if $(KODEBUG), debug, release) \
|
|
|
|
ANDROID_APPNAME=KOReader \
|
|
|
|
ANDROID_VERSION=$(ANDROID_VERSION) \
|
|
|
|
ANDROID_NAME=$(ANDROID_NAME) \
|
|
|
|
ANDROID_FLAVOR=$(ANDROID_FLAVOR)
|
|
|
|
|
2019-01-31 16:34:13 +00:00
|
|
|
cp $(ANDROID_LAUNCHER_DIR)/bin/NativeActivity.apk \
|
2019-08-26 18:29:08 +00:00
|
|
|
koreader-android-$(ANDROID_ARCH)$(KODEDUG_SUFFIX)-$(VERSION).apk
|
2014-05-26 15:38:51 +00:00
|
|
|
|
2019-01-03 17:21:35 +00:00
|
|
|
debianupdate: all
|
2020-05-14 12:26:00 +00:00
|
|
|
mkdir -pv \
|
|
|
|
$(INSTALL_DIR)/debian/usr/bin \
|
|
|
|
$(INSTALL_DIR)/debian/usr/lib \
|
|
|
|
$(INSTALL_DIR)/debian/usr/share/pixmaps \
|
|
|
|
$(INSTALL_DIR)/debian/usr/share/applications \
|
|
|
|
$(INSTALL_DIR)/debian/usr/share/doc/koreader \
|
|
|
|
$(INSTALL_DIR)/debian/usr/share/man/man1
|
|
|
|
|
|
|
|
cp -pv resources/koreader.png $(INSTALL_DIR)/debian/usr/share/pixmaps
|
|
|
|
cp -pv $(DEBIAN_DIR)/koreader.desktop $(INSTALL_DIR)/debian/usr/share/applications
|
|
|
|
cp -pv $(DEBIAN_DIR)/copyright COPYING $(INSTALL_DIR)/debian/usr/share/doc/koreader
|
|
|
|
cp -pv $(DEBIAN_DIR)/koreader.sh $(INSTALL_DIR)/debian/usr/bin/koreader
|
|
|
|
cp -Lr $(INSTALL_DIR)/koreader $(INSTALL_DIR)/debian/usr/lib
|
2019-01-03 17:21:35 +00:00
|
|
|
|
2020-05-14 12:26:00 +00:00
|
|
|
gzip -cn9 $(DEBIAN_DIR)/changelog > $(INSTALL_DIR)/debian/usr/share/doc/koreader/changelog.Debian.gz
|
|
|
|
gzip -cn9 $(DEBIAN_DIR)/koreader.1 > $(INSTALL_DIR)/debian/usr/share/man/man1/koreader.1.gz
|
2019-01-03 17:21:35 +00:00
|
|
|
|
2020-05-14 12:26:00 +00:00
|
|
|
chmod 644 \
|
|
|
|
$(INSTALL_DIR)/debian/usr/share/doc/koreader/changelog.Debian.gz \
|
|
|
|
$(INSTALL_DIR)/debian/usr/share/doc/koreader/copyright \
|
|
|
|
$(INSTALL_DIR)/debian/usr/share/man/man1/koreader.1.gz
|
2019-01-03 17:21:35 +00:00
|
|
|
|
2020-05-14 12:26:00 +00:00
|
|
|
rm -rf \
|
|
|
|
$(INSTALL_DIR)/debian/usr/lib/koreader/{ota,cache,clipboard,screenshots,spec,tools,resources/fonts,resources/icons/src}
|
2019-01-03 17:21:35 +00:00
|
|
|
|
2020-07-10 14:05:54 +00:00
|
|
|
macosupdate: all
|
|
|
|
mkdir -p \
|
|
|
|
$(INSTALL_DIR)/bundle/Contents/MacOS \
|
|
|
|
$(INSTALL_DIR)/bundle/Contents/Resources
|
|
|
|
|
|
|
|
cp resources/koreader.icns $(INSTALL_DIR)/bundle/Contents/Resources/icon.icns
|
2020-07-17 19:17:15 +00:00
|
|
|
cp -LR $(INSTALL_DIR)/koreader $(INSTALL_DIR)/bundle/Contents
|
2020-08-04 22:17:09 +00:00
|
|
|
cp -pRv $(MACOS_DIR)/menu.xml $(INSTALL_DIR)/bundle/Contents/MainMenu.xib
|
|
|
|
ibtool --compile "$(INSTALL_DIR)/bundle/Contents/Resources/Base.lproj/MainMenu.nib" "$(INSTALL_DIR)/bundle/Contents/MainMenu.xib"
|
|
|
|
rm -rfv "$(INSTALL_DIR)/bundle/Contents/MainMenu.xib"
|
2020-07-10 14:05:54 +00:00
|
|
|
|
2020-02-08 00:58:10 +00:00
|
|
|
REMARKABLE_PACKAGE:=koreader-remarkable$(KODEDUG_SUFFIX)-$(VERSION).zip
|
|
|
|
REMARKABLE_PACKAGE_OTA:=koreader-remarkable$(KODEDUG_SUFFIX)-$(VERSION).targz
|
|
|
|
remarkableupdate: 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 $(REMARKABLE_PACKAGE)
|
|
|
|
# Remarkable scripts
|
|
|
|
cp $(REMARKABLE_DIR)/* $(INSTALL_DIR)/koreader
|
|
|
|
cp $(COMMON_DIR)/spinning_zsync $(INSTALL_DIR)/koreader
|
|
|
|
# create new package
|
|
|
|
cd $(INSTALL_DIR) && \
|
|
|
|
zip -9 -r \
|
|
|
|
../$(REMARKABLE_PACKAGE) \
|
|
|
|
koreader -x "koreader/resources/fonts/*" \
|
|
|
|
"koreader/resources/icons/src/*" "koreader/spec/*" \
|
|
|
|
$(ZIP_EXCLUDE)
|
|
|
|
# generate update package index file
|
|
|
|
zipinfo -1 $(REMARKABLE_PACKAGE) > \
|
|
|
|
$(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 ../$(REMARKABLE_PACKAGE) \
|
|
|
|
koreader/ota/package.index
|
|
|
|
# make gzip remarkable update for zsync OTA update
|
|
|
|
cd $(INSTALL_DIR) && \
|
|
|
|
tar -I"gzip --rsyncable" -cah --no-recursion -f ../$(REMARKABLE_PACKAGE_OTA) \
|
|
|
|
-T koreader/ota/package.index
|
|
|
|
|
2019-08-27 13:22:34 +00:00
|
|
|
SONY_PRSTUX_PACKAGE:=koreader-sony-prstux$(KODEDUG_SUFFIX)-$(VERSION).zip
|
|
|
|
SONY_PRSTUX_PACKAGE_OTA:=koreader-sony-prstux$(KODEDUG_SUFFIX)-$(VERSION).targz
|
2018-09-07 23:37:04 +00:00
|
|
|
sony-prstuxupdate: all
|
|
|
|
# ensure that the binaries were built for ARM
|
|
|
|
file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1
|
2019-07-09 17:38:32 +00:00
|
|
|
# remove old package if any
|
2019-08-27 13:22:34 +00:00
|
|
|
rm -f $(SONY_PRSTUX_PACKAGE)
|
2018-09-07 23:37:04 +00:00
|
|
|
# Sony PRSTUX launching scripts
|
|
|
|
cp $(SONY_PRSTUX_DIR)/*.sh $(INSTALL_DIR)/koreader
|
|
|
|
# create new package
|
|
|
|
cd $(INSTALL_DIR) && \
|
|
|
|
zip -9 -r \
|
2019-08-27 13:22:34 +00:00
|
|
|
../$(SONY_PRSTUX_PACKAGE) \
|
2018-09-07 23:37:04 +00:00
|
|
|
koreader -x "koreader/resources/fonts/*" \
|
|
|
|
"koreader/resources/icons/src/*" "koreader/spec/*" \
|
|
|
|
$(ZIP_EXCLUDE)
|
|
|
|
# generate update package index file
|
2019-08-27 13:22:34 +00:00
|
|
|
zipinfo -1 $(SONY_PRSTUX_PACKAGE) > \
|
2018-09-07 23:37:04 +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
|
2019-08-27 13:22:34 +00:00
|
|
|
cd $(INSTALL_DIR) && zip -u ../$(SONY_PRSTUX_PACKAGE) \
|
2018-09-07 23:37:04 +00:00
|
|
|
koreader/ota/package.index
|
|
|
|
# make gzip sonyprstux update for zsync OTA update
|
|
|
|
cd $(INSTALL_DIR) && \
|
2020-01-11 03:05:14 +00:00
|
|
|
tar --hard-dereference -I"gzip --rsyncable" -cah --no-recursion -f ../$(SONY_PRSTUX_PACKAGE_OTA) \
|
2018-09-07 23:37:04 +00:00
|
|
|
-T koreader/ota/package.index
|
|
|
|
|
2019-08-27 13:22:34 +00:00
|
|
|
CERVANTES_PACKAGE:=koreader-cervantes$(KODEDUG_SUFFIX)-$(VERSION).zip
|
|
|
|
CERVANTES_PACKAGE_OTA:=koreader-cervantes$(KODEDUG_SUFFIX)-$(VERSION).targz
|
2018-10-31 22:48:36 +00:00
|
|
|
cervantesupdate: all
|
|
|
|
# ensure that the binaries were built for ARM
|
|
|
|
file $(INSTALL_DIR)/koreader/luajit | grep ARM || exit 1
|
|
|
|
# remove old package if any
|
2019-08-27 13:22:34 +00:00
|
|
|
rm -f $(CERVANTES_PACKAGE)
|
2018-10-31 22:48:36 +00:00
|
|
|
# Cervantes launching scripts
|
2020-02-11 23:07:05 +00:00
|
|
|
cp $(COMMON_DIR)/spinning_zsync $(INSTALL_DIR)/koreader/spinning_zsync.sh
|
2018-10-31 22:48:36 +00:00
|
|
|
cp $(CERVANTES_DIR)/*.sh $(INSTALL_DIR)/koreader
|
2020-02-12 16:42:17 +00:00
|
|
|
cp $(CERVANTES_DIR)/spinning_zsync $(INSTALL_DIR)/koreader
|
2018-10-31 22:48:36 +00:00
|
|
|
# create new package
|
|
|
|
cd $(INSTALL_DIR) && \
|
|
|
|
zip -9 -r \
|
2019-08-27 13:22:34 +00:00
|
|
|
../$(CERVANTES_PACKAGE) \
|
2018-10-31 22:48:36 +00:00
|
|
|
koreader -x "koreader/resources/fonts/*" \
|
|
|
|
"koreader/resources/icons/src/*" "koreader/spec/*" \
|
|
|
|
$(ZIP_EXCLUDE)
|
|
|
|
# generate update package index file
|
2019-08-27 13:22:34 +00:00
|
|
|
zipinfo -1 $(CERVANTES_PACKAGE) > \
|
2018-10-31 22:48:36 +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
|
2019-08-27 13:22:34 +00:00
|
|
|
cd $(INSTALL_DIR) && zip -u ../$(CERVANTES_PACKAGE) \
|
2018-10-31 22:48:36 +00:00
|
|
|
koreader/ota/package.index
|
|
|
|
# make gzip cervantes update for zsync OTA update
|
|
|
|
cd $(INSTALL_DIR) && \
|
2020-01-11 03:05:14 +00:00
|
|
|
tar --hard-dereference -I"gzip --rsyncable" -cah --no-recursion -f ../$(CERVANTES_PACKAGE_OTA) \
|
2018-10-31 22:48:36 +00:00
|
|
|
-T koreader/ota/package.index
|
|
|
|
|
2015-10-03 06:18:47 +00:00
|
|
|
update:
|
2018-10-31 22:48:36 +00:00
|
|
|
ifeq ($(TARGET), android)
|
|
|
|
make androidupdate
|
|
|
|
else ifeq ($(TARGET), appimage)
|
|
|
|
make appimageupdate
|
|
|
|
else ifeq ($(TARGET), cervantes)
|
|
|
|
make cervantesupdate
|
|
|
|
else ifeq ($(TARGET), kindle)
|
2015-10-03 06:18:47 +00:00
|
|
|
make kindleupdate
|
2016-02-01 06:43:46 +00:00
|
|
|
else ifeq ($(TARGET), kindle-legacy)
|
|
|
|
make kindleupdate
|
2018-04-15 20:52:58 +00:00
|
|
|
else ifeq ($(TARGET), kindlepw2)
|
|
|
|
make kindleupdate
|
2015-10-03 06:18:47 +00:00
|
|
|
else ifeq ($(TARGET), kobo)
|
|
|
|
make koboupdate
|
|
|
|
else ifeq ($(TARGET), pocketbook)
|
|
|
|
make pbupdate
|
2018-09-07 23:37:04 +00:00
|
|
|
else ifeq ($(TARGET), sony-prstux)
|
|
|
|
make sony-prstuxupdate
|
2020-02-08 00:58:10 +00:00
|
|
|
else ifeq ($(TARGET), remarkable)
|
|
|
|
make remarkableupdate
|
2015-10-03 06:18:47 +00:00
|
|
|
else ifeq ($(TARGET), ubuntu-touch)
|
|
|
|
make utupdate
|
2019-01-03 17:21:35 +00:00
|
|
|
else ifeq ($(TARGET), debian)
|
|
|
|
make debianupdate
|
|
|
|
$(CURDIR)/platform/debian/do_debian_package.sh $(INSTALL_DIR)
|
|
|
|
else ifeq ($(TARGET), debian-armel)
|
|
|
|
make debianupdate
|
|
|
|
$(CURDIR)/platform/debian/do_debian_package.sh $(INSTALL_DIR) armel
|
|
|
|
else ifeq ($(TARGET), debian-armhf)
|
|
|
|
make debianupdate
|
|
|
|
$(CURDIR)/platform/debian/do_debian_package.sh $(INSTALL_DIR) armhf
|
2020-07-10 14:05:54 +00:00
|
|
|
else ifeq ($(TARGET), macos)
|
|
|
|
make macosupdate
|
|
|
|
$(CURDIR)/platform/mac/do_mac_bundle.sh $(INSTALL_DIR)
|
2015-10-03 06:18:47 +00:00
|
|
|
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
|
|
|
|
|
2017-05-08 09:37:29 +00:00
|
|
|
|
|
|
|
# for gettext
|
|
|
|
DOMAIN=koreader
|
|
|
|
TEMPLATE_DIR=l10n/templates
|
2019-08-21 20:18:14 +00:00
|
|
|
XGETTEXT_BIN=xgettext
|
2017-05-08 09:37:29 +00:00
|
|
|
|
2019-12-31 14:39:15 +00:00
|
|
|
pot: po
|
2014-08-26 06:27:38 +00:00
|
|
|
mkdir -p $(TEMPLATE_DIR)
|
2019-08-24 21:06:06 +00:00
|
|
|
$(XGETTEXT_BIN) --from-code=utf-8 \
|
|
|
|
--keyword=C_:1c,2 --keyword=N_:1,2 --keyword=NC_:1c,2,3 \
|
2019-08-24 07:25:38 +00:00
|
|
|
--add-comments=@translators \
|
2019-12-31 16:47:54 +00:00
|
|
|
reader.lua `find frontend -iname "*.lua" | sort` \
|
|
|
|
`find plugins -iname "*.lua" | sort` \
|
|
|
|
`find tools -iname "*.lua" | sort` \
|
2019-08-21 20:18:14 +00:00
|
|
|
-o $(TEMPLATE_DIR)/$(DOMAIN).pot
|
2013-04-07 19:05:32 +00:00
|
|
|
|
2013-11-29 14:41:56 +00:00
|
|
|
po:
|
2019-12-31 14:39:15 +00:00
|
|
|
git submodule update --remote l10n
|
2017-05-08 09:37:29 +00:00
|
|
|
|
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 \
|
2018-04-15 21:49:08 +00:00
|
|
|
luacheck -q {reader,setupkoenv,datastorage}.lua frontend plugins spec; \
|
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
|
|
|
|
|
2019-03-19 15:08:13 +00:00
|
|
|
.PHONY: all clean doc test update
|