summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 9fa9aef9d3cd7e2a530ef27d5b72ac08f8f2c573 (plain) (blame)
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
FILES_SRC := $(shell find src/icons -type f -name "*.svg")
FILES     := $(patsubst src/icons/%.svg,dist/%.svg,$(FILES_SRC))

all: files showcase/index.html

files:  $(FILES)

###

dist/%.svg: src/icons/%.svg | dist
	scour -i "$<" \
		--enable-viewboxing \
		--enable-id-stripping \
		--enable-comment-stripping \
		--remove-descriptive-elements \
		--strip-xml-prolog \
		--shorten-ids | sed -z 's/\(fill\|stroke\)="#.\{3,6\}"/\1="currentColor"/g;s/stroke-width="[0-9.]*"//g;s/stroke-linecap="[a-z]*"//g;s/stroke-linejoin="[a-z]*"//g;s/style="[ a-z0-9:-]*"//g' > "$@"

showcase/index.html: src/showcase/index.html $(FILES) | showcase
	scripts/build_showcase.sh

showcase:
	mkdir -p showcase

dist:
	mkdir -p dist

###

.PHONY: all