FILES_SRC := $(shell find src/icons -type f -name "*.svg") FILES := $(patsubst src/icons/%.svg,output/%.svg,$(FILES_SRC)) all: files showcase/index.html files: $(FILES) ### output/%.svg: src/icons/%.svg | output 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 output: mkdir -p output ### .PHONY: all