[gnome-utils] [build] Clean up gdict Makefile template



commit 75a9ea6e5cbaf15ef36468da50b6d0d19c03e016
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sat Apr 18 12:16:45 2009 +0100

    [build] Clean up gdict Makefile template
    
    * Remove compiler flags directives from the INCLUDES section
    
    * Add all the deprecation defines and disable single header
      inclusion for GLib and GTK+
    
    * Split out the source files listings and allow out of tree
      builds (if my calculations are correct: verifications
      appreciated!)
    
    * Clean up the generated files rules
---
 gnome-dictionary/libgdict/Makefile.am |  158 +++++++++++++++------------------
 1 files changed, 70 insertions(+), 88 deletions(-)

diff --git a/gnome-dictionary/libgdict/Makefile.am b/gnome-dictionary/libgdict/Makefile.am
index 115fe5c..5af1ab6 100644
--- a/gnome-dictionary/libgdict/Makefile.am
+++ b/gnome-dictionary/libgdict/Makefile.am
@@ -1,5 +1,3 @@
-## Process this file with automake to produce Makefile.in
-
 NULL =
 
 INCLUDES = -DG_LOG_DOMAIN=\"Gdict\" 				\
@@ -10,70 +8,67 @@ INCLUDES = -DG_LOG_DOMAIN=\"Gdict\" 				\
 	-DGNOMELOCALEDIR=\""$(gnomeutilslocaledir)"\" 		\
 	-DGDICTSOURCESDIR=\""$(datadir)/gdict-1.0/sources"\" 	\
 	-DGDICT_ENABLE_INTERNALS=1 				\
-	$(GDICT_DEBUG_CFLAGS)					\
-	$(DISABLE_DEPRECATED_CFLAGS) 				\
-	$(WARN_CFLAGS) 						\
+	-DG_DISABLE_DEPRECATED					\
+	-DGDK_DISABLE_DEPRECATED				\
+	-DGTK_DISABLE_DEPRECATED				\
+	-DPANGO_DISABLE_DEPRECATED				\
+	-DG_DISABLE_SINGLE_INCLUDES				\
+	-DGTK_DISABLE_SINGLE_INCLUDES				\
 	$(NULL)
 
-lib_LTLIBRARIES = libgdict-1.0.la
+sources_h =	\
+	$(srcdir)/gdict-context.h		\
+	$(srcdir)/gdict-client-context.h	\
+	$(srcdir)/gdict-database-chooser.h 	\
+	$(srcdir)/gdict-defbox.h 		\
+	$(srcdir)/gdict-source-chooser.h	\
+	$(srcdir)/gdict-source-loader.h		\
+	$(srcdir)/gdict-source.h		\
+	$(srcdir)/gdict-speller.h		\
+	$(srcdir)/gdict-strategy-chooser.h 	\
+	$(srcdir)/gdict-utils.h			\
+	$(NULL)
 
-# GNOME Dictionary shared library
-libgdict_1_0_la_SOURCES =	\
-	gdict-private.h		\
-	gdict-debug.h		\
-	gdict-context.c		\
-	gdict-context.h		\
-	gdict-context-private.h	\
-	gdict-client-context.c	\
-	gdict-client-context.h	\
-	gdict-database-chooser.h \
-	gdict-database-chooser.c \
-	gdict-defbox.c 		\
-	gdict-defbox.h 		\
-	gdict-enum-types.c	\
-	gdict-enum-types.h	\
-	gdict-marshal.c		\
-	gdict-marshal.h		\
-	gdict-source.c		\
-	gdict-source.h		\
-	gdict-source-chooser.c	\
-	gdict-source-chooser.h	\
-	gdict-source-loader.c	\
-	gdict-source-loader.h	\
-	gdict-speller.c		\
-	gdict-speller.h		\
-	gdict-strategy-chooser.h \
-	gdict-strategy-chooser.c \
-	gdict-utils.c		\
-	gdict-utils.h		\
+sources_h_priv =	\
+	$(srcdir)/gdict-context-private.h	\
+	$(srcdir)/gdict-debug.h			\
+	$(srcdir)/gdict-private.h		\
+	$(NULL)
+
+sources_c =	\
+	$(srcdir)/gdict-context.c		\
+	$(srcdir)/gdict-client-context.c	\
+	$(srcdir)/gdict-database-chooser.c	\
+	$(srcdir)/gdict-defbox.c		\
+	gdict-enum-types.c			\
+	gdict-marshal.c				\
+	$(srcdir)/gdict-source-chooser.c	\
+	$(srcdir)/gdict-source-loader.c		\
+	$(srcdir)/gdict-source.c		\
+	$(srcdir)/gdict-speller.c		\
+	$(srcdir)/gdict-strategy-chooser.c	\
+	$(srcdir)/gdict-utils.c			\
 	$(NULL)
 
-libgdict_1_0_la_CFLAGS = $(LIBGDICT_CFLAGS)
-libgdict_1_0_la_LDFLAGS = \
+lib_LTLIBRARIES = libgdict-1.0.la
+
+# GNOME Dictionary shared library
+libgdict_1_0_la_SOURCES  = $(sources_h) $(source_h_priv) $(sources_c)
+libgdict_1_0_la_CPPFLAGS = $(LIBGDICT_CFLAGS) $(GDICT_DEBUG_CFLAGS) $(MAINTAINER_CFLAGS)
+libgdict_1_0_la_LIBADD   = $(LIBGDICT_LIBS)
+libgdict_1_0_la_LDFLAGS  = \
 	-version-info $(LIBGDICT_LT_VERSION) \
 	-export-dynamic \
 	-no-undefined
-libgdict_1_0_la_LIBADD = $(LIBGDICT_LIBS)
 
 libgdict_includedir = $(includedir)/gdict-1.0/gdict
 libgdict_include_HEADERS = 	\
-	gdict-context.h		\
-	gdict-client-context.h	\
-	gdict-database-chooser.h \
-	gdict-defbox.h 		\
+	$(sources_h)		\
 	gdict-enum-types.h	\
-	gdict-source.h		\
-	gdict-source-chooser.h	\
-	gdict-source-loader.h	\
-	gdict-speller.h		\
-	gdict-strategy-chooser.h \
-	gdict-utils.h		\
-	gdict-version.h 	\
-	gdict.h			\
+	gdict-version.h		\
+	$(srcdir)/gdict.h	\
 	$(NULL)
 
-$(libgdict_1_0_la_OBJECTS): $(BUILT_SOURCES)
-
 gdict_built_files = 		\
 	gdict-enum-types.h	\
 	gdict-enum-types.c	\
@@ -82,16 +77,16 @@ gdict_built_files = 		\
 
 stamp_files = stamp-gdict-enum-types.h stamp-gdict-marshal.h
 
-gen_sources = xgen-gmh xgen-gmc xgen-geth xgen-getc
-CLEANFILES = $(gen_sources) $(stamp_files)
-MAINTAINERCLEANFILES = $(stamp_files) $(gdict_built_files)
+CLEANFILES = $(stamp_files) $(gdict_built_files)
+DISTCLEANFILES = gdict-version.h
+MAINTAINERCLEANFILES = $(stamp_files) $(gdict_built_files) gdict-version.h
 
-EXTRA_DIST = 				\
-	gdict-version.h.in 		\
-	gdict-enum-types.h.in		\
-	gdict-enum-types.c.in		\
-	gdict-marshal.list		\
-	gdict-1.0.pc.in			\
+EXTRA_DIST = 			\
+	gdict-version.h.in 	\
+	gdict-enum-types.h.in	\
+	gdict-enum-types.c.in	\
+	gdict-marshal.list	\
+	gdict-1.0.pc.in		\
 	$(NULL)
 
 BUILT_SOURCES = $(gdict_built_files) 
@@ -99,48 +94,35 @@ BUILT_SOURCES = $(gdict_built_files)
 gdict-marshal.h: stamp-gdict-marshal.h
 	@true
 stamp-gdict-marshal.h: gdict-marshal.list $(GLIB_GENMARSHAL) Makefile
-	$(GLIB_GENMARSHAL) $< --header --prefix=gdict_marshal >> xgen-gmh \
-	&& (cmp -s xgen-gmh gdict-marshal.h || cp xgen-gmh gdict-marshal.h) \
+	$(GLIB_GENMARSHAL) $< --header --prefix=gdict_marshal > xgen-gmh \
+	&& ( cmp -s xgen-gmh gdict-marshal.h || cp xgen-gmh gdict-marshal.h ) \
 	&& rm -f xgen-gmh \
 	&& echo timestamp > $(@F)
 
 gdict-marshal.c: gdict-marshal.list $(GLIB_GENMARSHAL) Makefile
-	@echo "#include \"gdict-marshal.h\"" > $@ && \
-	$(GLIB_GENMARSHAL) $< --body --prefix=gdict_marshal >> xgen-gmc \
+	( echo "#include \"gdict-marshal.h\""; echo; \
+	  $(GLIB_GENMARSHAL) $< --body --prefix=gdict_marshal ) > xgen-gmc \
 	&& cp xgen-gmc gdict-marshal.c \
 	&& rm -f xgen-gmc
 
-libgdict_enum_headers = \
-	$(top_srcdir)/gnome-dictionary/libgdict/gdict-context.h \
-	$(top_srcdir)/gnome-dictionary/libgdict/gdict-client-context.h \
-	$(top_srcdir)/gnome-dictionary/libgdict/gdict-database-chooser.h \
-	$(top_srcdir)/gnome-dictionary/libgdict/gdict-defbox.h \
-	$(top_srcdir)/gnome-dictionary/libgdict/gdict-source.h \
-	$(top_srcdir)/gnome-dictionary/libgdict/gdict-source-chooser.h \
-	$(top_srcdir)/gnome-dictionary/libgdict/gdict-source-loader.h \
-	$(top_srcdir)/gnome-dictionary/libgdict/gdict-speller.h \
-	$(top_srcdir)/gnome-dictionary/libgdict/gdict-strategy-chooser.h \
-	$(top_srcdir)/gnome-dictionary/libgdict/gdict-utils.h \
-	$(NULL)
-
 gdict-enum-types.h: stamp-gdict-enum-types.h
 	@true
-stamp-gdict-enum-types.h: $(libgdict_enum_headers) Makefile
+stamp-gdict-enum-types.h: $(sources_h) gdict-enum-types.h.in Makefile
 	( cd $(srcdir) && \
 	  $(GLIB_MKENUMS) \
 	  	--template $(srcdir)/gdict-enum-types.h.in \
-	  $(libgdict_enum_headers) ) >> xgen-ceth && \
-	(cmp -s xgen-ceth gdict-enum-types.h || cp xgen-ceth gdict-enum-types.h) && \
-	rm -f xgen-ceth && \
-	echo timestamp > $(@F)
+	  $(sources_h) ) > xgen-ceth \
+	&& ( cmp -s xgen-ceth gdict-enum-types.h || cp xgen-ceth gdict-enum-types.h ) \
+	&& rm -f xgen-ceth \
+	&& echo timestamp > $(@F)
 
-gdict-enum-types.c: $(libgdict_enum_headers) Makefile
+gdict-enum-types.c: gdict-enum-types.h gdict-enum-types.c.in Makefile
 	( cd $(srcdir) && \
 	  $(GLIB_MKENUMS) \
 	  	--template $(srcdir)/gdict-enum-types.c.in \
-	  $(libgdict_enum_headers) ) >> xgen-cetc && \
-	cp xgen-cetc gdict-enum-types.c && \
-	rm -f xgen-cetc
+	  $(sources_h) ) > xgen-cetc \
+	&& cp xgen-cetc gdict-enum-types.c \
+	&& rm -f xgen-cetc
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = gdict-1.0.pc
@@ -149,4 +131,4 @@ distclean-local:
 	if test $(srcdir) != .; then \
 		rm -f $(MAINTAINERCLEANFILES); \
 	fi
-	
+



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