Added build target to upload Anki files to Android phone.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sun, 04 Jul 2021 00:29:00 +0300
changeset 1309 5f52c9e8b9b0
parent 1308 c3c51450c705
child 1310 ee382e087216
Added build target to upload Anki files to Android phone.
Makefile
--- 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.