Added build target to upload Anki files to Android phone.
--- a/Makefile Sat Jul 03 23:55:02 2021 +0300
+++ b/Makefile Sun Jul 04 00:29:00 2021 +0300
@@ -92,6 +92,10 @@
endif
endif
+ifneq '' '$(wildcard /etc/wsl.conf)'
+ is_wsl := yes
+endif
+
################################################################
# Build tools definition/switches.
@@ -116,6 +120,11 @@
ANKI_PY_DIR := /usr/share/anki
endif
+ADB := adb
+ifeq 'yes' '$(is_wsl)'
+ ADB := adb.exe
+endif
+
################################################################
# Install paths.
@@ -211,6 +220,13 @@
done
rm -f $(patsubst %,$(elispdir)/%,$(notdir $(EL_FILES))) $(patsubst %.el,$(elispdir)/%.elc,$(notdir $(EL_FILES)))
+.PHONY: upload-anki-android
+upload-anki-android: $(SRS_ANKI_FILES)
+ \
+for f in $(SRS_ANKI_FILES); do \
+ $(ADB) push $$f /sdcard/AnkiDroid/; \
+done
+
################################################################
# Deploy/release targets.