Fix clean targets and DIST_SOURCES

Several subdirectories have a subdirectory "gnucash", which clean tried to remove by including in the CLEANFILES variable in Makefile.am. This doesn't work, because directories can't be removed with rm, they require rm -r. Add a clean-local: target which calls rm -r on the gnucash subdirectory.

Some Makefile.ams used an AC_SUBSTed variable to define an optionally-compiled subdirectory, then included the variable in SUBDIRS and the actual directory name in DIST_SUBDIRS. This breaks the distclean and maintainer-clean targets when the optional directory is built, because it is then processed twice, and there is no Makefile the second time so make halts. Replaced the AC_SUBSTed variables with ones local to the Makefile.am, switched with an AM_CONDITIONAL. That way automake can figure out the dist_subdirs on its own.

BP

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21570 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
John Ralls 2011-11-17 21:27:40 +00:00
parent 3365baa7ed
commit a2cd913a5c
19 changed files with 74 additions and 52 deletions

View File

@ -127,14 +127,14 @@ AC_ARG_ENABLE(gtkmm,
AS_IF([test x${enable_GTKMM} = "xtrue"],
[
GTKMM_DIR=gtkmm
# We require gtkmm, of course
PKG_CHECK_MODULES(GTKMM, gtkmm-2.4 >= 2.20)
# and also the c++ compiler
AC_PROG_CXXCPP
AC_PROG_CXX
_COMPONENTS="$_COMPONENTS gtkmm"
])
AC_SUBST(GTKMM_DIR)
AM_CONDITIONAL([WITH_GTKMM], [test x${enable_GTKMM} = "xtrue"])
# This section must come before AC_PROG_LIBTOOL because libtool
# must know about the c++ compiler.
###--------------------------------------------------------
@ -530,7 +530,7 @@ then
GNC_DBD_DIR="")
LIBDBI_LIBS=-ldbi
DBI_DIR=dbi
_COMPONENTS="$_COMPONENTS dbi"
else
AC_MSG_ERROR([
@ -543,9 +543,9 @@ then
fi
fi
AC_SUBST(LIBDBI_LIBS)
AC_SUBST(DBI_DIR)
AC_SUBST(GNC_DBD_DIR)
AM_CONDITIONAL(CUSTOM_GNC_DBD_DIR, [test x"$GNC_DBD_DIR" != "x"])
AM_CONDITIONAL(WITH_DBI, [test "x$ac_cv_header_dbi_dbi_h" != xno])
### --------------------------------------------------------------------------
### Variables
@ -618,12 +618,9 @@ case "${want_ofx}" in
esac
if test x${want_ofx} != xno ; then
PKG_CHECK_MODULES(LIBOFX, libofx, [want_ofx="yes"], [want_ofx="no"])
_COMPONENTS="$_COMPONENTS ofx"
fi
if test "x${want_ofx}" != xno ; then
OFX_DIR=ofx
fi
AC_SUBST(OFX_DIR)
AM_CONDITIONAL([WITH_OFX], [test "x${want_ofx}" != xno])
### --------------------------------------------------------------------------
### MT940
AC_ARG_ENABLE( mt940,
@ -651,8 +648,8 @@ then
# We require aqbanking-4.0.0 because our implementation doesn't run
# with earlier version anymore. (libaqbanking ships with a pkgconfig
# file since its version 1.6.1.)
PKG_CHECK_MODULES(AQBANKING, aqbanking >= 4.0.0 gwenhywfar, [AQBANKING_DIR=aqbanking], [
AC_MSG_ERROR([Could not find aqbanking >= 4.0.0. If you use --enable-aqbanking, you *have* to have aqbanking installed!])
PKG_CHECK_MODULES(AQBANKING, aqbanking >= 4.0.0 gwenhywfar, , [
AC_MSG_ERROR([Could not find aqbanking >= 4.0.0. If you use --enable-aqbanking, you MUST have aqbanking installed!])
])
# For libgwenhywfar > 3.99.20, look for its library gwengui-gtk2.
PKG_CHECK_MODULES([GWENGUI_GTK2], [gwengui-gtk2 gwenhywfar], [has_gwengui_gtk2=1], [has_gwengui_gtk2=0])
@ -666,8 +663,9 @@ then
AS_SCRUB_INCLUDE(AQBANKING_CFLAGS)
AC_SUBST(AQBANKING_LIBS)
AC_SUBST(AQBANKING_CFLAGS)
_COMPONENTS="$_COMPONENTS aqbanking"
fi
AC_SUBST(AQBANKING_DIR)
AM_CONDITIONAL([WITH_AQBANKING], [test x${want_aqbanking} = xyes])
AC_ARG_WITH(qt3_wizard_package,
[AS_HELP_STRING([--with-qt3-wizard-package=name],[name of package containing qt3-wizard (aqbanking)])],
@ -1092,14 +1090,11 @@ AC_ARG_ENABLE(python,
)
if test x${enable_python} = "xtrue"
then
PYTHON_DIR=python
PYTHON_BINDINGS_DIR=python-bindings
AM_PATH_PYTHON(2.4)
AC_PYTHON_DEVEL(>= '2.4')
SWIG_PYTHON
_COMPONENTS="$_COMPONENTS python"
fi
AC_SUBST(PYTHON_DIR)
AC_SUBST(PYTHON_BINDINGS_DIR)
AM_CONDITIONAL(WITH_PYTHON, [test x${enable_python} = xtrue])
AC_ARG_ENABLE(python-bindings,
@ -1365,28 +1360,13 @@ AC_CONFIG_FILES(
)
AC_OUTPUT
if test x${DBI_DIR} != x; then
components="$components dbi"
fi
if test x${OFX_DIR} != x; then
components="$components ofx"
fi
if test x${AQBANKING_DIR} != x; then
components="$components $AQBANKING_DIR"
fi
if test x${PYTHON_DIR} != x; then
components="$components python"
fi
if test x${GTKMM_DIR} != x; then
components="${components} ${GTKMM_DIR}"
fi
AC_MSG_RESULT([
Options detected/selected
-------------------------
gnucash version ...... : $VERSION
Build for host ....... : $host
Optional components... : $components
Optional components... : $_COMPONENTS
Extra Warnings ....... : $warnFLAGS
CPPFLAGS ............. : $CPPFLAGS
CFLAGS ............... : $CFLAGS

View File

@ -1,5 +1,4 @@
SUBDIRS = libc guile-www stf
DIST_SUBDIRS = libc guile-www stf
EXTRA_DIST = README

View File

@ -1,4 +1,8 @@
# These directories do not contain any gtk dependencies
if WITH_PYTHON
PYTHON_DIR = python
endif
NONGUI_SUBDIRS = \
libqof \
debug \
@ -37,7 +41,6 @@ GUI_SUBDIRS = \
# Need to include '.' in order to build swig-runtime.h
SUBDIRS = . $(NONGUI_SUBDIRS) $(ALMOST_NONGUI_SUBDIRS) $(GUI_SUBDIRS)
DIST_SUBDIRS = $(SUBDIRS) python
noinst_HEADERS = \
swig-runtime.h

View File

@ -181,7 +181,10 @@ if ! OS_WIN32
touch .scm-links
endif
CLEANFILES = ${SCM_FILE_LINKS} gnucash .scm-links
clean-local:
rm -rf gnucash
CLEANFILES = ${SCM_FILE_LINKS} .scm-links
MAINTAINERCLEANFILES = swig-app-utils-guile.c swig-app-utils-python.c
INCLUDES = -DG_LOG_DOMAIN=\"gnc.app-utils\"

View File

@ -1,3 +1,5 @@
if WITH_DBI
DBI_DIR=dbi
endif
SUBDIRS = xml sql ${DBI_DIR}
DIST_SUBDIRS = xml sql dbi

View File

@ -53,6 +53,9 @@ if ! OS_WIN32
endif
noinst_DATA = .scm-links
clean-local:
rm -rf gnucash
CLEANFILES = gnucash .scm-links ${SCM_FILE_LINKS}
MAINTAINERCLEANFILES =

View File

@ -121,6 +121,9 @@ if ! OS_WIN32
endif
noinst_DATA = .scm-links
CLEANFILES = $(BUILT_SOURCES) gnucash .scm-links ${SCM_FILE_LINKS}
clean-local:
rm -rf gnucash
CLEANFILES = $(BUILT_SOURCES) .scm-links ${SCM_FILE_LINKS}
INCLUDES = -DG_LOG_DOMAIN=\"gnc.business.gnome\"

View File

@ -75,7 +75,10 @@ if ! OS_WIN32
endif
noinst_DATA = .scm-links
CLEANFILES = gnucash .scm-links ${SCM_FILE_LINKS}
clean-local:
rm -rf gnucash
CLEANFILES = .scm-links ${SCM_FILE_LINKS}
MAINTAINERCLEANFILES = swig-dialog-tax-table.c
INCLUDES = -DG_LOG_DOMAIN=\"gnc.business.tax\"

View File

@ -79,7 +79,10 @@ endif
noinst_DATA = .scm-links
BUILT_SOURCES = gncla-dir.h gnc-version.h
EXTRA_DIST = $(gncmod_DATA) core-utils.i gncla-dir.h.in gnc-svninfo.h
CLEANFILES = $(BUILT_SOURCES) gnucash .scm-links
clean-local:
rm -rf gnucash
CLEANFILES = $(BUILT_SOURCES) .scm-links
MAINTAINERCLEANFILES = swig-core-utils.c
INCLUDES = -DG_LOG_DOMAIN=\"gnc.core-utils\"

View File

@ -209,8 +209,11 @@ iso-4217-currencies.c: iso-4217-currencies.scm iso-currencies-to-c
BUILT_SOURCES = iso-4217-currencies.c
CLEANFILES = $(BUILT_SOURCES) gnucash .scm-links \
CLEANFILES = $(BUILT_SOURCES) .scm-links \
${SCM_FILE_LINKS}
MAINTAINERCLEANFILES = swig-engine.c swig-business-core.c
clean-local:
rm -rf gnucash
INCLUDES = -DG_LOG_DOMAIN=\"gnc.engine\"

View File

@ -58,7 +58,10 @@ if ! OS_WIN32
touch .scm-links
endif
CLEANFILES = .scm-links gnucash ${SCM_FILE_LINKS}
clean-local:
rm -rf gnucash
CLEANFILES = .scm-links ${SCM_FILE_LINKS}
MAINTAINERCLEANFILES = swig-gnc-module.c
INCLUDES = -DG_LOG_DOMAIN=\"gnc.module\"

View File

@ -251,7 +251,10 @@ if ! OS_WIN32
endif
noinst_DATA = .scm-links
CLEANFILES = $(BUILT_SOURCES) gnucash .scm-links ${SCM_FILE_LINKS}
clean-local:
rm -rf gnucash
CLEANFILES = $(BUILT_SOURCES) .scm-links ${SCM_FILE_LINKS}
MAINTAINERCLEANFILES = swig-gnome-utils.c
# FIXME: Symlinking directories only works on non-win32.

View File

@ -1,7 +1,11 @@
if WITH_OFX
OFX_DIR=ofx
endif
if WITH_AQBANKING
AQBANKING_DIR=aqbanking
endif
SUBDIRS = . schemas qif qif-import \
${OFX_DIR} ${AQBANKING_DIR} log-replay test csv
DIST_SUBDIRS = schemas qif qif-import qif-io-core \
ofx aqbanking log-replay test csv
pkglib_LTLIBRARIES=libgncmod-generic-import.la

View File

@ -1,2 +1,7 @@
if WITH_PYTHON
PYTHON_BINDINGS_DIR = python-bindings
endif
if WITH_GTKMM
GTKMM_DIR=gtkmm
endif
SUBDIRS = ${PYTHON_BINDINGS_DIR} ${GTKMM_DIR}
DIST_SUBDIRS = python-bindings gtkmm

View File

@ -1,4 +1,4 @@
TESTS_ENVIRONMENT = PYTHONPATH=$(PYTHONPATH):$(pythondir) $(top_builddir)/src/bin/gnucash-env $(PYTHON)
TESTS_ENVIRONMENT = PYTHONPATH=$(PYTHONPATH):$(pythondir) $(top_builddir)/src/bin/gnucash-setup-env $(PYTHON)
TESTS = runTests.py
clean-local:

View File

@ -1,4 +1,4 @@
SUBDIRS = . pycons
SUBDIRS = pycons
#test
pkglib_LTLIBRARIES = libgncmod-python.la

View File

@ -12,8 +12,7 @@ GUI_SUBDIRS = \
if GNUCASH_ENABLE_GUI
SUBDIRS = $(NONGUI_SUBDIRS) $(GUI_SUBDIRS)
else
else
SUBDIRS = $(NONGUI_SUBDIRS)
endif
DIST_SUBDIRS = $(NONGUI_SUBDIRS) $(GUI_SUBDIRS)

View File

@ -100,7 +100,10 @@ if ! OS_WIN32
touch .scm-links
endif
CLEANFILES = gnucash report .scm-links ${SCM_FILE_LINKS}
clean-local:
rm -rf gnucash
CLEANFILES = report .scm-links ${SCM_FILE_LINKS}
MAINTAINERCLEANFILES = swig-report-gnome.c
INCLUDES = -DG_LOG_DOMAIN=\"gnc.report.gui\"

View File

@ -90,7 +90,10 @@ noinst_DATA = .scm-links
EXTRA_DIST = report-system.i ${gncscmmod_DATA} ${gncscm_DATA}
CLEANFILES = gnucash report .scm-links ${SCM_FILE_LINKS}
clean-local:
rm -rf gnucash
CLEANFILES = report .scm-links ${SCM_FILE_LINKS}
MAINTAINERCLEANFILES = swig-report-system.c
INCLUDES = -DG_LOG_DOMAIN=\"gnc.report.core\"