>From cc368a1d99c9a095e51cf973de28857740947a67 Mon Sep 17 00:00:00 2001
From: Quentin Glidic <sardemff7+git@sardemff7.net>
Date: Sat, 19 May 2012 12:18:19 +0200
Subject: [PATCH 2/9] Autotools: Avoid most EXTRA_DIST

Using dist_ prefix for the plugin doc and data files allows us to remove
some unneeded EXTRA_DIST
---
 build/vars.auxfiles.mk                  |    9 ++++++++-
 build/vars.docs.mk                      |    7 -------
 debugger/Makefile.am                    |    1 -
 debugger/img/Makefile.am                |   11 +++--------
 devhelp/data/Makefile.am                |   10 +++-------
 geanygendoc/Makefile.am                 |    1 -
 geanygendoc/data/filetypes/Makefile.am  |   16 ++++++----------
 geanygendoc/docs/Makefile.am            |   17 +++++++++--------
 geanylatex/doc/Makefile.am              |    7 ++-----
 geanylua/Makefile.am                    |    3 +--
 geanylua/docs/Makefile.am               |   10 +---------
 geanylua/examples/dialogs/Makefile.am   |   10 ++--------
 geanylua/examples/edit/Makefile.am      |   10 ++--------
 geanylua/examples/info/Makefile.am      |   10 ++--------
 geanylua/examples/scripting/Makefile.am |   10 ++--------
 geanylua/examples/work/Makefile.am      |   10 ++--------
 gproject/icons/Makefile.am              |    9 ++-------
 multiterm/Makefile.am                   |    3 +--
 spellcheck/Makefile.am                  |    1 -
 treebrowser/Makefile.am                 |    1 -
 webhelper/Makefile.am                   |    3 +--
 21 files changed, 47 insertions(+), 112 deletions(-)

diff --git a/build/vars.auxfiles.mk b/build/vars.auxfiles.mk
index 397ff62..6a8c707 100644
--- a/build/vars.auxfiles.mk
+++ b/build/vars.auxfiles.mk
@@ -1,6 +1,13 @@
 include $(top_srcdir)/build/vars.docs.mk
 
-plugindoc_DATA = $(AUXFILES)
+dist_plugindoc_DATA = \
+	README \
+	ChangeLog \
+	NEWS \
+	COPYING \
+	AUTHORS \
+	$(AUXFILES)
+
 EXTRA_DIST = \
 	wscript_build \
 	wscript_configure
diff --git a/build/vars.docs.mk b/build/vars.docs.mk
index d780b94..f2e5755 100644
--- a/build/vars.docs.mk
+++ b/build/vars.docs.mk
@@ -3,10 +3,3 @@ htmldocdir = $(plugindocdir)
 plugindatadir = $(pkgdatadir)/$(plugin)
 pluginlibdir = $(pkglibdir)/$(plugin)
 examplesdir = $(plugindatadir)
-AUXFILES = \
-	README \
-	ChangeLog \
-	NEWS \
-	COPYING \
-	AUTHORS
-
diff --git a/debugger/Makefile.am b/debugger/Makefile.am
index 378e214..f455400 100644
--- a/debugger/Makefile.am
+++ b/debugger/Makefile.am
@@ -2,7 +2,6 @@ if ENABLE_DEBUGGER
 include $(top_srcdir)/build/vars.auxfiles.mk
 else
 include $(top_srcdir)/build/vars.docs.mk
-EXTRA_DIST =
 endif
 
 SUBDIRS = src img
diff --git a/debugger/img/Makefile.am b/debugger/img/Makefile.am
index 191ad07..704f2f8 100644
--- a/debugger/img/Makefile.am
+++ b/debugger/img/Makefile.am
@@ -1,7 +1,9 @@
 include $(top_srcdir)/build/vars.docs.mk
 
 plugin = debugger
-FILES = \
+
+if ENABLE_DEBUGGER
+dist_plugindata_DATA = \
 	continue.png \
 	restart.gif \
 	run.gif \
@@ -11,11 +13,4 @@ FILES = \
 	step_over.gif \
 	stop.gif \
 	tabs.gif
-
-EXTRA_DIST = $(FILES)
-
-if ENABLE_DEBUGGER
-plugindata_DATA = $(FILES)
-else
-EXTRA_DATA = $(FILES)
 endif
diff --git a/devhelp/data/Makefile.am b/devhelp/data/Makefile.am
index 43392e8..bcc1538 100644
--- a/devhelp/data/Makefile.am
+++ b/devhelp/data/Makefile.am
@@ -1,17 +1,13 @@
+if ENABLE_DEVHELP
 include $(top_srcdir)/build/vars.docs.mk
 
 plugin = devhelp
-FILES = \
+
+dist_plugindata_DATA = \
 	devhelp-plugin.svg \
 	devhelp-plugin-48.png \
 	geany-devhelp-plugin.png \
 	home.html \
 	devhelp.conf
 
-EXTRA_DIST = $(FILES)
-
-if ENABLE_DEVHELP
-plugindata_DATA = $(FILES)
-else
-EXTRA_DATA = $(FILES)
 endif
diff --git a/geanygendoc/Makefile.am b/geanygendoc/Makefile.am
index bfcb932..25c50af 100644
--- a/geanygendoc/Makefile.am
+++ b/geanygendoc/Makefile.am
@@ -2,7 +2,6 @@ if ENABLE_GEANYGENDOC
 include $(top_srcdir)/build/vars.auxfiles.mk
 else
 include $(top_srcdir)/build/vars.docs.mk
-EXTRA_DIST = $(AUXFILES)
 endif
 
 SUBDIRS = src docs data
diff --git a/geanygendoc/data/filetypes/Makefile.am b/geanygendoc/data/filetypes/Makefile.am
index 01261af..b1463e0 100644
--- a/geanygendoc/data/filetypes/Makefile.am
+++ b/geanygendoc/data/filetypes/Makefile.am
@@ -1,15 +1,11 @@
 if ENABLE_GEANYGENDOC
+include $(top_srcdir)/build/vars.docs.mk
+
 plugin = geanygendoc
-# FIXME: should probably done by an included .mk such as vars.data.mk
-plugindatadir = $(pkgdatadir)/$(plugin)
-endif
+filetypesdir = $(plugindatadir)/filetypes
 
-FILETYPES = c.conf \
-            vala.conf
+dist_filetypes_DATA = \
+	c.conf \
+	vala.conf
 
-if ENABLE_GEANYGENDOC
-filetypesdir = $(plugindatadir)/filetypes
-filetypes_DATA = $(FILETYPES)
 endif
-
-EXTRA_DIST = $(FILETYPES)
diff --git a/geanygendoc/docs/Makefile.am b/geanygendoc/docs/Makefile.am
index 02df8ce..1d536e5 100644
--- a/geanygendoc/docs/Makefile.am
+++ b/geanygendoc/docs/Makefile.am
@@ -2,19 +2,20 @@ if ENABLE_GEANYGENDOC
 include $(top_srcdir)/build/vars.docs.mk
 plugin = geanygendoc
 pluginhtmldocdir = $(plugindocdir)/html
-endif ENABLE_GEANYGENDOC
 
-EXTRA_DIST = manual.rst \
-             manual.css \
-             html4css1.css \
-             manual.html
+EXTRA_DIST = \
+	manual.css \
+	html4css1.css
 
-if ENABLE_GEANYGENDOC
-plugindoc_DATA = manual.rst
-pluginhtmldoc_DATA = manual.html
+dist_plugindoc_DATA = \
+	manual.rst
+
+dist_pluginhtmldoc_DATA = \
+	manual.html
 
 if BUILD_RST
 manual.html: manual.rst manual.css
 	$(AM_V_GEN) $(RST2HTML) -d --strict --stylesheet-path manual.css $< $@
 endif BUILD_RST
+
 endif ENABLE_GEANYGENDOC
diff --git a/geanylatex/doc/Makefile.am b/geanylatex/doc/Makefile.am
index d6723f6..a6d9111 100644
--- a/geanylatex/doc/Makefile.am
+++ b/geanylatex/doc/Makefile.am
@@ -1,6 +1,7 @@
+if ENABLE_GEANYLATEX
 include $(top_srcdir)/build/vars.docs.mk
 
-docfiles = \
+dist_plugindoc_DATA = \
 	geanylatex2.html \
 	geanylatex3.html \
 	geanylatex4.html \
@@ -17,8 +18,4 @@ docfiles = \
 	img/plugin_manager.png \
 	img/toolbar.png
 
-EXTRA_DIST = $(docfiles)
-
-if ENABLE_GEANYLATEX
-plugindoc_DATA = $(docfiles)
 endif
diff --git a/geanylua/Makefile.am b/geanylua/Makefile.am
index 3a1eb69..a3782c8 100644
--- a/geanylua/Makefile.am
+++ b/geanylua/Makefile.am
@@ -4,9 +4,8 @@ include $(top_srcdir)/build/vars.auxfiles.mk
 plugin = geanylua
 else
 include $(top_srcdir)/build/vars.docs.mk
-EXTRA_DIST = $(AUXFILES)
 endif
-EXTRA_DIST += util
+EXTRA_DIST = util
 include $(top_srcdir)/build/vars.build.mk
 
 
diff --git a/geanylua/docs/Makefile.am b/geanylua/docs/Makefile.am
index 439e8cd..dcd3bc6 100644
--- a/geanylua/docs/Makefile.am
+++ b/geanylua/docs/Makefile.am
@@ -1,12 +1,9 @@
-# don't include if geanylua's disabled, otherwise a whole bunch of empty
-# directories will be created
 if ENABLE_GEANYLUA
 include $(top_srcdir)/build/vars.docs.mk
-endif
 
 plugin = geanylua
 
-DOCFILES = \
+dist_htmldoc_DATA = \
 	geanylua-index.html \
 	geanylua-input.html \
 	geanylua-intro.html \
@@ -15,9 +12,4 @@ DOCFILES = \
 	geanylua-ref.html \
 	luarefv51.html
 
-if ENABLE_GEANYLUA
-htmldoc_DATA = $(DOCFILES)
 endif
-
-# make sure that these files are distributed as well
-EXTRA_DIST = $(DOCFILES)
diff --git a/geanylua/examples/dialogs/Makefile.am b/geanylua/examples/dialogs/Makefile.am
index 1b624b7..6d6daa4 100644
--- a/geanylua/examples/dialogs/Makefile.am
+++ b/geanylua/examples/dialogs/Makefile.am
@@ -1,17 +1,11 @@
-# avoid creating empty directories if disabled
 if ENABLE_GEANYLUA
 include $(top_srcdir)/build/vars.docs.mk
+
 plugin = geanylua
 dialogsdir = $(examplesdir)/dialogs
-endif
 
-EXAMPLES = \
+dist_dialogs_DATA = \
 	basic-dialogs.lua \
 	complex-dialog.lua
 
-if ENABLE_GEANYLUA
-dialogs_DATA = $(EXAMPLES)
 endif
-
-# make sure that these files are distributed as well
-EXTRA_DIST = $(EXAMPLES)
diff --git a/geanylua/examples/edit/Makefile.am b/geanylua/examples/edit/Makefile.am
index f853675..28d4886 100644
--- a/geanylua/examples/edit/Makefile.am
+++ b/geanylua/examples/edit/Makefile.am
@@ -1,11 +1,10 @@
-# avoid creating empty directories if disabled
 if ENABLE_GEANYLUA
 include $(top_srcdir)/build/vars.docs.mk
+
 plugin = geanylua
 editdir = $(examplesdir)/edit
-endif
 
-EXAMPLES = \
+dist_edit_DATA = \
 	calculator.lua \
 	lua-replace.lua \
 	proper-case.lua \
@@ -13,9 +12,4 @@ EXAMPLES = \
 	right-trim.lua \
 	select-block.lua
 
-if ENABLE_GEANYLUA
-edit_DATA = $(EXAMPLES)
 endif
-
-# make sure that these files are distributed as well
-EXTRA_DIST = $(EXAMPLES)
diff --git a/geanylua/examples/info/Makefile.am b/geanylua/examples/info/Makefile.am
index 34564ac..846ae16 100644
--- a/geanylua/examples/info/Makefile.am
+++ b/geanylua/examples/info/Makefile.am
@@ -1,20 +1,14 @@
-# avoid creating empty directories if disabled
 if ENABLE_GEANYLUA
 include $(top_srcdir)/build/vars.docs.mk
+
 plugin = geanylua
 exampleinfodir = $(examplesdir)/info
-endif
 
-EXAMPLES = \
+dist_exampleinfo_DATA = \
 	about.lua \
 	app-information.lua \
 	file-information.lua \
 	list-open-files.lua \
 	show-filename.lua
 
-if ENABLE_GEANYLUA
-exampleinfo_DATA = $(EXAMPLES)
 endif
-
-# make sure that these files are distributed as well
-EXTRA_DIST = $(EXAMPLES)
diff --git a/geanylua/examples/scripting/Makefile.am b/geanylua/examples/scripting/Makefile.am
index 35ed382..cb4dc7f 100644
--- a/geanylua/examples/scripting/Makefile.am
+++ b/geanylua/examples/scripting/Makefile.am
@@ -1,19 +1,13 @@
-# avoid creating empty directories if disabled
 if ENABLE_GEANYLUA
 include $(top_srcdir)/build/vars.docs.mk
+
 plugin = geanylua
 scriptingdir = $(examplesdir)/scripting
-endif
 
-EXAMPLES = \
+dist_scripting_DATA = \
 	help.lua \
 	open-script.lua \
 	rebuild-menu.lua \
 	show-examples.lua
 
-if ENABLE_GEANYLUA
-scripting_DATA = $(EXAMPLES)
 endif
-
-# make sure that these files are distributed as well
-EXTRA_DIST = $(EXAMPLES)
diff --git a/geanylua/examples/work/Makefile.am b/geanylua/examples/work/Makefile.am
index c0cee7b..0fbf6a0 100644
--- a/geanylua/examples/work/Makefile.am
+++ b/geanylua/examples/work/Makefile.am
@@ -1,18 +1,12 @@
-# avoid creating empty directories if disabled
 if ENABLE_GEANYLUA
 include $(top_srcdir)/build/vars.docs.mk
+
 plugin = geanylua
 workdir = $(examplesdir)/work
-endif
 
-EXAMPLES = \
+dist_work_DATA = \
 	01.edit-test-script.lua \
 	02.run-test-script.lua \
 	03.install-test-script.lua
 
-if ENABLE_GEANYLUA
-work_DATA = $(EXAMPLES)
 endif
-
-# make sure that these files are distributed as well
-EXTRA_DIST = $(EXAMPLES)
diff --git a/gproject/icons/Makefile.am b/gproject/icons/Makefile.am
index 2e41176..4c606b1 100644
--- a/gproject/icons/Makefile.am
+++ b/gproject/icons/Makefile.am
@@ -1,6 +1,7 @@
+if ENABLE_GPROJECT
 icondir = $(datadir)/icons/hicolor/16x16/apps
 
-ICONS = \
+dist_icon_DATA = \
 	gproject-file.png	\
 	gproject-header.png	\
 	gproject-source.png	\
@@ -9,8 +10,6 @@ ICONS = \
 	gproject-follow.png	\
 	gproject-refresh.png
 
-EXTRA_DIST = $(ICONS)
-
 gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
 install-data-hook: update-icon-cache
 uninstall-hook: update-icon-cache
@@ -23,8 +22,4 @@ update-icon-cache:
 		echo "***   $(gtk_update_icon_cache)"; \
 	fi
 
-if ENABLE_GPROJECT
-icon_DATA = $(ICONS)
-else
-EXTRA_DATA = $(ICONS)
 endif
diff --git a/multiterm/Makefile.am b/multiterm/Makefile.am
index 4394b20..f542d01 100644
--- a/multiterm/Makefile.am
+++ b/multiterm/Makefile.am
@@ -2,10 +2,9 @@ if ENABLE_MULTITERM
 include $(top_srcdir)/build/vars.auxfiles.mk
 else
 include $(top_srcdir)/build/vars.docs.mk
-EXTRA_DIST = $(AUXFILES)
 endif
 
-AUXFILES += TODO
+AUXFILES = TODO
 
 SUBDIRS = src
 plugin = multiterm
diff --git a/spellcheck/Makefile.am b/spellcheck/Makefile.am
index 0d53546..c0be5c9 100644
--- a/spellcheck/Makefile.am
+++ b/spellcheck/Makefile.am
@@ -3,7 +3,6 @@ if ENABLE_SPELLCHECK
 include $(top_srcdir)/build/vars.auxfiles.mk
 else
 include $(top_srcdir)/build/vars.docs.mk
-EXTRA_DIST = $(AUXFILES)
 endif
 
 SUBDIRS = src
diff --git a/treebrowser/Makefile.am b/treebrowser/Makefile.am
index 8463889..1e2bae1 100644
--- a/treebrowser/Makefile.am
+++ b/treebrowser/Makefile.am
@@ -2,7 +2,6 @@ if ENABLE_TREEBROWSER
 include $(top_srcdir)/build/vars.auxfiles.mk
 else
 include $(top_srcdir)/build/vars.docs.mk
-EXTRA_DIST = $(AUXFILES)
 endif
 
 SUBDIRS = src
diff --git a/webhelper/Makefile.am b/webhelper/Makefile.am
index 62baddf..89e58b7 100644
--- a/webhelper/Makefile.am
+++ b/webhelper/Makefile.am
@@ -2,10 +2,9 @@ if ENABLE_WEBHELPER
 include $(top_srcdir)/build/vars.auxfiles.mk
 else
 include $(top_srcdir)/build/vars.docs.mk
-EXTRA_DIST = $(AUXFILES)
 endif
 
-AUXFILES += TODO
+AUXFILES = TODO
 
 SUBDIRS = src
 plugin = webhelper
-- 
1.7.10.1

