aboutsummaryrefslogtreecommitdiff
path: root/yomichan/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'yomichan/makefile')
-rw-r--r--yomichan/makefile42
1 files changed, 29 insertions, 13 deletions
diff --git a/yomichan/makefile b/yomichan/makefile
index a4f19df..e00dc57 100644
--- a/yomichan/makefile
+++ b/yomichan/makefile
@@ -1,11 +1,11 @@
-all:
+all: sentence-export.min.js
-.PHONY: clean patch update
+.PHONY: clean patch
include ../common.mk
-yomichan/js/user.js: sentence-export.min.js yomichan
- ln -sf ../../$< $@
+yomichan/js/user.js: yomichan sentence-export.min.js
+ ln -sf ../../sentence-export.min.js $@
yomichan-chrome.zip:
curl https://github.com/FooSoft/yomichan/releases/latest/download/$@ -Lso- > $@
@@ -13,18 +13,34 @@ yomichan-chrome.zip:
yomichan: yomichan-chrome.zip
unzip -qo yomichan-chrome.zip -d yomichan
-yomichan/manifest.json.bak: yomichan/manifest.json
- mv $< $@
- jq '.content_scripts[0].js[.content_scripts[0].js | length] |= .+ "js/user.js"' $@ > $<
+yomichan/manifest.json.bak:
+ cp yomichan/manifest.json $@
+
+yomichan/search.html.bak:
+ cp yomichan/search.html $@
+
+yomichan/manifest-patched.json: yomichan/manifest.json.bak
+ jq '.content_scripts[0].js[.content_scripts[0].js | length] |= .+ "js/user.js"' $< > $@
-yomichan/search.html.bak: yomichan/search.html
- mv $< $@
- sed 's#</body>#<script defer src="/js/user.js"></script>\n</body>#' $@ > $<
+yomichan/search-patched.html: yomichan/search.html.bak
+ sed 's#</body>#<script defer src="/js/user.js"></script>\n</body>#' $< > $@
-patch: yomichan yomichan/search.html.bak yomichan/manifest.json.bak
+yomichan/images/%.svg: %.svg
+ ln -sf ../../copy.svg $@
+
+yomichan/css/%.css: %.css
+ ln -sf ../../$< $@
-update: yomichan
+patch: yomichan
+patch: yomichan/search-patched.html
+patch: yomichan/manifest-patched.json
+patch: yomichan/js/user.js
+patch: yomichan/images/copy.svg
+patch: yomichan/css/sentence-export.css
+patch:
+ ln -sf search-patched.html yomichan/search.html
+ ln -sf manifest-patched.json yomichan/manifest.json
clean:
- $(RM) sentence-export.min.js sentence-export.src
+ $(RM) -r sentence-export.min.js yomichan yomichan-chrome.zip