annotate Makefile @ 0:3353f3c48b6b

Initial revision
author Guido Berhoerster <guido+open-incognito@berhoerster.name>
date Fri, 14 Dec 2018 15:59:37 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
1 #
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
2 # Copyright (C) 2018 Guido Berhoerster <guido+open-incognito@berhoerster.name>
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
3 #
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
4 # Permission is hereby granted, free of charge, to any person obtaining
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
5 # a copy of this software and associated documentation files (the
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
6 # "Software"), to deal in the Software without restriction, including
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
7 # without limitation the rights to use, copy, modify, merge, publish,
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
8 # distribute, sublicense, and/or sell copies of the Software, and to
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
9 # permit persons to whom the Software is furnished to do so, subject to
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
10 # the following conditions:
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
11 #
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
12 # The above copyright notice and this permission notice shall be included
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
13 # in all copies or substantial portions of the Software.
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
14 #
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
18 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
19 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
22 #
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
23
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
24 NAME = open-incognito
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
25 VERSION = 1
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
26 EXT_NAME = $(subst -,_,$(NAME))-$(VERSION)
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
27
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
28 INKSCAPE := inkscape
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
29 INFOZIP := zip
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
30 SED := sed
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
31
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
32 BITMAP_ICONS = icons/open-incognito-48.png \
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
33 icons/open-incognito-96.png
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
34 DIST_FILES = manifest.json \
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
35 COPYING \
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
36 NEWS \
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
37 README \
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
38 $(wildcard _locales/*/messages.json) \
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
39 background.js \
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
40 $(BITMAP_ICONS)
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
41
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
42 .DEFAULT_TARGET = all
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
43
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
44 .PHONY: all extension clean clobber
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
45
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
46 all: extension
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
47
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
48 extension: $(EXT_NAME).zip
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
49
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
50 $(EXT_NAME).zip: $(DIST_FILES)
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
51 $(INFOZIP) $@ $^
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
52
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
53 define generate-icon-rule
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
54 $1: $(1:%-$(lastword $(subst -, ,$1))=%.svg)
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
55 size=$(lastword $(subst -, ,$(basename $1))); \
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
56 $(INKSCAPE) -w $$$${size} -h $$$${size} -e $$@ $$<
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
57 endef
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
58
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
59 $(foreach icon,$(BITMAP_ICONS),$(eval $(call generate-icon-rule,$(icon))))
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
60
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
61 manifest.json: manifest.json.in
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
62 $(SED) 's|@VERSION@|$(VERSION)|g' $< >$@
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
63
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
64 clean:
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
65 -rm -f $(BITMAP_ICONS) manifest.json
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
66
3353f3c48b6b Initial revision
Guido Berhoerster <guido+open-incognito@berhoerster.name>
parents:
diff changeset
67 clobber: clean