-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (40 loc) · 1.55 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.PHONY: build
CURRENT_VERSION = $(shell jq -r .version package.json)
all: chrome mozilla
notify-send -u low -t 1000 Build done
mozilla: pages bundled_docs
mkdir -p unpackaged/mozilla/assets
cp assets/icon.svg unpackaged/mozilla/assets
cp -r build/* unpackaged/mozilla/
sed -e 's/__version__/$(CURRENT_VERSION)/' \
manifest-mozilla.json > unpackaged/mozilla/manifest.json
icons:
mkdir -p unpackaged/chrome/assets
inkscape -w 48 -h 48 assets/icon.svg \
-o unpackaged/chrome/assets/icon48.png
inkscape -w 96 -h 96 assets/icon.svg \
-o unpackaged/chrome/assets/icon96.png
inkscape -w 128 -h 128 assets/icon.svg \
-o unpackaged/chrome/assets/icon128.png
chrome: pages bundled_docs icons
cp -r build/* unpackaged/chrome/
sed -e 's/__version__/$(CURRENT_VERSION)/' \
manifest-chrome.json > unpackaged/chrome/manifest.json
bundled_docs:
mkdir -p unpackaged/chrome/pages/docs
mkdir -p unpackaged/mozilla/pages/docs
pandoc -s -f markdown -t html README.md > unpackaged/chrome/pages/README.html
cp unpackaged/chrome/pages/README.html unpackaged/mozilla/pages/README.html
cp -r docs/screenshots unpackaged/chrome/pages/docs
cp -r docs/screenshots unpackaged/mozilla/pages/docs
pages:
npm run build -- --config vite.config.js
dist: mozilla chrome
mkdir -p dist
(cd unpackaged/mozilla && zip -r ../../dist/mozilla-$(CURRENT_VERSION).zip .)
(cd unpackaged/chrome && zip -r ../../dist/chrome-$(CURRENT_VERSION).zip .)
git archive --format zip --output \
dist/schmackhaft-v$(CURRENT_VERSION)-src.zip \
v$(CURRENT_VERSION)
clean:
rm -rf dist build unpackaged