The way that the build-icons rule is currently handled means that
'make install' is triggering compilation of the ewmhicon test program,
even if the icons are already available.
This is undesirable as 'make install' should normally not cause anything
to be compiled like that. Split up the rules so that nothing gets built
until after the rule has actually determined that one or more icons are
missing.
t_rng_test_LDADD = libgnu.a
$(t_rng_test_OBJECTS): $(gnulib_headers)
t_rng_test_LDADD = libgnu.a
$(t_rng_test_OBJECTS): $(gnulib_headers)
-GENPNG_V = $(GENPNG_V_@AM_V@)
-GENPNG_V_ = $(GENPNG_V_@AM_DEFAULT_V@)
-GENPNG_V_0 = @printf ' %$(DX_ALIGN_V)s %s\n' 'GEN ' $*.png;
+SUFFIXES = .xpm .gen
+XPMICONS = data/rr16x16.xpm data/rr24x24.xpm data/rr32x32.xpm data/rr48x48.xpm
+PNGICONS = $(XPMICONS:.xpm=.png)
-$(GENICONS:.png=.gen):
- $(GENPNG_V) $(MKDIR_P) $(@D)
+DISTCLEANFILES += $(XPMICONS)
+MAINTAINERCLEANFILES += $(PNGICONS)
+
+$(XPMICONS): t/ewmhicon$(EXEEXT)
+ $(AM_V_GEN) $(MKDIR_P) $(@D)
$(AM_V_at) s=`expr $(@F) : '[^0-9]*\([^.]*\)'`; \
$(AM_V_at) s=`expr $(@F) : '[^0-9]*\([^.]*\)'`; \
- t/ewmhicon$(EXEEXT) -c yrwyogbbg "$$s" >$*.xpm
+ t/ewmhicon$(EXEEXT) -c yrwyogbbg "$$s" >$*-t.xpm
+ $(AM_V_at) mv -f $*-t.xpm $@
+
+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):
+ $(GENERIC_V) : 'GENDIST ' $*.png; $(MKDIR_P) $(@D)
- $(AM_V_at) $(XPMTOPPM) $*.xpm | $(PNMTOPNG) >$*-t.png
-else
-if USE_CONVERT
- $(AM_V_at) $(CONVERT) $*.xpm $*-t.png
+ $(AM_V_at) $(XPMTOPPM) $? | $(PNMTOPNG) >$*-t.png
+if USE_CONVERT
+ $(AM_V_at) $(CONVERT) $? $*-t.png
endif
$(AM_V_at) $(OPTIPNG) -o7 -quiet $*-t.png
$(AM_V_at) mv -f $*-t.png $*.png
endif
$(AM_V_at) $(OPTIPNG) -o7 -quiet $*-t.png
$(AM_V_at) mv -f $*-t.png $*.png
-MOSTLYCLEANFILES += $(GENICONS:.png=-t.png)
-DISTCLEANFILES += $(GENICONS:.png=.xpm)
-MAINTAINERCLEANFILES += $(GENICONS)
-SUFFIXES = .gen
-
-GENICONS = data/rr48x48.png data/rr32x32.png data/rr24x24.png data/rr16x16.png
-$(GENICONS): ;
-
-build-icons: t/ewmhicon$(EXEEXT) $(GENICONS)
- $(AM_V_at) set x $(GENICONS:.png=); shift; for f; do shift; \
- test -f "$$f.png" || test -f "$(srcdir)/$$f.png" || \
- { set x "$$@" "$$f.gen"; shift; }; \
- done; $(MAKE) $(AM_MAKEFLAGS) "$$@"
+.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"; \
+ done; \
+ test x"$$list" = x || $(MAKE) $(AM_MAKEFLAGS) $$list
.PHONY: build-icons
dist-hook: dist-icons
dist-icons: build-icons
$(MKDIR_P) $(distdir)/data
.PHONY: build-icons
dist-hook: dist-icons
dist-icons: build-icons
$(MKDIR_P) $(distdir)/data
- for f in $(GENICONS); do \
+ for f in $(PNGICONS); do \
if test -f "$$f"; \
then cp "$$f" "$(distdir)/data" || exit; \
else cp "$(srcdir)/$$f" "$(distdir)/data" || exit; \
if test -f "$$f"; \
then cp "$$f" "$(distdir)/data" || exit; \
else cp "$(srcdir)/$$f" "$(distdir)/data" || exit; \