diff options
author | Mattias Andrée <maandree@kth.se> | 2023-07-02 00:37:38 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-07-02 00:38:53 +0200 |
commit | 94683b40016c6011809ce9b88eb35f180aada647 (patch) | |
tree | 2d9b1b8fde7faed515ec335e8b2306b9bd20eb25 /Makefile | |
parent | Improve makfile (diff) | |
download | simple-icon-theme-94683b40016c6011809ce9b88eb35f180aada647.tar.gz simple-icon-theme-94683b40016c6011809ce9b88eb35f180aada647.tar.bz2 simple-icon-theme-94683b40016c6011809ce9b88eb35f180aada647.tar.xz |
Fix icon listing and make Makefile portable
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 25 |
1 files changed, 18 insertions, 7 deletions
@@ -1,28 +1,39 @@ .POSIX: +DEVCHECK = @: + CONFIGFILE = config.mk include $(CONFIGFILE) all: -generated-rules.mk: $(CONFIGFILE) +generated.mk: $(CONFIGFILE) icons.mk Makefile + $(DEVCHECK) ./check-icons-listing @test ! -e $@ || chmod -- u+w $@ - printf '# %s\n' 'This file is generated from Makefile' > $@ - printf '\n%1i$$(DIR_SUFFIX)/%%.png: scalable$$(DIR_SUFFIX)/%%.svg conv\n\t./conv $$@\n' $(SIZES) | \ + printf '\043 %s\n' 'This file is generated from Makefile' > $@ + printf '\n%1i$$(DIR_SUFFIX)/%%.png: scalable$$(DIR_SUFFIX)/%%.svg conv\n\t./conv $$@\n' $(SIZES) |\ sed 's/^[0-9]\+/&x&/' >> $@ + set -e; \ + for size in $(SIZES); do\ + printf '\nALL_SIZE_%i_PNG_ICONS =\\\n' $$size >> $@;\ + sed '/^\s*\('"$$(printf '\043')"'.*\|\)$$/d' < icons.mk | sed 1d | sed 's/\\\?$$/\.png&/' |\ + sed 's/^\s*/&'"$${size}x$${size}"'\$$(DIR_SUFFIX)\//' >> $@;\ + done + printf '\nALL_PNG_ICONS =' >> $@ + printf ' $$(ALL_SIZE_%i_PNG_ICONS)' $(SIZES) >> $@ + printf '\n' >> $@ @chmod -- a-w $@ clean: - -rm -f -- index.theme *.o *.su conv generated-rules.mk - -if test -n "$(DIR_SUFFIX)"; then rm -rf -- scalable$(DIR_SUFFIX); fi + -rm -rf -- index.theme *.o *.su conv generated.mk scalable-"$(DIR_SUFFIX_)" -for s in $(SIZES); do printf "$${s}x$${s}$(DIR_SUFFIX)\n"; done | xargs rm -rf -- # These are just added so autocompletion works with them -all all-fast all-fast-icons install uninstall index.theme conv: generated-rules.mk +all all-fast all-fast-icons install uninstall index.theme conv: generated.mk +@$(MAKE) -f make-stage-2.mk $@ .DEFAULT: - +@$(MAKE) generated-rules.mk + +@$(MAKE) generated.mk +@$(MAKE) -f make-stage-2.mk $@ .PHONY: all all-fast all-fast-icons install uninstall clean |