-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
28 lines (19 loc) · 1.08 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
VERSION=$(shell grep -E -o '<em.version>(.*)</em.version>' install.rdf | sed -e 's/<[a-z:/]*>//g')
XPI_FILES=README.user COPYING ChangeLog install.rdf chrome.manifest components/MozVoikko2.js skin/icon.png
SOURCE_FILES=$(XPI_FILES) Makefile README
.PHONY: dist-gzip mozvoikko2 clean all
all: mozvoikko2
dist-gzip: mozvoikko-$(VERSION).tar.gz
mozvoikko-$(VERSION).tar.gz: $(patsubst %,mozvoikko-$(VERSION)/%, $(sort $(SOURCE_FILES)))
tar c --group 0 --owner 0 mozvoikko-$(VERSION) | gzip -9 > $@
$(patsubst %,mozvoikko-$(VERSION)/%, $(sort $(SOURCE_FILES))): mozvoikko-$(VERSION)/%: %
install -m 644 -D $^ $@
mozvoikko2:
rm -vf mozvoikko2.xpi
TZ=UTC zip -9 mozvoikko2.xpi $(XPI_FILES) $(shell find voikko -type f '!' -name '.*' '!' -path 'voikko*/.*')
clean:
rm -f mozvoikko-$(VERSION).tar.gz mozvoikko2.xpi
rm -f $(patsubst %,mozvoikko-$(VERSION)/%, $(sort $(SOURCE_FILES)))
test ! -d mozvoikko-$(VERSION)/components || rmdir mozvoikko-$(VERSION)/components
test ! -d mozvoikko-$(VERSION)/skin || rmdir mozvoikko-$(VERSION)/skin
test ! -d mozvoikko-$(VERSION) || rmdir mozvoikko-$(VERSION)