-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
63 lines (52 loc) · 1.42 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#
# Copy Patch Thunderbird Add-On
#
# Copyright (c) Jan Kiszka, 2019-2020
#
# Authors:
# Jan Kiszka <[email protected]>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
ifeq ($(V),1)
Q =
else
Q = @
endif
PACKAGE_NAME=copypatch
RELEASE_TAG=$(shell git describe --match "[0-9].[0-9]*" --dirty)
ARCHIVE_NAME=$(PACKAGE_NAME)-$(RELEASE_TAG).xpi
PACKAGE_FILES= \
manifest.json \
copypatch*.png \
background.html \
background-script.js \
content-script.js \
node_modules/email-addresses/LICENSE \
node_modules/email-addresses/lib/email-addresses.js \
COPYING
UPDATE_VERSION='s|"version":.*|"version": "$(VERSION)",|'
all package: clean node_modules $(PACKAGE_FILES)
zip -r $(ARCHIVE_NAME) $(PACKAGE_FILES)
node_modules: package.json
npm install
sed -i 's/(this)/(globalThis)/' node_modules/email-addresses/lib/email-addresses.js
distclean: clean
rm -rf node_modules
clean:
rm -f $(ARCHIVE_NAME)
release:
${Q}if [ -z "$(VERSION)" ]; then \
echo "VERSION is not set"; \
exit 1; \
fi
${Q}if [ -n "`git status -s -uno`" ]; then \
echo "Working directory is dirty!"; \
exit 1; \
fi
${Q}sed -i $(UPDATE_VERSION) manifest.json
git commit -s manifest.json -m "Bump version number"
git tag -as $(VERSION) -m "Release $(VERSION)"
.PHONY: clean distclean release