>From 4e8050480e8a9565f0f7ff787e064801fcdfe666 Mon Sep 17 00:00:00 2001
From: Quentin Glidic <sardemff7+git@sardemff7.net>
Date: Sun, 8 Apr 2012 20:16:26 +0200
Subject: [PATCH] build: Autotools cleanup

---
 Makefile.am                            |  152 +++++++++++++++++++++++++-------
 addons/Makefile.am                     |    4 -
 addons/src/Makefile.am                 |    6 +-
 build/vars.auxfiles.mk                 |    9 +-
 build/vars.docs.mk                     |    7 --
 codenav/Makefile.am                    |    4 -
 codenav/src/Makefile.am                |    6 +-
 debugger/Makefile.am                   |    5 --
 debugger/img/Makefile.am               |   11 +--
 debugger/src/Makefile.am               |    5 --
 devhelp/Makefile.am                    |    4 -
 devhelp/devhelp/Makefile.am            |    2 -
 devhelp/src/Makefile.am                |    4 -
 geanydoc/Makefile.am                   |    4 -
 geanydoc/src/Makefile.am               |    6 +-
 geanyextrasel/Makefile.am              |    4 -
 geanyextrasel/src/Makefile.am          |    4 -
 geanygdb/Makefile.am                   |    4 -
 geanygdb/src/Makefile.am               |    5 --
 geanygendoc/Makefile.am                |    5 --
 geanygendoc/docs/Makefile.am           |   17 ++--
 geanyinsertnum/Makefile.am             |    4 -
 geanyinsertnum/src/Makefile.am         |    4 -
 geanylatex/Makefile.am                 |    4 -
 geanylatex/doc/Makefile.am             |    8 +-
 geanylipsum/Makefile.am                |    4 -
 geanylipsum/src/Makefile.am            |    4 -
 geanylua/Makefile.am                   |   16 +---
 geanylua/docs/Makefile.am              |   13 +--
 geanymacro/Makefile.am                 |    4 -
 geanymacro/src/Makefile.am             |    4 -
 geanyminiscript/Makefile.am            |    4 -
 geanyminiscript/src/Makefile.am        |    4 -
 geanynumberedbookmarks/Makefile.am     |    4 -
 geanynumberedbookmarks/src/Makefile.am |    4 -
 geanypg/Makefile.am                    |    4 -
 geanypg/src/Makefile.am                |    4 -
 geanyprj/Makefile.am                   |    4 -
 geanyprj/src/Makefile.am               |    5 +-
 geanyprj/tests/Makefile.am             |    2 +-
 geanysendmail/Makefile.am              |    4 -
 geanysendmail/src/Makefile.am          |    4 -
 geanyvc/Makefile.am                    |    4 -
 geanyvc/src/Makefile.am                |   19 ++--
 geanyvc/tests/Makefile.am              |    4 +-
 gproject/Makefile.am                   |    4 -
 gproject/icons/Makefile.am             |    9 +-
 gproject/src/Makefile.am               |    5 +-
 multiterm/Makefile.am                  |    7 +-
 multiterm/src/Makefile.am              |   10 +--
 pretty-printer/Makefile.am             |    2 +-
 pretty-printer/src/Makefile.am         |    4 -
 shiftcolumn/Makefile.am                |    4 -
 shiftcolumn/src/Makefile.am            |    4 -
 spellcheck/Makefile.am                 |    6 --
 spellcheck/src/Makefile.am             |    4 -
 tableconvert/Makefile.am               |    4 -
 tableconvert/src/Makefile.am           |    4 -
 treebrowser/Makefile.am                |    5 --
 treebrowser/src/Makefile.am            |    4 -
 updatechecker/Makefile.am              |    4 -
 updatechecker/src/Makefile.am          |    4 -
 webhelper/Makefile.am                  |    7 +-
 webhelper/src/Makefile.am              |    4 -
 xmlsnippets/Makefile.am                |    4 -
 xmlsnippets/src/Makefile.am            |    4 -
 66 files changed, 165 insertions(+), 341 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index f6d203c..4700853 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,39 +1,123 @@
-plugins = \
-	addons \
-	codenav \
-	debugger \
-	devhelp \
-	geanydoc \
-	geanyextrasel \
-	geanygdb \
-	geanygendoc \
-	geanyinsertnum \
-	geanylatex \
-	geanylipsum \
-	geanylua \
-	geanymacro \
-	geanyminiscript \
-	geanynumberedbookmarks \
-	geanypg \
-	geanyprj \
-	geanysendmail \
-	geanyvc \
-	gproject \
-	multiterm \
-	pretty-printer \
-	shiftcolumn \
-	spellcheck \
-	tableconvert \
-	treebrowser \
-	updatechecker \
-	webhelper \
-	xmlsnippets
-
 ACLOCAL_AMFLAGS = -I build/cache -I build -I build/bundled --install
 
-SUBDIRS = \
-	po \
-	$(plugins)
+SUBDIRS = po
+
+if ENABLE_ADDONS
+SUBDIRS += addons
+endif
+
+if ENABLE_CODENAV
+SUBDIRS += codenav
+endif
+
+if ENABLE_DEBUGGER
+SUBDIRS += debugger
+endif
+
+if ENABLE_DEVHELP
+SUBDIRS += devhelp
+endif
+
+if ENABLE_GEANYDOC
+SUBDIRS += geanydoc
+endif
+
+if ENABLE_GEANYEXTRASEL
+SUBDIRS += geanyextrasel
+endif
+
+if ENABLE_GEANYGDB
+SUBDIRS += geanygdb
+endif
+
+if ENABLE_GEANYGENDOC
+SUBDIRS += geanygendoc
+endif
+
+if ENABLE_GEANYINSERTNUM
+SUBDIRS += geanyinsertnum
+endif
+
+if ENABLE_GEANYLATEX
+SUBDIRS += geanylatex
+endif
+
+if ENABLE_GEANYLIPSUM
+SUBDIRS += geanylipsum
+endif
+
+if ENABLE_GEANYLUA
+SUBDIRS += geanylua
+endif
+
+if ENABLE_GEANYMACRO
+SUBDIRS += geanymacro
+endif
+
+if ENABLE_GEANYMINISCRIPT
+SUBDIRS += geanyminiscript
+endif
+
+if ENABLE_GEANYNUMBEREDBOOKMARKS
+SUBDIRS += geanynumberedbookmarks
+endif
+
+if ENABLE_GEANYPG
+SUBDIRS += geanypg
+endif
+
+if ENABLE_GEANYPRJ
+SUBDIRS += geanyprj
+endif
+
+if ENABLE_GEANYSENDMAIL
+SUBDIRS += geanysendmail
+endif
+
+if ENABLE_GEANYVC
+SUBDIRS += geanyvc
+endif
+
+if ENABLE_GPROJECT
+SUBDIRS += gproject
+endif
+
+if ENABLE_MULTITERM
+SUBDIRS += multiterm
+endif
+
+if ENABLE_PRETTY_PRINTER
+SUBDIRS += pretty-printer
+endif
+
+if ENABLE_SHIFTCOLUMN
+SUBDIRS += shiftcolumn
+endif
+
+if ENABLE_SPELLCHECK
+SUBDIRS += spellcheck
+endif
+
+if ENABLE_TABLECONVERT
+SUBDIRS += tableconvert
+endif
+
+if ENABLE_TREEBROWSER
+SUBDIRS += treebrowser
+endif
+
+if ENABLE_UPDATECHECKER
+SUBDIRS += updatechecker
+endif
+
+if ENABLE_WEBHELPER
+SUBDIRS += webhelper
+endif
+
+if ENABLE_XMLSNIPPETS
+SUBDIRS += xmlsnippets
+endif
+
 
 EXTRA_DIST = \
 	build/__init__.py \
diff --git a/addons/Makefile.am b/addons/Makefile.am
index c37ea98..535fd18 100644
--- a/addons/Makefile.am
+++ b/addons/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_ADDONS
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src
 plugin = addons
diff --git a/addons/src/Makefile.am b/addons/src/Makefile.am
index eabb6e8..6e497d7 100644
--- a/addons/src/Makefile.am
+++ b/addons/src/Makefile.am
@@ -1,10 +1,8 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_ADDONS
+plugin = addons
+
 geanyplugins_LTLIBRARIES = addons.la
-else
-EXTRA_LTLIBRARIES = addons.la
-endif
 
 addons_la_SOURCES = \
 	addons.h \
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/codenav/Makefile.am b/codenav/Makefile.am
index 7df49d0..ba8ab22 100644
--- a/codenav/Makefile.am
+++ b/codenav/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_CODENAV
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src
 plugin = codenav
diff --git a/codenav/src/Makefile.am b/codenav/src/Makefile.am
index 0fff63e..0403d5e 100644
--- a/codenav/src/Makefile.am
+++ b/codenav/src/Makefile.am
@@ -1,10 +1,8 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_CODENAV
+plugin = codenav
+
 geanyplugins_LTLIBRARIES = codenav.la
-else
-EXTRA_LTLIBRARIES = codenav.la
-endif
 
 codenav_la_SOURCES = \
 	codenavigation.c \
diff --git a/debugger/Makefile.am b/debugger/Makefile.am
index 378e214..b428991 100644
--- a/debugger/Makefile.am
+++ b/debugger/Makefile.am
@@ -1,9 +1,4 @@
-if ENABLE_DEBUGGER
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-EXTRA_DIST =
-endif
 
 SUBDIRS = src img
 plugin = debugger
diff --git a/debugger/img/Makefile.am b/debugger/img/Makefile.am
index 191ad07..084234e 100644
--- a/debugger/img/Makefile.am
+++ b/debugger/img/Makefile.am
@@ -1,7 +1,8 @@
 include $(top_srcdir)/build/vars.docs.mk
 
 plugin = debugger
-FILES = \
+
+dist_plugindata_DATA = \
 	continue.png \
 	restart.gif \
 	run.gif \
@@ -11,11 +12,3 @@ 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/debugger/src/Makefile.am b/debugger/src/Makefile.am
index 7a8284b..cd7975c 100644
--- a/debugger/src/Makefile.am
+++ b/debugger/src/Makefile.am
@@ -3,11 +3,7 @@ include $(top_srcdir)/build/vars.docs.mk
 
 SUBDIRS = xpm
 
-if ENABLE_DEBUGGER
 geanyplugins_LTLIBRARIES = debugger.la
-else
-EXTRA_LTLIBRARIES = debugger.la
-endif
 
 plugin = debugger
 
@@ -66,7 +62,6 @@ debugger_la_SOURCES = \
 	cell_renderers/cellrendererframeicon.h \
 	cell_renderers/cellrenderertoggle.c \
 	cell_renderers/cellrenderertoggle.h
-	
 
 debugger_la_LIBADD = $(COMMONLIBS) $(VTE_LIBS) -lutil
 debugger_la_CFLAGS = $(AM_CFLAGS) $(VTE_CFLAGS) -DDBGPLUG_DATA_DIR=\"$(plugindatadir)\" -DPLUGIN_NAME=\"$(plugin)\"
diff --git a/devhelp/Makefile.am b/devhelp/Makefile.am
index 68d3a87..7bc6d5f 100644
--- a/devhelp/Makefile.am
+++ b/devhelp/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_DEVHELP
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = devhelp src data
 plugin = devhelp
diff --git a/devhelp/devhelp/Makefile.am b/devhelp/devhelp/Makefile.am
index a289e23..a962dc9 100644
--- a/devhelp/devhelp/Makefile.am
+++ b/devhelp/devhelp/Makefile.am
@@ -1,6 +1,4 @@
-if ENABLE_DEVHELP
 noinst_LTLIBRARIES = libdevhelp-2.la
-endif
 
 dh_headers = \
 	dh-assistant.h \
diff --git a/devhelp/src/Makefile.am b/devhelp/src/Makefile.am
index cf782d7..ac15bb8 100644
--- a/devhelp/src/Makefile.am
+++ b/devhelp/src/Makefile.am
@@ -2,11 +2,7 @@ include $(top_srcdir)/build/vars.build.mk
 
 plugin = devhelp
 
-if ENABLE_DEVHELP
 geanyplugins_LTLIBRARIES = devhelp.la
-else
-EXTRA_LTLIBRARIES = devhelp.la
-endif
 
 devhelp_la_SOURCES = \
 	dhp-manpages.c \
diff --git a/geanydoc/Makefile.am b/geanydoc/Makefile.am
index a25166f..49639df 100644
--- a/geanydoc/Makefile.am
+++ b/geanydoc/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_GEANYDOC
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src tests
 plugin = geanydoc
diff --git a/geanydoc/src/Makefile.am b/geanydoc/src/Makefile.am
index 8f40db5..bd2aec8 100644
--- a/geanydoc/src/Makefile.am
+++ b/geanydoc/src/Makefile.am
@@ -1,10 +1,8 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYDOC
+plugin = geanydoc
+
 geanyplugins_LTLIBRARIES = geanydoc.la
-else
-EXTRA_LTLIBRARIES = geanydoc.la
-endif
 
 geanydoc_la_SOURCES = \
 	config.c \
diff --git a/geanyextrasel/Makefile.am b/geanyextrasel/Makefile.am
index 338ecaa..5febcd4 100644
--- a/geanyextrasel/Makefile.am
+++ b/geanyextrasel/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_GEANYEXTRASEL
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src
 plugin = geanyextrasel
diff --git a/geanyextrasel/src/Makefile.am b/geanyextrasel/src/Makefile.am
index 0e42a6d..36e9bc2 100644
--- a/geanyextrasel/src/Makefile.am
+++ b/geanyextrasel/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYEXTRASEL
 geanyplugins_LTLIBRARIES = geanyextrasel.la
-else
-EXTRA_LTLIBRARIES = geanyextrasel.la
-endif
 
 geanyextrasel_la_SOURCES = extrasel.c
 geanyextrasel_la_LIBADD = $(COMMONLIBS)
diff --git a/geanygdb/Makefile.am b/geanygdb/Makefile.am
index 6a5a16e..9386f6e 100644
--- a/geanygdb/Makefile.am
+++ b/geanygdb/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_GEANYGDB
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src tests
 plugin = geanygdb
diff --git a/geanygdb/src/Makefile.am b/geanygdb/src/Makefile.am
index fce4bb4..bdf1776 100644
--- a/geanygdb/src/Makefile.am
+++ b/geanygdb/src/Makefile.am
@@ -1,13 +1,8 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYGDB
 geanygdbdir = $(libexecdir)/geany-plugins/geanygdb
 geanyplugins_LTLIBRARIES = geanygdb.la
 geanygdb_PROGRAMS = ttyhelper
-else
-EXTRA_LTLIBRARIES = geanygdb.la
-EXTRA_PROGRAMS = ttyhelper
-endif
 
 geanygdb_la_SOURCES = \
 	gdb-io.h \
diff --git a/geanygendoc/Makefile.am b/geanygendoc/Makefile.am
index bfcb932..724556f 100644
--- a/geanygendoc/Makefile.am
+++ b/geanygendoc/Makefile.am
@@ -1,9 +1,4 @@
-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
 plugin = geanygendoc
diff --git a/geanygendoc/docs/Makefile.am b/geanygendoc/docs/Makefile.am
index 02df8ce..70b5515 100644
--- a/geanygendoc/docs/Makefile.am
+++ b/geanygendoc/docs/Makefile.am
@@ -1,20 +1,17 @@
-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
+# FIXME: CSS?
+
+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/geanyinsertnum/Makefile.am b/geanyinsertnum/Makefile.am
index ecdc3ce..abee54e 100644
--- a/geanyinsertnum/Makefile.am
+++ b/geanyinsertnum/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_GEANYINSERTNUM
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src
 plugin = geanyinsertnum
diff --git a/geanyinsertnum/src/Makefile.am b/geanyinsertnum/src/Makefile.am
index 5914fe0..04caa29 100644
--- a/geanyinsertnum/src/Makefile.am
+++ b/geanyinsertnum/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYINSERTNUM
 geanyplugins_LTLIBRARIES = geanyinsertnum.la
-else
-EXTRA_LTLIBRARIES = geanyinsertnum.la
-endif
 
 geanyinsertnum_la_SOURCES = insertnum.c
 geanyinsertnum_la_LIBADD = $(COMMONLIBS)
diff --git a/geanylatex/Makefile.am b/geanylatex/Makefile.am
index 1114d21..1035680 100644
--- a/geanylatex/Makefile.am
+++ b/geanylatex/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_GEANYLATEX
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src doc
 plugin = geanylatex
diff --git a/geanylatex/doc/Makefile.am b/geanylatex/doc/Makefile.am
index d6723f6..362579f 100644
--- a/geanylatex/doc/Makefile.am
+++ b/geanylatex/doc/Makefile.am
@@ -1,6 +1,6 @@
 include $(top_srcdir)/build/vars.docs.mk
 
-docfiles = \
+dist_plugindoc_DATA = \
 	geanylatex2.html \
 	geanylatex3.html \
 	geanylatex4.html \
@@ -16,9 +16,3 @@ docfiles = \
 	img/latexwizard.png \
 	img/plugin_manager.png \
 	img/toolbar.png
-
-EXTRA_DIST = $(docfiles)
-
-if ENABLE_GEANYLATEX
-plugindoc_DATA = $(docfiles)
-endif
diff --git a/geanylipsum/Makefile.am b/geanylipsum/Makefile.am
index d0d4dd7..b04cccf 100644
--- a/geanylipsum/Makefile.am
+++ b/geanylipsum/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_GEANYLIPSUM
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src
 plugin = geanylipsum
diff --git a/geanylipsum/src/Makefile.am b/geanylipsum/src/Makefile.am
index 6bf9bbe..969b2ee 100644
--- a/geanylipsum/src/Makefile.am
+++ b/geanylipsum/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYLIPSUM
 geanyplugins_LTLIBRARIES = geanylipsum.la
-else
-EXTRA_LTLIBRARIES = geanylipsum.la
-endif
 
 geanylipsum_la_SOURCES = geanylipsum.c
 geanylipsum_la_LIBADD = $(COMMONLIBS)
diff --git a/geanylua/Makefile.am b/geanylua/Makefile.am
index 3a1eb69..4694801 100644
--- a/geanylua/Makefile.am
+++ b/geanylua/Makefile.am
@@ -1,23 +1,13 @@
-# don't install docs if disabled
-if ENABLE_GEANYLUA
+include $(top_srcdir)/build/vars.build.mk
 include $(top_srcdir)/build/vars.auxfiles.mk
+
 plugin = geanylua
-else
-include $(top_srcdir)/build/vars.docs.mk
-EXTRA_DIST = $(AUXFILES)
-endif
-EXTRA_DIST += util
-include $(top_srcdir)/build/vars.build.mk
 
+EXTRA_DIST += util
 
-# don't build if disabled
-if ENABLE_GEANYLUA
 geanyplugins_LTLIBRARIES = geanylua.la
 geanyluadir = $(pkglibdir)/geanylua
 geanylua_LTLIBRARIES = libgeanylua.la
-else
-EXTRA_LTLIBRARIES = geanylua.la libgeanylua.la
-endif
 
 geanylua_la_SOURCES = geanylua.c
 libgeanylua_la_SOURCES = \
diff --git a/geanylua/docs/Makefile.am b/geanylua/docs/Makefile.am
index 439e8cd..dc3a433 100644
--- a/geanylua/docs/Makefile.am
+++ b/geanylua/docs/Makefile.am
@@ -1,12 +1,8 @@
-# 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 \
@@ -14,10 +10,3 @@ DOCFILES = \
 	geanylua-keys.html \
 	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/geanymacro/Makefile.am b/geanymacro/Makefile.am
index 026a832..0a52da5 100644
--- a/geanymacro/Makefile.am
+++ b/geanymacro/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_GEANYMACRO
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src
 plugin = geanymacro
diff --git a/geanymacro/src/Makefile.am b/geanymacro/src/Makefile.am
index 9933e36..a19baea 100644
--- a/geanymacro/src/Makefile.am
+++ b/geanymacro/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYMACRO
 geanyplugins_LTLIBRARIES = geanymacro.la
-else
-EXTRA_LTLIBRARIES = geanymacro.la
-endif
 
 geanymacro_la_SOURCES = geanymacro.c
 geanymacro_la_LIBADD = $(COMMONLIBS)
diff --git a/geanyminiscript/Makefile.am b/geanyminiscript/Makefile.am
index 4cb8a7a..ef4dfbe 100644
--- a/geanyminiscript/Makefile.am
+++ b/geanyminiscript/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_GEANYMINISCRIPT
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src
 plugin = geanyminiscript
diff --git a/geanyminiscript/src/Makefile.am b/geanyminiscript/src/Makefile.am
index 5dc89c8..bc7c7a5 100644
--- a/geanyminiscript/src/Makefile.am
+++ b/geanyminiscript/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYMINISCRIPT
 geanyplugins_LTLIBRARIES = geanyminiscript.la
-else
-EXTRA_LTLIBRARIES = geanyminiscript.la
-endif
 
 geanyminiscript_la_SOURCES = gms.c gms.h gms_gui.c gms_gui.h gms_debug.h
 geanyminiscript_la_LIBADD = $(COMMONLIBS)
diff --git a/geanynumberedbookmarks/Makefile.am b/geanynumberedbookmarks/Makefile.am
index 09b0efd..d2fd310 100644
--- a/geanynumberedbookmarks/Makefile.am
+++ b/geanynumberedbookmarks/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_GEANYNUMBEREDBOOKMARKS
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src
 plugin = geanynumberedbookmarks
diff --git a/geanynumberedbookmarks/src/Makefile.am b/geanynumberedbookmarks/src/Makefile.am
index a0677cf..455aca5 100644
--- a/geanynumberedbookmarks/src/Makefile.am
+++ b/geanynumberedbookmarks/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYNUMBEREDBOOKMARKS
 geanyplugins_LTLIBRARIES = geanynumberedbookmarks.la
-else
-EXTRA_LTLIBRARIES = geanynumberedbookmarks.la
-endif
 
 geanynumberedbookmarks_la_SOURCES = geanynumberedbookmarks.c
 geanynumberedbookmarks_la_LIBADD = $(COMMONLIBS)
diff --git a/geanypg/Makefile.am b/geanypg/Makefile.am
index d154934..1d801e0 100644
--- a/geanypg/Makefile.am
+++ b/geanypg/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_GEANYPG
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src
 plugin = geanypg
diff --git a/geanypg/src/Makefile.am b/geanypg/src/Makefile.am
index 2bcd815..f6116fe 100644
--- a/geanypg/src/Makefile.am
+++ b/geanypg/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYPG
 geanyplugins_LTLIBRARIES = geanypg.la
-else
-EXTRA_LTLIBRARIES = geanypg.la
-endif
 
 geanypg_la_SOURCES = \
 	helper_functions.c \
diff --git a/geanyprj/Makefile.am b/geanyprj/Makefile.am
index a44d69f..9b7cac9 100644
--- a/geanyprj/Makefile.am
+++ b/geanyprj/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_GEANYPRJ
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src tests
 plugin = geanyprj
diff --git a/geanyprj/src/Makefile.am b/geanyprj/src/Makefile.am
index aae5b45..53d4e87 100644
--- a/geanyprj/src/Makefile.am
+++ b/geanyprj/src/Makefile.am
@@ -1,10 +1,7 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYPRJ
 geanyplugins_LTLIBRARIES = geanyprj.la
-else
-EXTRA_LTLIBRARIES = geanyprj.la
-endif
+
 geanyprj_la_SOURCES = geanyprj.c \
 	geanyprj.h \
 	menu.c \
diff --git a/geanyprj/tests/Makefile.am b/geanyprj/tests/Makefile.am
index 3f3d3c8..ff76677 100644
--- a/geanyprj/tests/Makefile.am
+++ b/geanyprj/tests/Makefile.am
@@ -2,7 +2,7 @@ if UNITTESTS
 include $(top_srcdir)/build/vars.build.mk
 INCLUDES = $(GEANY_CFLAGS) -I$(srcdir)/../src -DUNITTESTS
 TESTS=unittests
-noinst_PROGRAMS=unittests
+check_PROGRAMS=unittests
 unittests_SOURCES = unittests.c ../src/utils.c
 unittests_LDADD  = @GEANY_LIBS@ $(INTLLIBS) @CHECK_LIBS@
 endif
diff --git a/geanysendmail/Makefile.am b/geanysendmail/Makefile.am
index 2da4a21..2a1e109 100644
--- a/geanysendmail/Makefile.am
+++ b/geanysendmail/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_GEANYSENDMAIL
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src
 plugin = geanysendmail
diff --git a/geanysendmail/src/Makefile.am b/geanysendmail/src/Makefile.am
index f1f6256..d88465d 100644
--- a/geanysendmail/src/Makefile.am
+++ b/geanysendmail/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYSENDMAIL
 geanyplugins_LTLIBRARIES = geanysendmail.la
-else
-EXTRA_LTLIBRARIES = geanysendmail.la
-endif
 
 geanysendmail_la_SOURCES = geanysendmail.c icon.h
 geanysendmail_la_LIBADD = $(COMMONLIBS)
diff --git a/geanyvc/Makefile.am b/geanyvc/Makefile.am
index 3c821c5..24ed6ec 100644
--- a/geanyvc/Makefile.am
+++ b/geanyvc/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_GEANYVC
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src tests
 plugin = geanyvc
diff --git a/geanyvc/src/Makefile.am b/geanyvc/src/Makefile.am
index 0b23319..2e8f302 100644
--- a/geanyvc/src/Makefile.am
+++ b/geanyvc/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GEANYVC
 geanyplugins_LTLIBRARIES = geanyvc.la
-else
-EXTRA_LTLIBRARIES = geanyvc.la
-endif
 
 geanyvc_la_SOURCES = \
 	externdiff.c \
@@ -18,14 +14,17 @@ geanyvc_la_SOURCES = \
 	vc_svn.c \
 	geanyvc.h
 
-geanyvc_la_CFLAGS = $(AM_CFLAGS)
-geanyvc_la_LIBADD = $(COMMONLIBS)
+geanyvc_la_CFLAGS = \
+	$(AM_CFLAGS) \
+	$(GTKSPELL_CFLAGS)
+
+geanyvc_la_LIBADD = \
+	$(COMMONLIBS) \
+	$(GTKSPELL_LIBS)
 
+# FIXME: ���
 if USE_GTKSPELL
-geanyvc_la_CFLAGS += \
-	-DUSE_GTKSPELL=1 \
-	$(GTKSPELL_CFLAGS)
-geanyvc_la_LIBADD += $(GTKSPELL_LIBS)
+geanyvc_la_CFLAGS += -DUSE_GTKSPELL=1
 endif
 
 include $(top_srcdir)/build/cppcheck.mk
diff --git a/geanyvc/tests/Makefile.am b/geanyvc/tests/Makefile.am
index e94301d..8df304d 100644
--- a/geanyvc/tests/Makefile.am
+++ b/geanyvc/tests/Makefile.am
@@ -1,10 +1,8 @@
 if UNITTESTS
-if ENABLE_GEANYVC
 include $(top_srcdir)/build/vars.build.mk
 INCLUDES = $(GEANY_CFLAGS) -DUNITTESTS
 TESTS=unittests
-noinst_PROGRAMS=unittests
+check_PROGRAMS=unittests
 unittests_SOURCES = unittests.c ../src/utils.c
 unittests_LDADD  = @GEANY_LIBS@ $(INTLLIBS) @CHECK_LIBS@
 endif
-endif
diff --git a/gproject/Makefile.am b/gproject/Makefile.am
index 3782c07..60039bc 100644
--- a/gproject/Makefile.am
+++ b/gproject/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_GPROJECT
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src icons
 plugin = gproject
diff --git a/gproject/icons/Makefile.am b/gproject/icons/Makefile.am
index 2e41176..0cc1d15 100644
--- a/gproject/icons/Makefile.am
+++ b/gproject/icons/Makefile.am
@@ -1,6 +1,6 @@
 icondir = $(datadir)/icons/hicolor/16x16/apps
 
-ICONS = \
+dist_icon_DATA = \
 	gproject-file.png	\
 	gproject-header.png	\
 	gproject-source.png	\
@@ -9,7 +9,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
@@ -22,9 +21,3 @@ update-icon-cache:
 		echo "*** Icon cache not updated.  After (un)install, run this:"; \
 		echo "***   $(gtk_update_icon_cache)"; \
 	fi
-
-if ENABLE_GPROJECT
-icon_DATA = $(ICONS)
-else
-EXTRA_DATA = $(ICONS)
-endif
diff --git a/gproject/src/Makefile.am b/gproject/src/Makefile.am
index 926c7c7..cd4177d 100644
--- a/gproject/src/Makefile.am
+++ b/gproject/src/Makefile.am
@@ -1,10 +1,7 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_GPROJECT
 geanyplugins_LTLIBRARIES = gproject.la
-else
-EXTRA_LTLIBRARIES = gproject.la
-endif
+
 gproject_la_SOURCES = \
 	gproject-main.c \
 	gproject-project.h \
diff --git a/multiterm/Makefile.am b/multiterm/Makefile.am
index 4394b20..2709637 100644
--- a/multiterm/Makefile.am
+++ b/multiterm/Makefile.am
@@ -1,11 +1,6 @@
-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/multiterm/src/Makefile.am b/multiterm/src/Makefile.am
index 7878747..70447ff 100644
--- a/multiterm/src/Makefile.am
+++ b/multiterm/src/Makefile.am
@@ -3,18 +3,14 @@ include $(top_srcdir)/build/vars.docs.mk
 
 plugin = multiterm
 
-if ENABLE_MULTITERM
 geanyplugins_LTLIBRARIES = multiterm.la
-else
-EXTRA_LTLIBRARIES = multiterm.la
-endif
 
-VALAFLAGS = \
+multiterm_la_VALAFLAGS = \
 	--vapidir $(top_srcdir)/multiterm/src/vapi \
 	--pkg gtk+-2.0 \
 	--pkg geany \
 	--pkg vte \
-	--header=multiterm.h \
+	--header multiterm.h \
 	--use-header
 
 multiterm_la_SOURCES = \
@@ -33,5 +29,3 @@ multiterm_la_CFLAGS = \
 
 multiterm_la_LIBADD = \
 	$(MULTITERM_LIBS)
-
-EXTRA_DIST = multiterm.h
diff --git a/pretty-printer/Makefile.am b/pretty-printer/Makefile.am
index 8c643f8..a82e819 100644
--- a/pretty-printer/Makefile.am
+++ b/pretty-printer/Makefile.am
@@ -1,4 +1,4 @@
-# include $(top_srcdir)/build/vars.auxfiles.mk
+#include $(top_srcdir)/build/vars.auxfiles.mk
 
 SUBDIRS = src
 plugin = codenav
diff --git a/pretty-printer/src/Makefile.am b/pretty-printer/src/Makefile.am
index 301f2c7..ee311bb 100644
--- a/pretty-printer/src/Makefile.am
+++ b/pretty-printer/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_PRETTY_PRINTER
 geanyplugins_LTLIBRARIES = pretty-printer.la
-else
-EXTRA_LTLIBRARIES = pretty-printer.la
-endif
 
 pretty_printer_la_SOURCES = \
 	PluginEntry.h \
diff --git a/shiftcolumn/Makefile.am b/shiftcolumn/Makefile.am
index 307e148..8cf4f2e 100644
--- a/shiftcolumn/Makefile.am
+++ b/shiftcolumn/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_SHIFTCOLUMN
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src
 plugin = shiftcolumn
diff --git a/shiftcolumn/src/Makefile.am b/shiftcolumn/src/Makefile.am
index d5a940c..2253824 100644
--- a/shiftcolumn/src/Makefile.am
+++ b/shiftcolumn/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_SHIFTCOLUMN
 geanyplugins_LTLIBRARIES = shiftcolumn.la
-else
-EXTRA_LTLIBRARIES = shiftcolumn.la
-endif
 
 shiftcolumn_la_SOURCES = shiftcolumn.c
 shiftcolumn_la_LIBADD = $(COMMONLIBS)
diff --git a/spellcheck/Makefile.am b/spellcheck/Makefile.am
index 0d53546..2ba187f 100644
--- a/spellcheck/Makefile.am
+++ b/spellcheck/Makefile.am
@@ -1,10 +1,4 @@
-# if spellcheck is disabled, we should distribute its files, but not install
-if ENABLE_SPELLCHECK
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-EXTRA_DIST = $(AUXFILES)
-endif
 
 SUBDIRS = src
 plugin = spellcheck
diff --git a/spellcheck/src/Makefile.am b/spellcheck/src/Makefile.am
index cb63876..6b98f5b 100644
--- a/spellcheck/src/Makefile.am
+++ b/spellcheck/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_SPELLCHECK
 geanyplugins_LTLIBRARIES = spellcheck.la
-else
-EXTRA_LTLIBRARIES = spellcheck.la
-endif
 
 spellcheck_la_SOURCES = \
 	scplugin.h \
diff --git a/tableconvert/Makefile.am b/tableconvert/Makefile.am
index 7bed00c..4818b96 100644
--- a/tableconvert/Makefile.am
+++ b/tableconvert/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_TABLECONVERT
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src
 plugin = tableconvert
diff --git a/tableconvert/src/Makefile.am b/tableconvert/src/Makefile.am
index 7f21055..c2c0987 100644
--- a/tableconvert/src/Makefile.am
+++ b/tableconvert/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_TABLECONVERT
 geanyplugins_LTLIBRARIES = tableconvert.la
-else
-EXTRA_LTLIBRARIES = tableconvert.la
-endif
 
 tableconvert_la_SOURCES = tableconvert.c
 tableconvert_la_LIBADD = $(COMMONLIBS)
diff --git a/treebrowser/Makefile.am b/treebrowser/Makefile.am
index 8463889..9165702 100644
--- a/treebrowser/Makefile.am
+++ b/treebrowser/Makefile.am
@@ -1,9 +1,4 @@
-if ENABLE_TREEBROWSER
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-EXTRA_DIST = $(AUXFILES)
-endif
 
 SUBDIRS = src
 plugin = treebrowser
diff --git a/treebrowser/src/Makefile.am b/treebrowser/src/Makefile.am
index 0da00e3..c0211d8 100644
--- a/treebrowser/src/Makefile.am
+++ b/treebrowser/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_TREEBROWSER
 geanyplugins_LTLIBRARIES = treebrowser.la
-else
-EXTRA_LTLIBRARIES = treebrowser.la
-endif
 
 treebrowser_la_SOURCES = treebrowser.c
 treebrowser_la_CFLAGS = $(AM_CFLAGS) $(GIO_CFLAGS)
diff --git a/updatechecker/Makefile.am b/updatechecker/Makefile.am
index a418f66..02d13f3 100644
--- a/updatechecker/Makefile.am
+++ b/updatechecker/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_UPDATECHECKER
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src
 plugin = updatechecker
diff --git a/updatechecker/src/Makefile.am b/updatechecker/src/Makefile.am
index 6d7e5c2..dc1a92f 100644
--- a/updatechecker/src/Makefile.am
+++ b/updatechecker/src/Makefile.am
@@ -1,11 +1,7 @@
 include $(top_srcdir)/build/vars.build.mk
 plugin = updatechecker
 
-if ENABLE_UPDATECHECKER
 geanyplugins_LTLIBRARIES = updatechecker.la
-else
-EXTRA_LTLIBRARIES = updatechecker.la
-endif
 
 updatechecker_la_SOURCES = updatechecker.c
 updatechecker_la_CPPFLAGS = \
diff --git a/webhelper/Makefile.am b/webhelper/Makefile.am
index 62baddf..daa59dd 100644
--- a/webhelper/Makefile.am
+++ b/webhelper/Makefile.am
@@ -1,11 +1,6 @@
-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
diff --git a/webhelper/src/Makefile.am b/webhelper/src/Makefile.am
index 3521030..dd14094 100644
--- a/webhelper/src/Makefile.am
+++ b/webhelper/src/Makefile.am
@@ -1,11 +1,7 @@
 include $(top_srcdir)/build/vars.build.mk
 plugin = webhelper
 
-if ENABLE_WEBHELPER
 geanyplugins_LTLIBRARIES = webhelper.la
-else
-EXTRA_LTLIBRARIES = webhelper.la
-endif
 
 
 GLIB_MKENUMS = @GLIB_MKENUMS@
diff --git a/xmlsnippets/Makefile.am b/xmlsnippets/Makefile.am
index 1d97880..be36185 100644
--- a/xmlsnippets/Makefile.am
+++ b/xmlsnippets/Makefile.am
@@ -1,8 +1,4 @@
-if ENABLE_XMLSNIPPETS
 include $(top_srcdir)/build/vars.auxfiles.mk
-else
-include $(top_srcdir)/build/vars.docs.mk
-endif
 
 SUBDIRS = src
 plugin = xmlsnippets
diff --git a/xmlsnippets/src/Makefile.am b/xmlsnippets/src/Makefile.am
index 50ba596..fce9266 100644
--- a/xmlsnippets/src/Makefile.am
+++ b/xmlsnippets/src/Makefile.am
@@ -1,10 +1,6 @@
 include $(top_srcdir)/build/vars.build.mk
 
-if ENABLE_XMLSNIPPETS
 geanyplugins_LTLIBRARIES = xmlsnippets.la
-else
-EXTRA_LTLIBRARIES = xmlsnippets.la
-endif
 
 xmlsnippets_la_SOURCES = \
 	plugin.c plugin.h \
-- 
1.7.9.6

