[glom] Build: Reduce some duplication.



commit 6673e996c5375e55893e58c87068d067f87c0521
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Dec 14 12:08:59 2010 +0100

    Build: Reduce some duplication.
    
    * Makefile.am:
    * Makefile_glom.am:
    * Makefile_libglom.am:
    * Makefile_tests.am: Use AM_CPPFLAGS and AM_CFLAGS just to hold the
    (optional) warning flags, as we did previously.

 ChangeLog           |   10 ++++++++++
 Makefile.am         |    6 ++++++
 Makefile_glom.am    |    2 --
 Makefile_libglom.am |    6 ------
 Makefile_tests.am   |   49 +------------------------------------------------
 5 files changed, 17 insertions(+), 56 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index de17c72..bb61d48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2010-12-14  Murray Cumming  <murrayc murrayc com>
 
+	Build: Reduce some duplication.
+
+	* Makefile.am:
+	* Makefile_glom.am:
+	* Makefile_libglom.am:
+	* Makefile_tests.am: Use AM_CPPFLAGS and AM_CFLAGS just to hold the 
+	(optional) warning flags, as we did previously.
+
+2010-12-14  Murray Cumming  <murrayc murrayc com>
+
 	Build: Avoid use of non-UI cflags/libs where not necessary. 
 
 	* Makefile.am: Do not use AM_CPPFLAGS, AM_CFLAGS or AM_CXXFLAGS.
diff --git a/Makefile.am b/Makefile.am
index 83826b4..90b8243 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -66,6 +66,12 @@ glom_defines = \
 -DGLOM_PKGDATADIR=\""$(pkgdatadir)"\" \
 -DGLOM_PKGDATADIR_NOTINSTALLED=\""$(top_srcdir)/glom"\"
 
+# We use these instead of individual variables,
+# to avoid repetition, becase we really want to use 
+# the same flags for everything:
+AM_CFLAGS   = $(GLOM_WFLAGS)
+AM_CXXFLAGS = $(GLOM_WXXFLAGS)
+
 if GLOM_ENABLE_UI
 include Makefile_glom.am
 endif
diff --git a/Makefile_glom.am b/Makefile_glom.am
index fcc6854..bc59e40 100644
--- a/Makefile_glom.am
+++ b/Makefile_glom.am
@@ -27,8 +27,6 @@ glom_includes += -I$(top_srcdir)/glom/utility_widgets/gimpruler
 bin_PROGRAMS = glom/glom
 
 glom_glom_CPPFLAGS = $(glom_includes) $(GLOM_CFLAGS) $(PYTHON_CPPFLAGS) $(BOOST_PYTHON_CFLAGS) $(glom_defines)
-glom_glom_CFLAGS   = $(GLOM_WFLAGS)
-glom_glom_CXXFLAGS = $(GLOM_WXXFLAGS)
 
 glom_source_files = \
 	glom/application.cc						\
diff --git a/Makefile_libglom.am b/Makefile_libglom.am
index e3f330b..5f17ba1 100644
--- a/Makefile_libglom.am
+++ b/Makefile_libglom.am
@@ -49,10 +49,6 @@ endif
 glom_libglom_libglom_ GLOM_ABI_VERSION@_la_LDFLAGS = -no-undefined
 
 glom_libglom_libglom_ GLOM_ABI_VERSION@_la_CPPFLAGS = $(glom_includes) $(LIBGLOM_CFLAGS) $(PYTHON_CPPFLAGS) $(BOOST_PYTHON_CFLAGS)
-glom_libglom_libglom_ GLOM_ABI_VERSION@_la_CFLAGS   = $(GLOM_WFLAGS)
-glom_libglom_libglom_ GLOM_ABI_VERSION@_la_CXXFLAGS = $(GLOM_WXXFLAGS)
-
-
 
 pyexec_LTLIBRARIES = glom/python_embed/python_module/glom_ GLOM_ABI_VERSION_UNDERLINED@.la
 
@@ -72,8 +68,6 @@ endif
 glom_pyexport = -export-symbols-regex '^_*initglom'
 glom_python_embed_python_module_glom_ GLOM_ABI_VERSION_UNDERLINED@_la_LDFLAGS = $(pymod_ldflags) $(glom_pyexport)
 glom_python_embed_python_module_glom_ GLOM_ABI_VERSION_UNDERLINED@_la_CPPFLAGS = $(glom_includes) $(LIBGLOM_CFLAGS) $(PYTHON_CPPFLAGS) $(BOOST_PYTHON_CFLAGS)
-glom_python_embed_python_module_glom_ GLOM_ABI_VERSION_UNDERLINED@_la_CFLAGS   = $(GLOM_WFLAGS)
-glom_python_embed_python_module_glom_ GLOM_ABI_VERSION_UNDERLINED@_la_CXXFLAGS = $(GLOM_WXXFLAGS)
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = glom/libglom/glom- GLOM_ABI_VERSION@.pc
diff --git a/Makefile_tests.am b/Makefile_tests.am
index a2a3f12..8e6f4ad 100644
--- a/Makefile_tests.am
+++ b/Makefile_tests.am
@@ -55,69 +55,49 @@ dist_noinst_SCRIPTS = tests/test_dtd_file_validation.sh \
 tests_ldadd = glom/libglom/libglom-$(GLOM_ABI_VERSION).la
 tests_cppflags = $(glom_includes) $(LIBGLOM_CFLAGS) $(PYTHON_CPPFLAGS) $(BOOST_PYTHON_CFLAGS) $(glom_defines)
 tests_cppflags_ui = $(glom_includes) $(GLOM_CFLAGS) $(PYTHON_CPPFLAGS) $(BOOST_PYTHON_CFLAGS) $(glom_defines)
-tests_cflags   = $(GLOM_WFLAGS)
-tests_cxxflags = $(GLOM_WXXFLAGS)
 
 glom_libglom_test_connectionpool_SOURCES = glom/libglom/test_connectionpool.cc
 glom_libglom_test_connectionpool_LDADD = $(tests_ldadd)
 glom_libglom_test_connectionpool_CPPFLAGS = $(tests_cppflags)
-glom_libglom_test_connectionpool_CFLAGS = $(tests_cflags)
-glom_libglom_test_connectionpool_CXXFLAGS = $(tests_cxxflags)
 
 glom_libglom_example_document_load_SOURCES = glom/libglom/example_document_load.cc
 glom_libglom_example_document_load_LDADD = $(tests_ldadd)
 glom_libglom_example_document_load_CPPFLAGS = $(tests_cppflags)
-glom_libglom_example_document_load_CFLAGS = $(tests_cflags)
-glom_libglom_example_document_load_CXXFLAGS = $(tests_cxxflags)
 
 glom_libglom_test_sharedptr_layoutitem_SOURCES = glom/libglom/test_sharedptr_layoutitem.cc
 glom_libglom_test_sharedptr_layoutitem_LDADD = $(tests_ldadd)
 glom_libglom_test_sharedptr_layoutitem_CPPFLAGS = $(tests_cppflags)
-glom_libglom_test_sharedptr_layoutitem_CFLAGS = $(tests_cflags)
-glom_libglom_test_sharedptr_layoutitem_CXXFLAGS = $(tests_cxxflags)
 
 tests_test_document_load_SOURCES = tests/test_document_load.cc
 tests_test_document_load_LDADD = $(tests_ldadd)
 tests_test_document_load_CPPFLAGS = $(tests_cppflags)
-tests_test_document_load_CFLAGS = $(tests_cflags)
-tests_test_document_load_CXXFLAGS = $(tests_cxxflags)
 
 tests_test_document_autosave_SOURCES = tests/test_document_autosave.cc
 tests_test_document_autosave_LDADD = $(tests_ldadd)
 tests_test_document_autosave_CPPFLAGS = $(tests_cppflags)
-tests_test_document_autosave_CFLAGS = $(tests_cflags)
-tests_test_document_autosave_CXXFLAGS = $(tests_cxxflags)
 
 tests_test_parsing_time_SOURCES = tests/test_parsing_time.cc
 tests_test_parsing_time_LDADD = $(tests_ldadd)
 tests_test_parsing_time_CPPFLAGS = $(tests_cppflags)
-tests_test_parsing_time_CFLAGS = $(tests_cflags)
-tests_test_parsing_time_CXXFLAGS = $(tests_cxxflags)
 
 tests_test_signal_reemit_SOURCES = tests/test_signal_reemit.cc
 tests_test_signal_reemit_LDADD = $(LIBGLOM_LIBS)
 tests_test_signal_reemit_CPPFLAGS = $(tests_cppflags)
-tests_test_signal_reemit_CFLAGS = $(tests_cflags)
-tests_test_signal_reemit_CXXFLAGS = $(tests_cxxflags)
 
 tests_test_load_python_library_SOURCES = tests/test_load_python_library.cc
 tests_test_load_python_library_LDADD = $(LIBGLOM_LIBS) -ldl
 tests_test_load_python_library_CPPFLAGS = $(tests_cppflags)
-tests_test_load_python_library_CFLAGS = $(tests_cflags)
-tests_test_load_python_library_CXXFLAGS = $(tests_cxxflags)
 
 tests_test_python_module_SOURCES = tests/test_python_module.cc
 tests_test_python_module_LDADD = $(tests_ldadd) $(PYTHON_LIBS)
 tests_test_python_module_CPPFLAGS = $(tests_cppflags)
-tests_test_python_module_CFLAGS = $(tests_cflags)
-tests_test_python_module_CXXFLAGS = $(tests_cxxflags)
 
 
 # Distribute the tests data:
 dist_noinst_DATA = tests/import/data/albums.csv
 
 # Let the .cc source code know about this path: TODO: Actually use this.
-glom_test_import_defines = DGLOM_TESTS_IMPORT_DATA_NOTINSTALLED=\""$(abs_top_srcdir)/tests/import/data/"\"
+glom_test_import_defines = -DGLOM_TESTS_IMPORT_DATA_NOTINSTALLED=\""$(abs_top_srcdir)/tests/import/data/"\"
   
   
 tests_import_test_parsing_SOURCES =	\
@@ -128,8 +108,6 @@ tests_import_test_parsing_SOURCES =	\
 	tests/import/test_parsing.cc
 tests_import_test_parsing_LDADD = $(GLOM_LIBS)
 tests_import_test_parsing_CPPFLAGS = $(tests_cppflags) $(glom_test_import_defines)
-tests_import_test_parsing_CFLAGS = $(tests_cflags)
-tests_import_test_parsing_CXXFLAGS = $(tests_cxxflags)
 
 tests_import_test_signals_SOURCES =	\
 	glom/import_csv/csv_parser.cc	\
@@ -139,21 +117,14 @@ tests_import_test_signals_SOURCES =	\
 	tests/import/test_signals.cc
 tests_import_test_signals_LDADD = $(GLOM_LIBS)
 tests_import_test_signals_CPPFLAGS = $(tests_cppflags)
-tests_import_test_signals_CFLAGS = $(tests_cflags)
-tests_import_test_signals_CXXFLAGS = $(tests_cxxflags)
 
 tests_test_selfhosting_new_empty_SOURCES = tests/test_selfhosting_new_empty.cc
 tests_test_selfhosting_new_empty_LDADD = $(glom_all_libs)
 tests_test_selfhosting_new_empty_CPPFLAGS = $(tests_cppflags)
-tests_test_selfhosting_new_empty_CFLAGS = $(tests_cflags)
-tests_test_selfhosting_new_empty_CXXFLAGS = $(tests_cxxflags)
 
 tests_test_selfhosting_new_from_example_SOURCES = tests/test_selfhosting_new_from_example.cc
 tests_test_selfhosting_new_from_example_LDADD = $(glom_all_libs)
 tests_test_selfhosting_new_from_example_CPPFLAGS = $(tests_cppflags)
-tests_test_selfhosting_new_from_example_CFLAGS = $(tests_cflags)
-tests_test_selfhosting_new_from_example_CXXFLAGS = $(tests_cxxflags)
-
 
 
 # UI Tests:
@@ -193,8 +164,6 @@ glom_utility_widgets_test_flowtable_SOURCES =	\
 	glom/utility_widgets/test_flowtable.cc
 glom_utility_widgets_test_flowtable_LDADD = $(GLOM_LIBS)
 glom_utility_widgets_test_flowtable_CPPFLAGS = $(tests_cppflags_ui)
-glom_utility_widgets_test_flowtable_CFLAGS = $(tests_cflags)
-glom_utility_widgets_test_flowtable_CXXFLAGS = $(tests_cxxflags)
 
 # Disabled because it slows down the build, because it builds all Glom files again, using its own flags:
 #glom_mode_data_test_flowtablewithfields_SOURCES =	\
@@ -202,8 +171,6 @@ glom_utility_widgets_test_flowtable_CXXFLAGS = $(tests_cxxflags)
 #	glom/mode_data/test_flowtablewithfields.cc
 #glom_mode_data_test_flowtablewithfields_LDADD = $(glom_all_libs)
 #glom_mode_data_test_flowtablewithfields_CPPFLAGS = $(tests_cppflags_ui)
-#glom_mode_data_test_flowtablewithfields_CFLAGS = $(tests_cflags)
-#glom_mode_data_test_flowtablewithfields_CXXFLAGS = $(tests_cxxflags)
 
 
 tests_test_python_execute_func_SOURCES = tests/test_python_execute_func.cc \
@@ -217,29 +184,21 @@ tests_test_python_execute_func_bad_syntax_SOURCES = tests/test_python_execute_fu
   glom/python_embed/glom_python.cc
 tests_test_python_execute_func_bad_syntax_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
 tests_test_python_execute_func_bad_syntax_CPPFLAGS = $(tests_cppflags_ui)
-tests_test_python_execute_func_bad_syntax_CFLAGS = $(tests_cflags)
-tests_test_python_execute_func_bad_syntax_CXXFLAGS = $(tests_cxxflags)
 
 tests_test_python_execute_func_date_SOURCES = tests/test_python_execute_func_date.cc \
   glom/python_embed/glom_python.cc
 tests_test_python_execute_func_date_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
 tests_test_python_execute_func_date_CPPFLAGS = $(tests_cppflags_ui)
-tests_test_python_execute_func_date_CFLAGS = $(tests_cflags)
-tests_test_python_execute_func_date_CXXFLAGS = $(tests_cxxflags)
 
 tests_test_python_execute_func_change_result_type_SOURCES = tests/test_python_execute_func_change_result_type.cc \
   glom/python_embed/glom_python.cc
 tests_test_python_execute_func_change_result_type_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
 tests_test_python_execute_func_change_result_type_CPPFLAGS = $(tests_cppflags_ui)
-tests_test_python_execute_func_change_result_type_CFLAGS = $(tests_cflags)
-tests_test_python_execute_func_change_result_type_CXXFLAGS = $(tests_cxxflags)
 
 tests_test_python_execute_script_SOURCES = tests/test_python_execute_script.cc \
   glom/python_embed/glom_python.cc
 tests_test_python_execute_script_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
 tests_test_python_execute_script_CPPFLAGS = $(tests_cppflags_ui)
-tests_test_python_execute_script_CFLAGS = $(tests_cflags)
-tests_test_python_execute_script_CXXFLAGS = $(tests_cxxflags)
 
 # You must remove PlaceholderGlom::get_application() to avoid having to specify
 # a huge set of .cc files when building this test:
@@ -259,19 +218,13 @@ tests_test_python_execute_script_CXXFLAGS = $(tests_cxxflags)
 tests_test_glade_derived_instantiation_SOURCES = tests/test_glade_derived_instantiation.cc $(glom_source_files)
 tests_test_glade_derived_instantiation_LDADD = $(glom_all_libs)
 tests_test_glade_derived_instantiation_CPPFLAGS = $(tests_cppflags_ui)
-tests_test_glade_derived_instantiation_CFLAGS = $(tests_cflags)
-tests_test_glade_derived_instantiation_CXXFLAGS = $(tests_cxxflags)
 
 tests_glade_toplevels_instantiation_SOURCES = tests/glade_toplevels_instantiation.cc
 tests_glade_toplevels_instantiation_LDADD = $(tests_ldadd) $(GLOM_LIBS)
 tests_glade_toplevels_instantiation_CPPFLAGS = $(tests_cppflags_ui)
-tests_glade_toplevels_instantiation_CFLAGS = $(tests_cflags)
-tests_glade_toplevels_instantiation_CXXFLAGS = $(tests_cxxflags)
 
 glom_test_pyembed_SOURCES = glom/test_pyembed.cc
 glom_test_pyembed_LDADD = $(LIBGLOM_LIBS) $(PYTHON_LIBS)
 glom_test_pyembed_CPPFLAGS = $(tests_cppflags_ui)
-glom_test_pyembed_CFLAGS = $(tests_cflags)
-glom_test_pyembed_CXXFLAGS = $(tests_cxxflags)
 
 endif #GLOM_ENABLE_UI



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]