]> git.draconx.ca Git - rrace.git/commitdiff
Improve portability of icon generating rules.
authorNick Bowler <nbowler@draconx.ca>
Wed, 30 Nov 2022 02:24:52 +0000 (21:24 -0500)
committerNick Bowler <nbowler@draconx.ca>
Wed, 30 Nov 2022 02:24:52 +0000 (21:24 -0500)
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.

Makefile.am

index c7365300d88870e190812898bd3b171dc849b3dd..d99c5d754c354a9541cbc3ec06affecf127c0566 100644 (file)
@@ -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