changeset 20341:47d704435aa4

eliminate recursive make invocation in etc/icons directory * etc/module.mk: New file. * etc/icons/Makefile.am: Move contents to etc/module.mk and Makefile.am. Adapt filenames as needed. * Makefile.am (EXTRA_DIST): Move list of files in etc directory to etc/module.mk. (SUBDIRS): Remove etc/icons from the list. * configure.ac (AC_OUTPUT): Don't generate etc/icons/Makefile.
author John W. Eaton <jwe@octave.org>
date Fri, 03 Jul 2015 07:51:51 -0400
parents 4f911b4e012b
children c3c1fb44f9b5
files Makefile.am configure.ac etc/icons/Makefile.am etc/module.mk
diffstat 4 files changed, 143 insertions(+), 149 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Thu Jul 02 18:07:24 2015 -0400
+++ b/Makefile.am	Fri Jul 03 07:51:51 2015 -0400
@@ -46,28 +46,13 @@
   build-aux/move-if-change \
   build-aux/OctJavaQry.class \
   build-aux/stl_algo.h-fixed \
-  etc/NEWS.1 \
-  etc/NEWS.2 \
-  etc/NEWS.3 \
-  etc/OLD-ChangeLogs/ChangeLog \
-  etc/OLD-ChangeLogs/ChangeLog.1 \
-  etc/OLD-ChangeLogs/doc-ChangeLog \
-  etc/OLD-ChangeLogs/libcruft-ChangeLog \
-  etc/OLD-ChangeLogs/liboctave-ChangeLog \
-  etc/OLD-ChangeLogs/scripts-ChangeLog \
-  etc/OLD-ChangeLogs/src-ChangeLog \
-  etc/OLD-ChangeLogs/test-ChangeLog \
-  etc/PROJECTS \
-  etc/README.Cygwin \
-  etc/README.Linux \
-  etc/README.MacOS \
-  etc/README.MinGW \
-  etc/README.Windows \
-  etc/README.gnuplot \
-  etc/README.kpathsea \
-  etc/gdbinit \
   run-octave.in
 
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+
+include etc/module.mk
 include examples/module.mk
 include m4/module.mk
 
@@ -85,11 +70,22 @@
 if AMCOND_BUILD_GUI
 SUBDIRS += libgui
 endif
-SUBDIRS += src scripts . @DOCDIR@ etc/icons test .
+SUBDIRS += src scripts . @DOCDIR@ test .
+
+dist-hook: docs-dist-hook icons-dist-hook
 
-if ! AMCOND_BUILD_DOCS
-dist-hook:
-	echo "Documentation disabled.  Cannot package distribution!" ; exit 1;
+if AMCOND_BUILD_DOCS
+docs-dist-hook:
+else
+docs-dist-hook:
+	@echo "Documentation disabled.  Cannot package distribution!" ; exit 1;
+endif
+
+if AMCOND_HAVE_ICON_TOOLS
+icons-dist-hook:
+else
+icons-dist-hook:
+	@echo "Packaging distribution requires icotool and rsvg-convert." ; exit 1;
 endif
 
 BUILT_SOURCES = run-octave
@@ -107,13 +103,15 @@
   BUGS \
   INSTALL.OCTAVE
 
-CLEANFILES = $(BUILT_SOURCES)
+CLEANFILES += \
+  $(BUILT_SOURCES)
 
-DISTCLEANFILES = \
+DISTCLEANFILES += \
   .gdbinit \
   ChangeLog
 
-MAINTAINERCLEANFILES = $(BUILT_DISTFILES)
+MAINTAINERCLEANFILES += \
+  $(BUILT_DISTFILES)
 
 CONFIG_FILES = @ac_config_headers@ @ac_config_files@
 
--- a/configure.ac	Thu Jul 02 18:07:24 2015 -0400
+++ b/configure.ac	Fri Jul 03 07:51:51 2015 -0400
@@ -3003,7 +3003,6 @@
   doc/interpreter/Makefile
   doc/liboctave/Makefile
   doc/refcard/Makefile
-  etc/icons/Makefile
   libgnu/Makefile
   libgui/Makefile
   libinterp/Makefile
--- a/etc/icons/Makefile.am	Thu Jul 02 18:07:24 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-# Makefile for Octave's doc/icons directory
-#
-# Copyright (C) 2012-2015 John W. Eaton
-#
-# This file is part of Octave.
-#
-# Octave is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 3 of the License, or (at
-# your option) any later version.
-#
-# Octave is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Octave; see the file COPYING.  If not, see
-# <http://www.gnu.org/licenses/>.
-
-include $(top_srcdir)/build-aux/common.mk
-
-IMAGE_FILES = \
-  octave-logo.svg \
-  octave-sombrero.png
-
-PNG_SIZES = \
-  512 \
-  256 \
-  128 \
-  64 \
-  48 \
-  32 \
-  24 \
-  22 \
-  16
-
-BUILT_PNG_ICONS = $(patsubst %,octave-logo-%.png,$(PNG_SIZES))
-
-WINDOWS_PNG_ICONS = $(filter %-16.png %-32.png %-48.png %-256.png,$(BUILT_PNG_ICONS))
-
-BUILT_ICONS = \
-  $(BUILT_PNG_ICONS) \
-  octave-logo.ico
-
-image_DATA = \
-  $(IMAGE_FILES) \
-  octave-logo.ico
-
-VENDOR = www.octave.org
-
-DESKTOP_FILE = $(VENDOR)-octave.desktop
-
-all-local: octave.appdata.xml octave.desktop $(BUILT_ICONS)
-
-octave.appdata.xml: octave.appdata.xml.in Makefile
-	$(AM_V_GEN)rm -f $@-t $@ && \
-	$(SED) < $< > $@-t \
-	  -e "s|%OCTAVE_DESKTOP_FILE%|${DESKTOP_FILE}|" && \
-	mv $@-t $@
-
-octave.desktop: octave.desktop.in Makefile
-	$(AM_V_GEN)rm -f $@-t $@ && \
-	$(SED) < $< > $@-t \
-	  -e "s|%OCTAVE_IMAGEDIR%|${imagedir}|" \
-	  -e "s|%OCTAVE_PREFIX%|${prefix}|" && \
-	mv $@-t $@
-
-$(BUILT_PNG_ICONS): octave-logo.svg
-	$(AM_V_GEN)rm -f $@-t $@ && \
-	$(RSVG_CONVERT) -w $(lastword $(subst -, ,$(patsubst %.png,%,$@))) $< > $@-t && \
-	mv $@-t $@
-
-octave-logo.ico: $(WINDOWS_PNG_ICONS)
-	$(AM_V_GEN)rm -f $@-t $@ && \
-	$(ICOTOOL) --create --raw $^ > $@-t && \
-	mv $@-t $@
-
-install-data-local:
-	-if test -n "$(DESKTOP_FILE_INSTALL)"; then \
-	  $(DESKTOP_FILE_INSTALL) --dir=$(DESTDIR)$(datadir)/applications \
-	    --vendor $(VENDOR) octave.desktop; \
-	fi
-	for f in $(BUILT_PNG_ICONS); do \
-	  size=`echo $$f | $(SED) -n -e "s/.*-\([0-9]\+\)\.png/\1/p"`; \
-	  if test -f $$f; then d=; else d="$(srcdir)/"; fi; \
-	  $(MKDIR_P) $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps; \
-	  $(INSTALL_DATA) "$$d$$f" $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps/octave.png; \
-	done
-	$(MKDIR_P) $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps
-	$(INSTALL_DATA) $(srcdir)/octave-logo.svg $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/octave.svg
-	$(MKDIR_P) $(DESTDIR)$(datadir)/appdata
-	$(INSTALL_DATA) octave.appdata.xml $(DESTDIR)$(datadir)/appdata/$(VENDOR)-octave.appdata.xml
-
-uninstall-local:
-	if test -n "$(DESKTOP_FILE_INSTALL)"; then \
-	  rm -f $(DESTDIR)$(datadir)/applications/$(DESKTOP_FILE); \
-	fi
-	for f in $(BUILT_PNG_ICONS); do \
-	  size=`echo $$f | $(SED) -n -e "s/.*-\([0-9]\+\)\.png/\1/p"`; \
-	  rm -f $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps/octave.png; \
-	done
-	rm -f $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/octave.svg
-	rm -f $(DESTDIR)$(datadir)/appdata/$(VENDOR)-octave.appdata.xml
-
-if AMCOND_HAVE_ICON_TOOLS
-else
-dist-hook:
-	@echo "Packaging distribution requires icotool and rsvg-convert." ; exit 1;
-endif
-
-EXTRA_DIST = \
-  $(BUILT_ICONS) \
-  $(IMAGE_FILES) \
-  octave.appdata.xml.in \
-  octave.desktop.in
-
-CLEANFILES = octave.appdata.xml octave.desktop
-
-MAINTAINERCLEANFILES = $(BUILT_ICONS)
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/module.mk	Fri Jul 03 07:51:51 2015 -0400
@@ -0,0 +1,118 @@
+EXTRA_DIST += \
+  etc/NEWS.1 \
+  etc/NEWS.2 \
+  etc/NEWS.3 \
+  etc/PROJECTS \
+  etc/README.Cygwin \
+  etc/README.Linux \
+  etc/README.MacOS \
+  etc/README.MinGW \
+  etc/README.Windows \
+  etc/README.gnuplot \
+  etc/README.kpathsea \
+  etc/gdbinit
+
+EXTRA_DIST += \
+  etc/OLD-ChangeLogs/ChangeLog \
+  etc/OLD-ChangeLogs/ChangeLog.1 \
+  etc/OLD-ChangeLogs/doc-ChangeLog \
+  etc/OLD-ChangeLogs/libcruft-ChangeLog \
+  etc/OLD-ChangeLogs/liboctave-ChangeLog \
+  etc/OLD-ChangeLogs/scripts-ChangeLog \
+  etc/OLD-ChangeLogs/src-ChangeLog \
+  etc/OLD-ChangeLogs/test-ChangeLog
+
+icon_IMAGE_FILES = \
+  etc/icons/octave-logo.svg \
+  etc/icons/octave-sombrero.png
+
+icon_PNG_SIZES = \
+  512 \
+  256 \
+  128 \
+  64 \
+  48 \
+  32 \
+  24 \
+  22 \
+  16
+
+BUILT_PNG_ICONS = $(patsubst %,etc/icons/octave-logo-%.png,$(icon_PNG_SIZES))
+
+WINDOWS_PNG_ICONS = $(filter %-16.png %-32.png %-48.png %-256.png,$(BUILT_PNG_ICONS))
+
+BUILT_ICONS = \
+  $(BUILT_PNG_ICONS) \
+  etc/icons/octave-logo.ico
+
+EXTRA_DIST += \
+  $(BUILT_ICONS) \
+  $(icon_IMAGE_FILES) \
+  etc/icons/octave.appdata.xml.in \
+  etc/icons/octave.desktop.in
+
+image_DATA = \
+  $(icon_IMAGE_FILES) \
+  octave-logo.ico
+
+VENDOR = www.octave.org
+
+all-icons: etc/icons/octave.appdata.xml etc/icons/octave.desktop $(BUILT_ICONS)
+
+etc/icons/octave.appdata.xml: etc/iconst/octave.appdata.xml.in Makefile
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(SED) < $< > $@-t \
+	  -e "s|%OCTAVE_DESKTOP_FILE%|${VENDOR}-octave.desktop|" && \
+	mv $@-t $@
+
+etc/icons/octave.desktop: etc/icons/octave.desktop.in Makefile
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(SED) < $< > $@-t \
+	  -e "s|%OCTAVE_IMAGEDIR%|${imagedir}|" \
+	  -e "s|%OCTAVE_PREFIX%|${prefix}|" && \
+	mv $@-t $@
+
+$(BUILT_PNG_ICONS): etc/icons/octave-logo.svg
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(RSVG_CONVERT) -w $(lastword $(subst -, ,$(patsubst %.png,%,$@))) $< > $@-t && \
+	mv $@-t $@
+
+etc/icons/octave-logo.ico: $(WINDOWS_PNG_ICONS)
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(ICOTOOL) --create --raw $^ > $@-t && \
+	mv $@-t $@
+
+install-icons:
+	-if test -n "$(DESKTOP_FILE_INSTALL)"; then \
+	  $(DESKTOP_FILE_INSTALL) --dir=$(DESTDIR)$(datadir)/applications \
+	    --vendor $(VENDOR) octave.desktop; \
+	fi
+	for f in $(BUILT_PNG_ICONS); do \
+	  size=`echo $$f | $(SED) -n -e "s/.*-\([0-9]\+\)\.png/\1/p"`; \
+	  if test -f $$f; then d=; else d="$(srcdir)/etc/icons/"; fi; \
+	  $(MKDIR_P) $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps; \
+	  $(INSTALL_DATA) "$$d$$f" $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps/octave.png; \
+	done
+	$(MKDIR_P) $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps
+	$(INSTALL_DATA) $(srcdir)/etc/icons/octave-logo.svg $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/octave.svg
+	$(MKDIR_P) $(DESTDIR)$(datadir)/appdata
+	$(INSTALL_DATA) etc/icons/octave.appdata.xml $(DESTDIR)$(datadir)/appdata/$(VENDOR)-octave.appdata.xml
+
+uninstall-icons:
+	if test -n "$(DESKTOP_FILE_INSTALL)"; then \
+	  rm -f $(DESTDIR)$(datadir)/applications/$(VENDOR)-octave.desktop; \
+	fi
+	for f in $(BUILT_PNG_ICONS); do \
+	  size=`echo $$f | $(SED) -n -e "s/.*-\([0-9]\+\)\.png/\1/p"`; \
+	  rm -f $(DESTDIR)$(datadir)/icons/hicolor/$${size}x$${size}/apps/octave.png; \
+	done
+	rm -f $(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/octave.svg
+	rm -f $(DESTDIR)$(datadir)/appdata/$(VENDOR)-octave.appdata.xml
+
+CLEANFILES += \
+  etc/icons/octave.appdata.xml \
+  etc/icons/octave.desktop
+
+MAINTAINERCLEANFILES += \
+  $(BUILT_ICONS)
+