FILES_SRC := $(shell find src/icons -type f -name "*.svg") FILES := $(patsubst src/icons/%.svg,dist/%.svg,$(FILES_SRC)) all: files dist/sprite.svg 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