[gjs] Makefile.am, Makefile-modules.am: Split out source lists



commit becac609e542b1f49c7f9d1094a462658eedbbad
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Jan 27 11:19:07 2017 +0800

    Makefile.am, Makefile-modules.am: Split out source lists
    
    This splits out the source lists so that they can be shared with NMake
    Makefiles.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775868

 Makefile-modules.am |   27 +++----------
 Makefile.am         |  112 +++++----------------------------------------------
 gjs-modules-srcs.mk |   34 +++++++++++++++
 gjs-srcs.mk         |  107 ++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 157 insertions(+), 123 deletions(-)
---
diff --git a/Makefile-modules.am b/Makefile-modules.am
index 3165d86..23c9d1b 100644
--- a/Makefile-modules.am
+++ b/Makefile-modules.am
@@ -23,36 +23,21 @@ modules-resources.c: $(srcdir)/modules/modules.gresource.xml $(modules_resource_
 
 EXTRA_DIST += $(modules_resource_files) $(srcdir)/modules/modules.gresource.xml
 
-nodist_libmodules_resources_la_SOURCES = modules-resources.c modules-resources.h
+include gjs-modules-srcs.mk
+
+nodist_libmodules_resources_la_SOURCES = $(module_resource_srcs)
 CLEANFILES += $(nodist_libmodules_resources_la_SOURCES)
 libmodules_resources_la_CPPFLAGS = $(JS_NATIVE_MODULE_CPPFLAGS)
 libmodules_resources_la_LIBADD = $(JS_NATIVE_MODULE_LIBADD)
 
 libcairoNative_la_CPPFLAGS = $(JS_NATIVE_MODULE_CPPFLAGS) $(GJS_CAIRO_CFLAGS) $(GJS_CAIRO_XLIB_CFLAGS)
 libcairoNative_la_LIBADD = $(JS_NATIVE_MODULE_LIBADD) $(GJS_CAIRO_LIBS) $(GJS_CAIRO_XLIB_LIBS)
-libcairoNative_la_SOURCES =                       \
-       modules/cairo-private.h                   \
-       modules/cairo-module.h                    \
-       modules/cairo-region.cpp                  \
-       modules/cairo-context.cpp                 \
-       modules/cairo-path.cpp                    \
-       modules/cairo-surface.cpp                 \
-       modules/cairo-image-surface.cpp           \
-       modules/cairo-ps-surface.cpp              \
-       modules/cairo-pdf-surface.cpp             \
-       modules/cairo-svg-surface.cpp             \
-       modules/cairo-pattern.cpp                 \
-       modules/cairo-gradient.cpp                \
-       modules/cairo-linear-gradient.cpp         \
-       modules/cairo-radial-gradient.cpp         \
-       modules/cairo-surface-pattern.cpp         \
-       modules/cairo-solid-pattern.cpp           \
-       modules/cairo.cpp
+libcairoNative_la_SOURCES = $(module_cairo_srcs)
 
 libsystem_la_CPPFLAGS = $(JS_NATIVE_MODULE_CPPFLAGS)
 libsystem_la_LIBADD = $(JS_NATIVE_MODULE_LIBADD)
-libsystem_la_SOURCES = modules/system.h modules/system.cpp
+libsystem_la_SOURCES = $(module_system_srcs)
 
 libconsole_la_CPPFLAGS = $(JS_NATIVE_MODULE_CPPFLAGS)
 libconsole_la_LIBADD = $(JS_NATIVE_MODULE_LIBADD) $(READLINE_LIBS)
-libconsole_la_SOURCES = modules/console.h modules/console.cpp
+libconsole_la_SOURCES = $(module_console_srcs)
diff --git a/Makefile.am b/Makefile.am
index 91cc833..14c7130 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,13 +34,9 @@ gjsoverridedir = $(gjsjsdir)/overrides
 gjs_public_includedir = $(includedir)/gjs-1.0
 
 ########################################################################
-nobase_gjs_public_include_HEADERS =    \
-       gjs/context.h           \
-       gjs/coverage.h                  \
-       gjs/gjs.h                       \
-       gjs/macros.h                    \
-       util/error.h                    \
-       $(NULL)
+include gjs-srcs.mk
+########################################################################
+nobase_gjs_public_include_HEADERS = $(gjs_public_headers)
 
 ########################################################################
 pkgconfig_DATA = gjs-1.0.pc
@@ -75,108 +71,20 @@ libgjs_la_CPPFLAGS += $(GJS_GTK_CFLAGS)
 libgjs_la_LIBADD += $(GJS_GTK_LIBS)
 endif
 
-libgjs_la_SOURCES =            \
-       gjs/byteArray.cpp               \
-       gjs/context.cpp         \
-       gjs/context-private.h           \
-       gjs/importer.cpp                \
-       gjs/coverage-internal.h \
-       gjs/coverage.cpp \
-       gjs/jsapi-constructor-proxy.cpp \
-       gjs/jsapi-constructor-proxy.h   \
-       gjs/jsapi-private.cpp   \
-       gjs/jsapi-private.h             \
-       gjs/jsapi-util.cpp      \
-       gjs/jsapi-dynamic-class.cpp \
-       gjs/jsapi-util-args.h           \
-       gjs/jsapi-util-error.cpp        \
-       gjs/jsapi-util-string.cpp       \
-       gjs/mem.cpp             \
-       gjs/native.cpp          \
-       gjs/runtime.cpp         \
-       gjs/stack.cpp           \
-       gjs/type-module.cpp     \
-       modules/modules.cpp     \
-       modules/modules.h       \
-       util/error.cpp          \
-       util/hash-x32.cpp               \
-       util/hash-x32.h                 \
-       util/glib.cpp           \
-       util/glib.h                     \
-       util/log.cpp            \
-       util/log.h                      \
-       util/misc.cpp                   \
-       util/misc.h                     \
-       $(NULL)
-
-# For historical reasons, some files live in gi/
-libgjs_la_SOURCES += \
-       gi/gjs_gi_trace.h \
-       gi/arg.cpp      \
-       gi/boxed.cpp    \
-       gi/closure.cpp  \
-       gi/enumeration.cpp      \
-       gi/function.cpp \
-       gi/keep-alive.cpp       \
-       gi/ns.cpp       \
-       gi/object.cpp   \
-       gi/foreign.cpp  \
-       gi/fundamental.cpp      \
-       gi/param.cpp    \
-       gi/proxyutils.cpp       \
-       gi/proxyutils.h         \
-       gi/repo.cpp     \
-       gi/union.cpp    \
-       gi/value.cpp    \
-       gi/interface.cpp        \
-       gi/gtype.cpp    \
-       gi/gerror.cpp
+# Please see gjs-srcs.mk for brief expanations
+# of the layout of the sources due to historical
+# reasons
+libgjs_la_SOURCES = $(gjs_srcs)
 
 # Also, these files used to be a separate library
-libgjs_private_source_files = \
-       libgjs-private/gjs-gdbus-wrapper.cpp    \
-       libgjs-private/gjs-gdbus-wrapper.h      \
-       libgjs-private/gjs-util.cpp             \
-       libgjs-private/gjs-util.h               \
-       libgjs-private/gjs-gtk-util.h
+libgjs_private_source_files = $(gjs_private_srcs)
 
 if ENABLE_GTK
-libgjs_private_source_files +=                         \
-       libgjs-private/gjs-gtk-util.c           \
-       $(NULL)
+libgjs_private_source_files += $(gjs_gtk_private_srcs)
 endif
 
 libgjs_la_SOURCES += $(libgjs_private_source_files)
 
-# These used to be public headers for external modules
-libgjs_la_SOURCES +=           \
-       gjs/byteArray.h         \
-       gjs/importer.h          \
-       gjs/jsapi-util.h        \
-       gjs/jsapi-wrapper.h     \
-       gjs/runtime.h           \
-       gjs/type-module.h       \
-       gjs/mem.h               \
-       gjs/native.h            \
-       gi/ns.h                 \
-       gi/object.h             \
-       gi/foreign.h            \
-       gi/fundamental.h        \
-       gi/param.h              \
-       gi/repo.h               \
-       gi/union.h              \
-       gi/value.h              \
-       gi/arg.h                \
-       gi/boxed.h              \
-       gi/closure.h            \
-       gi/enumeration.h        \
-       gi/function.h           \
-       gi/keep-alive.h         \
-       gi/interface.h          \
-       gi/gtype.h              \
-       gi/gerror.h             \
-       $(NULL)
-
 GjsPrivate-1.0.gir: libgjs.la
 GjsPrivate_1_0_gir_LIBS = libgjs.la
 GjsPrivate_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
@@ -234,7 +142,7 @@ gjs_console_LDADD =         \
        $(GJS_CONSOLE_LIBS)     \
        libgjs.la
 gjs_console_LDFLAGS = -rdynamic
-gjs_console_SOURCES = gjs/console.cpp
+gjs_console_SOURCES = $(gjs_console_srcs)
 
 install-exec-hook:
        (cd $(DESTDIR)$(bindir) && $(LN_S) -f gjs-console$(EXEEXT) gjs$(EXEEXT))
diff --git a/gjs-modules-srcs.mk b/gjs-modules-srcs.mk
new file mode 100644
index 0000000..ca08fe7
--- /dev/null
+++ b/gjs-modules-srcs.mk
@@ -0,0 +1,34 @@
+module_console_srcs =          \
+       modules/console.h       \
+       modules/console.cpp     \
+       $(NULL)
+
+module_resource_srcs =         \
+       modules-resources.c     \
+       modules-resources.h     \
+       $(NULL)
+
+module_system_srcs =           \
+       modules/system.h        \
+       modules/system.cpp      \
+       $(NULL)
+
+module_cairo_srcs =                            \
+       modules/cairo-private.h                 \
+       modules/cairo-module.h                  \
+       modules/cairo-region.cpp                \
+       modules/cairo-context.cpp               \
+       modules/cairo-path.cpp                  \
+       modules/cairo-surface.cpp               \
+       modules/cairo-image-surface.cpp         \
+       modules/cairo-ps-surface.cpp            \
+       modules/cairo-pdf-surface.cpp           \
+       modules/cairo-svg-surface.cpp           \
+       modules/cairo-pattern.cpp               \
+       modules/cairo-gradient.cpp              \
+       modules/cairo-linear-gradient.cpp       \
+       modules/cairo-radial-gradient.cpp       \
+       modules/cairo-surface-pattern.cpp       \
+       modules/cairo-solid-pattern.cpp         \
+       modules/cairo.cpp                       \
+       $(NULL)
diff --git a/gjs-srcs.mk b/gjs-srcs.mk
new file mode 100644
index 0000000..66ede58
--- /dev/null
+++ b/gjs-srcs.mk
@@ -0,0 +1,107 @@
+gjs_public_headers =           \
+       gjs/context.h           \
+       gjs/coverage.h          \
+       gjs/gjs.h               \
+       gjs/macros.h            \
+       util/error.h            \
+       $(NULL)
+
+# For historical reasons, some files live in gi/
+# Some headers in the following list were formerly
+# public
+
+gjs_srcs =                             \
+       gi/arg.cpp                      \
+       gi/arg.h                        \
+       gi/boxed.cpp                    \
+       gi/boxed.h                      \
+       gi/closure.cpp                  \
+       gi/closure.h                    \
+       gi/enumeration.cpp              \
+       gi/enumeration.h                \
+       gi/foreign.cpp                  \
+       gi/foreign.h                    \
+       gi/fundamental.cpp              \
+       gi/fundamental.h                \
+       gi/function.cpp                 \
+       gi/function.h                   \
+       gi/gerror.cpp                   \
+       gi/gerror.h                     \
+       gi/gjs_gi_trace.h               \
+       gi/gtype.cpp                    \
+       gi/gtype.h                      \
+       gi/interface.cpp                \
+       gi/interface.h                  \
+       gi/keep-alive.cpp               \
+       gi/keep-alive.h                 \
+       gi/ns.cpp                       \
+       gi/ns.h                         \
+       gi/object.cpp                   \
+       gi/object.h                     \
+       gi/param.cpp                    \
+       gi/param.h                      \
+       gi/proxyutils.cpp               \
+       gi/proxyutils.h                 \
+       gi/repo.cpp                     \
+       gi/repo.h                       \
+       gi/union.cpp                    \
+       gi/union.h                      \
+       gi/value.cpp                    \
+       gi/value.h                      \
+       gjs/byteArray.cpp               \
+       gjs/byteArray.h                 \
+       gjs/context.cpp                 \
+       gjs/context-private.h           \
+       gjs/coverage-internal.h         \
+       gjs/coverage.cpp                \
+       gjs/importer.cpp                \
+       gjs/importer.h                  \
+       gjs/jsapi-constructor-proxy.cpp \
+       gjs/jsapi-constructor-proxy.h   \
+       gjs/jsapi-dynamic-class.cpp     \
+       gjs/jsapi-private.cpp           \
+       gjs/jsapi-private.h             \
+       gjs/jsapi-util.cpp              \
+       gjs/jsapi-util.h                \
+       gjs/jsapi-util-args.h           \
+       gjs/jsapi-util-error.cpp        \
+       gjs/jsapi-util-string.cpp       \
+       gjs/jsapi-wrapper.h             \
+       gjs/mem.h                       \
+       gjs/mem.cpp                     \
+       gjs/native.cpp                  \
+       gjs/native.h                    \
+       gjs/runtime.cpp                 \
+       gjs/runtime.h                   \
+       gjs/stack.cpp                   \
+       gjs/type-module.cpp             \
+       gjs/type-module.h               \
+       modules/modules.cpp             \
+       modules/modules.h               \
+       util/error.cpp                  \
+       util/glib.cpp                   \
+       util/glib.h                     \
+       util/hash-x32.cpp               \
+       util/hash-x32.h                 \
+       util/log.cpp                    \
+       util/log.h                      \
+       util/misc.cpp                   \
+       util/misc.h                     \
+       $(NULL)
+
+# These files were part of a separate library
+gjs_private_srcs =                             \
+       libgjs-private/gjs-gdbus-wrapper.cpp    \
+       libgjs-private/gjs-gdbus-wrapper.h      \
+       libgjs-private/gjs-util.cpp             \
+       libgjs-private/gjs-util.h               \
+       libgjs-private/gjs-gtk-util.h           \
+       $(NULL)
+
+gjs_gtk_private_srcs =                 \
+       libgjs-private/gjs-gtk-util.c   \
+       $(NULL)
+
+gjs_console_srcs =     \
+       gjs/console.cpp \
+       $(NULL)


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