+ $(AM_V_GEN) :; { \
+ $(AWK) -f $(DX_BASEDIR)/scripts/gen-tree.awk $< && \
+ printf '%s\n' \
+ 'sub(/^#&/, "\\&") == 0 { next }' \
+ '{ has_strtab=1 } END { if (!has_strtab) { exit(0); } print "" }' \
+ | $(AWK) -f - -f $(DX_BASEDIR)/scripts/gen-strtab.awk $<; \
+ } >$@-t
+ $(AM_V_at) mv -f $@-t $@
+$(TREEFILES:.dat=.h): $(DX_BASEDIR)/scripts/gen-strtab.awk
+EXTRA_DIST += $(DX_BASEDIR)/scripts/gen-strtab.awk
+$(TREEFILES:.dat=.h): $(DX_BASEDIR)/scripts/gen-tree.awk
+EXTRA_DIST += $(DX_BASEDIR)/scripts/gen-tree.awk
+DISTCLEANFILES += $(TREEFILES:.dat=.h)
+EXTRA_DIST += $(TREEFILES)
+
+check_PROGRAMS = t/boardmove t/boardbit t/ewmhicon t/rng-test
+EXTRA_DIST += t/xos256ss.c
+
+t_boardmove_SOURCES = t/boardmove.c src/game.c
+t_boardmove_LDADD = libgnu.a $(LIB_CLOCK_GETTIME) $(LIB_GETHRXTIME)
+$(t_boardmove_OBJECTS): $(gnulib_headers)
+
+t_boardbit_SOURCES = t/boardbit.c
+t_boardbit_LDADD = libgnu.a
+$(t_boardbit_OBJECTS): $(gnulib_headers)
+
+t_ewmhicon_SOURCES = t/ewmhicon.c src/ewmhicon.c src/icon.c common/src/help.c
+t_ewmhicon_LDADD = libgnu.a $(MOTIF_LIBS)
+$(t_ewmhicon_OBJECTS): $(gnulib_headers)
+
+t_rng_test_LDADD = libgnu.a
+$(t_rng_test_OBJECTS): $(gnulib_headers)
+
+XPMICONS = data/rr16x16.xpm data/rr24x24.xpm data/rr32x32.xpm data/rr48x48.xpm
+PNGICONS = $(XPMICONS:.xpm=.png)
+
+DISTCLEANFILES += $(XPMICONS)
+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" >$(@:.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'
+
+.xpm.genpng:
+ $(GENERIC_V) : 'GENDIST ' $*.png; $(MKDIR_P) $(@D)
+if USE_NETPBM
+ $(AM_V_at) $(XPMTOPPM) $? | $(PNMTOPNG) >$*-t.png
+endif
+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
+
+build-icons:
+ $(AM_V_at) list=; \
+ for i in $(PNGICONS:.png=); do \
+ test -f $$i.png || test -f $(srcdir)/$$i.png \
+ || list="$$list $$i.genpng"; \
+ done; \
+ test x"$$list" = x || $(MAKE) $(AM_MAKEFLAGS) $$list
+.PHONY: build-icons
+
+dist-hook: dist-icons
+dist-icons: build-icons
+ $(MKDIR_P) $(distdir)/data
+ for f in $(PNGICONS); do \
+ if test -f "$$f"; \
+ then cp "$$f" "$(distdir)/data" || exit; \
+ else cp "$(srcdir)/$$f" "$(distdir)/data" || exit; \
+ fi; done
+.PHONY: dist-icons
+
+iconsdir = $(datarootdir)/icons/hicolor
+
+install-data-local: install-icons
+install-icons: build-icons
+ for f in $(GENICONS); do \
+ s=`expr "$$f" : '[^0-9]*\([^.]*\)'`; \
+ od="$(DESTDIR)$(iconsdir)/$$s/apps"; \
+ $(MKDIR_P) "$$od"; if test -f "$$f"; \
+ then $(INSTALL_DATA) "$$f" "$$od/$(PACKAGE_TARNAME).png"; \
+ else $(INSTALL_DATA) "$(srcdir)/$$f" "$$od/$(PACKAGE_TARNAME).png";\
+ fi; done
+.PHONY: install-icons
+
+uninstall-local: uninstall-icons
+uninstall-icons:
+ for f in $(GENICONS); do \
+ s=`expr "$$f" : '[^0-9]*\([^.]*\)'`; \
+ od="$(DESTDIR)$(iconsdir)/$$s/apps"; \
+ rm -f "$$od/$(PACKAGE_TARNAME).png"; \
+ done
+.PHONY: uninstall-icons
+
+include $(top_srcdir)/lib/gnulib.mk
+include $(top_srcdir)/common/snippet/autotest.mk