[gnome-photos/wip/rishi/split-private-library: 1/2] build: Rearrange the Makefile.am for subsequent changes
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/split-private-library: 1/2] build: Rearrange the Makefile.am for subsequent changes
- Date: Thu, 11 Oct 2018 16:24:15 +0000 (UTC)
commit dc342489960d18c8172873bb6470c2b777d25f92
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Oct 2 12:55:45 2018 +0200
build: Rearrange the Makefile.am for subsequent changes
A subsequent commit will split some common code into a private shared
library. It's desirable to ensure that each binary artifact doesn't
inadvertently grow new dependencies.
So far, there was a global AM_CPPFLAGS and target-specific LDADDs.
It means that the build would've only failed for unintended linker
dependencies while linking the final binaries, and not while compiling
the individual translation units into object files. This is improved
by replacing the global AM_CPPFLAGS with target-specific CPPFLAGS. It
is likely to catch such issues sooner because linker dependencies are
often accompanied by matching preprocessor dependencies; and also
prevent against inadvertent preprocessor-only dependencies.
Using target-specific CPPFLAGS does have the negative side-effect of
building the common source files multiple times - once for each target.
Hopefully this will only be a temporary setback until the common code
is split out into a private shared library.
The target-specific variables were moved closer to their SOURCES
counterparts for better readability.
https://gitlab.gnome.org/GNOME/gnome-photos/issues/63
src/Makefile.am | 152 ++++++++++++++++++++++++++++++--------------------------
1 file changed, 82 insertions(+), 70 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 4ce8bd09..94d7e940 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -302,6 +302,59 @@ gnome_photos_SOURCES = \
photos-main.c \
$(NULL)
+gnome_photos_CPPFLAGS = \
+ -DPACKAGE_LIBEXEC_DIR=\""${libexecdir}"\" \
+ -DPACKAGE_LOCALE_DIR=\""${datadir}/locale"\" \
+ $(BABL_CFLAGS) \
+ $(CAIRO_CFLAGS) \
+ $(DAZZLE_CFLAGS) \
+ $(GDATA_CFLAGS) \
+ $(GDK_PIXBUF_CFLAGS) \
+ $(GEOCODE_CFLAGS) \
+ $(GFBGRAPH_CFLAGS) \
+ $(GEGL_CFLAGS) \
+ $(GEXIV2_CFLAGS) \
+ $(GIO_CFLAGS) \
+ $(GLIB_CFLAGS) \
+ $(GOA_CFLAGS) \
+ $(GOBJECT_CFLAGS) \
+ $(GRILO_CFLAGS) \
+ $(GSETTINGS_DESKTOP_SCHEMAS_CFLAGS) \
+ $(GTK_CFLAGS) \
+ $(GTK_UNIX_PRINT_CFLAGS) \
+ $(PNG_CFLAGS) \
+ $(TRACKER_CFLAGS) \
+ -I$(top_srcdir)/subprojects/libgd \
+ $(NULL)
+
+gnome_photos_LDFLAGS = \
+ $(WARN_LDFLAGS) \
+ $(NULL)
+
+gnome_photos_LDADD = \
+ $(BABL_LIBS) \
+ $(CAIRO_LIBS) \
+ $(DAZZLE_LIBS) \
+ $(GDATA_LIBS) \
+ $(GDK_PIXBUF_LIBS) \
+ $(GEOCODE_LIBS) \
+ $(GFBGRAPH_LIBS) \
+ $(GEGL_LIBS) \
+ $(GEXIV2_LIBS) \
+ $(GIO_LIBS) \
+ $(GLIB_LIBS) \
+ $(GOA_LIBS) \
+ $(GOBJECT_LIBS) \
+ $(GRILO_LIBS) \
+ $(GTK_LIBS) \
+ $(GTK_UNIX_PRINT_LIBS) \
+ $(JPEG_LIBS) \
+ $(PNG_LIBS) \
+ $(TRACKER_LIBS) \
+ $(LIBM) \
+ $(top_builddir)/subprojects/libgd/libgd.la \
+ $(NULL)
+
gnome_photos_thumbnailer_built_sources = \
photos-enums-gegl.c \
photos-enums-gegl.h \
@@ -356,6 +409,35 @@ gnome_photos_thumbnailer_SOURCES = \
photos-thumbnailer-main.c \
$(NULL)
+gnome_photos_thumbnailer_CPPFLAGS = \
+ -DPACKAGE_LOCALE_DIR=\""${datadir}/locale"\" \
+ $(BABL_CFLAGS) \
+ $(DAZZLE_CFLAGS) \
+ $(GDK_PIXBUF_CFLAGS) \
+ $(GEGL_CFLAGS) \
+ $(GIO_CFLAGS) \
+ $(GLIB_CFLAGS) \
+ $(GOBJECT_CFLAGS) \
+ $(PNG_CFLAGS) \
+ $(NULL)
+
+gnome_photos_thumbnailer_LDFLAGS = \
+ $(WARN_LDFLAGS) \
+ $(NULL)
+
+gnome_photos_thumbnailer_LDADD = \
+ $(BABL_LIBS) \
+ $(DAZZLE_LIBS) \
+ $(GEGL_LIBS) \
+ $(GDK_PIXBUF_LIBS) \
+ $(GIO_LIBS) \
+ $(GLIB_LIBS) \
+ $(GOBJECT_LIBS) \
+ $(JPEG_LIBS) \
+ $(PNG_LIBS) \
+ $(LIBM) \
+ $(NULL)
+
BUILT_SOURCES = \
$(gnome_photos_built_sources) \
$(gnome_photos_thumbnailer_built_sources) \
@@ -397,80 +479,10 @@ EXTRA_DIST = \
photos-mpris-player.xml \
$(NULL)
-AM_CPPFLAGS = \
- -DPACKAGE_LIBEXEC_DIR=\""${libexecdir}"\" \
- -DPACKAGE_LOCALE_DIR=\""${datadir}/locale"\" \
- $(BABL_CFLAGS) \
- $(CAIRO_CFLAGS) \
- $(DAZZLE_CFLAGS) \
- $(GDATA_CFLAGS) \
- $(GDK_PIXBUF_CFLAGS) \
- $(GEOCODE_CFLAGS) \
- $(GFBGRAPH_CFLAGS) \
- $(GEGL_CFLAGS) \
- $(GEXIV2_CFLAGS) \
- $(GIO_CFLAGS) \
- $(GLIB_CFLAGS) \
- $(GOA_CFLAGS) \
- $(GOBJECT_CFLAGS) \
- $(GRILO_CFLAGS) \
- $(GSETTINGS_DESKTOP_SCHEMAS_CFLAGS) \
- $(GTK_CFLAGS) \
- $(GTK_UNIX_PRINT_CFLAGS) \
- $(PNG_CFLAGS) \
- $(TRACKER_CFLAGS) \
- -I$(top_srcdir)/subprojects/libgd \
- $(NULL)
-
AM_CFLAGS = \
$(WARN_CFLAGS) \
$(NULL)
-gnome_photos_LDFLAGS = \
- $(WARN_LDFLAGS) \
- $(NULL)
-
-gnome_photos_LDADD = \
- $(BABL_LIBS) \
- $(CAIRO_LIBS) \
- $(DAZZLE_LIBS) \
- $(GDATA_LIBS) \
- $(GDK_PIXBUF_LIBS) \
- $(GEOCODE_LIBS) \
- $(GFBGRAPH_LIBS) \
- $(GEGL_LIBS) \
- $(GEXIV2_LIBS) \
- $(GIO_LIBS) \
- $(GLIB_LIBS) \
- $(GOA_LIBS) \
- $(GOBJECT_LIBS) \
- $(GRILO_LIBS) \
- $(GTK_LIBS) \
- $(GTK_UNIX_PRINT_LIBS) \
- $(JPEG_LIBS) \
- $(PNG_LIBS) \
- $(TRACKER_LIBS) \
- $(LIBM) \
- $(top_builddir)/subprojects/libgd/libgd.la \
- $(NULL)
-
-gnome_photos_thumbnailer_LDFLAGS = \
- $(WARN_LDFLAGS) \
- $(NULL)
-
-gnome_photos_thumbnailer_LDADD = \
- $(BABL_LIBS) \
- $(DAZZLE_LIBS) \
- $(GEGL_LIBS) \
- $(GDK_PIXBUF_LIBS) \
- $(GIO_LIBS) \
- $(GLIB_LIBS) \
- $(GOBJECT_LIBS) \
- $(JPEG_LIBS) \
- $(PNG_LIBS) \
- $(LIBM) \
- $(NULL)
-
CLEANFILES = \
$(BUILT_SOURCES) \
stamp-photos-about-data.h \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]