From: Nick Bowler Date: Wed, 30 Nov 2022 02:24:52 +0000 (-0500) Subject: Improve portability of icon generating rules. X-Git-Url: http://git.draconx.ca/gitweb/rrace.git/commitdiff_plain/3ab770d56719dfac72cf49f9a002a3f6b332593c Improve portability of icon generating rules. Using $* in target rules is not portable; POSIX specifies that it is only valid in inference rules and this is the case with several make implementations. Although this is a minor issue since the icons won't normally be generated when building from a release, it is easy enough to fix. --- diff --git a/Makefile.am b/Makefile.am index c736530..d99c5d7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -105,7 +105,6 @@ $(t_ewmhicon_OBJECTS): $(gnulib_headers) t_rng_test_LDADD = libgnu.a $(t_rng_test_OBJECTS): $(gnulib_headers) -SUFFIXES = .xpm .gen XPMICONS = data/rr16x16.xpm data/rr24x24.xpm data/rr32x32.xpm data/rr48x48.xpm PNGICONS = $(XPMICONS:.xpm=.png) @@ -115,18 +114,14 @@ MAINTAINERCLEANFILES += $(PNGICONS) $(XPMICONS): t/ewmhicon$(EXEEXT) $(AM_V_GEN) $(MKDIR_P) $(@D) $(AM_V_at) s=`expr $(@F) : '[^0-9]*\([^.]*\)'`; \ - t/ewmhicon$(EXEEXT) -c yrwyogbbg "$$s" >$*-t.xpm - $(AM_V_at) mv -f $*-t.xpm $@ + t/ewmhicon$(EXEEXT) -c yrwyogbbg "$$s" >$(@:.xpm=.tmp) + $(AM_V_at) mv -f $(@:.xpm=.tmp) $@ GENERIC_V = $(GENERIC_V_@AM_V@) GENERIC_V_ = $(GENERIC_V_@AM_DEFAULT_V@) GENERIC_V_0 = @printf '%2.0s%$(DX_ALIGN_V)s %s\n' -data/rr16x16.gen: data/rr16x16.xpm -data/rr24x24.gen: data/rr24x24.xpm -data/rr32x32.gen: data/rr32x32.xpm -data/rr48x48.gen: data/rr48x48.xpm -$(PNGICONS:.png=.gen): +.xpm.genpng: $(GENERIC_V) : 'GENDIST ' $*.png; $(MKDIR_P) $(@D) if USE_NETPBM $(AM_V_at) $(XPMTOPPM) $? | $(PNMTOPNG) >$*-t.png @@ -136,13 +131,12 @@ if USE_CONVERT endif $(AM_V_at) $(OPTIPNG) -o7 -quiet $*-t.png $(AM_V_at) mv -f $*-t.png $*.png -.PHONY: $(PNGICONS:.png=.gen) build-icons: $(AM_V_at) list=; \ for i in $(PNGICONS:.png=); do \ test -f $$i.png || test -f $(srcdir)/$$i.png \ - || list="$$list $$i.gen"; \ + || list="$$list $$i.genpng"; \ done; \ test x"$$list" = x || $(MAKE) $(AM_MAKEFLAGS) $$list .PHONY: build-icons