From 3c0cbf57e8eacad16309f323d595aeb2d9351417 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 22 Jun 2018 01:54:04 +0200 Subject: Fix icons and speed up building MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 87 ++++++++++++++++++++-------------------------------------------- 1 file changed, 27 insertions(+), 60 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2782e46..e24f50d 100644 --- a/Makefile +++ b/Makefile @@ -3168,6 +3168,8 @@ ALL_PNG_ICONS = $(foreach S,$(SIZES),$(foreach I,$(ICONS),$(S)x$(S)/$(I).png)) all: index.theme $(ALL_PNG_ICONS) +all-fast: index.theme all-fast-icons + index.theme: Makefile set -e;\ printf '%s\n' \ @@ -3213,68 +3215,34 @@ index.theme: Makefile done;\ done >> index.theme -8x8/%.png: scalable/%.svg - mkdir -p -- $(@D) - s="$$(printf '%s\n' $@ | cut -d x -f 1)";\ - if test -L $<; then\ - ln -sf "$$(readlink $< | sed 's/\.svg$$/\.png/')" $@;\ - else\ - rsvg-convert -w $$s -h $$s -f png $< > $@;\ - fi +all-fast-icons: $(ICONS:=.x) + +%.x: conv + ./conv scalable/$*.svg $(SIZES) + +conv: conv.c + $(CC) -o $@ $< $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) + +8x8/%.png: scalable/%.svg conv + ./conv $@ -16x16/%.png: scalable/%.svg - mkdir -p -- $(@D) - s="$$(printf '%s\n' $@ | cut -d x -f 1)";\ - if test -L $<; then\ - ln -sf "$$(readlink $< | sed 's/\.svg$$/\.png/')" $@;\ - else\ - rsvg-convert -w $$s -h $$s -f png $< > $@;\ - fi +16x16/%.png: scalable/%.svg conv + ./conv $@ -22x22/%.png: scalable/%.svg - mkdir -p -- $(@D) - s="$$(printf '%s\n' $@ | cut -d x -f 1)";\ - if test -L $<; then\ - ln -sf "$$(readlink $< | sed 's/\.svg$$/\.png/')" $@;\ - else\ - rsvg-convert -w $$s -h $$s -f png $< > $@;\ - fi +22x22/%.png: scalable/%.svg conv + ./conv $@ -24x24/%.png: scalable/%.svg - mkdir -p -- $(@D) - s="$$(printf '%s\n' $@ | cut -d x -f 1)";\ - if test -L $<; then\ - ln -sf "$$(readlink $< | sed 's/\.svg$$/\.png/')" $@;\ - else\ - rsvg-convert -w $$s -h $$s -f png $< > $@;\ - fi +24x24/%.png: scalable/%.svg conv + ./conv $@ -32x32/%.png: scalable/%.svg - mkdir -p -- $(@D) - s="$$(printf '%s\n' $@ | cut -d x -f 1)";\ - if test -L $<; then\ - ln -sf "$$(readlink $< | sed 's/\.svg$$/\.png/')" $@;\ - else\ - rsvg-convert -w $$s -h $$s -f png $< > $@;\ - fi +32x32/%.png: scalable/%.svg conv + ./conv $@ -36x36/%.png: scalable/%.svg - mkdir -p -- $(@D) - s="$$(printf '%s\n' $@ | cut -d x -f 1)";\ - if test -L $<; then\ - ln -sf "$$(readlink $< | sed 's/\.svg$$/\.png/')" $@;\ - else\ - rsvg-convert -w $$s -h $$s -f png $< > $@;\ - fi +36x36/%.png: scalable/%.svg conv + ./conv $@ -48x48/%.png: scalable/%.svg - mkdir -p -- $(@D) - s="$$(printf '%s\n' $@ | cut -d x -f 1)";\ - if test -L $<; then\ - ln -sf "$$(readlink $< | sed 's/\.svg$$/\.png/')" $@;\ - else\ - rsvg-convert -w $$s -h $$s -f png $< > $@;\ - fi +48x48/%.png: scalable/%.svg conv + ./conv $@ install: index.theme $(ALL_PNG_ICONS) mkdir -p -- "$(DESTDIR)$(ICONPREFIX)" @@ -3298,8 +3266,7 @@ uninstall: rm -rf -- "$(DESTDIR)$(ICONPREFIX)/simple" clean: - -rm -f -- index.theme - -rm -f -- $(foreach S,$(SIZES),$(foreach I,$(ICONS),$(S)x$(S)/$(I).png)) - -rmdir -- $(foreach S,$(SIZES),$(foreach D,$(DIRS),$(S)x$(S)/$(D)) $(S)x$(S)) + -rm -f -- index.theme *.o *.su conv + -for s in $(SIZES); do printf "$${s}x$${s}\n"; done | xargs rm -rf -- -.PHONY: all install uninstall clean +.PHONY: all all-fast all-fast-icons install uninstall clean -- cgit v1.2.3-70-g09d2