Imported Upstream version 3.3.1
[platform/upstream/pygobject2.git] / gi / Makefile.am
index 3841075..c51d551 100644 (file)
@@ -1,8 +1,8 @@
-PLATFORM_VERSION = 3.0
-
 SUBDIRS = \
        repository \
-       overrides
+       overrides \
+        _glib \
+       _gobject
 
 extension_cppflags = \
        $(PYTHON_INCLUDES) \
@@ -10,8 +10,7 @@ extension_cppflags = \
 
 extension_ldflags = \
        -module \
-       -avoid-version \
-       -shrext $(PYTHON_SO)
+       -avoid-version
 
 if OS_WIN32
 # Windows requires Python modules to be explicitly linked to libpython.
@@ -21,64 +20,34 @@ extension_libadd = \
        $(PYTHON_LIBS)
 
 extension_ldflags += \
-       -no-undefined
-endif
-
-pkgincludedir = $(includedir)/pygobject-$(PLATFORM_VERSION)
-if WITH_COMMON
-pkginclude_HEADERS = pygobject.h
+       -no-undefined \
+       -shrext ".pyd"
 endif
 
 pygidir = $(pyexecdir)/gi
 
+pygi_PYTHON = \
+       __init__.py \
+       types.py \
+       module.py \
+       importer.py \
+       pygtkcompat.py
+
 pygi_LTLIBRARIES = _gi.la
 
 _gi_la_SOURCES = \
-       gobjectmodule.c \
-       gobjectmodule.h \
-       pygboxed.c \
-       pygboxed.h \
-       pygenum.c \
-       pygenum.h \
-       pygflags.c \
-       pygflags.h \
-       pyginterface.c \
-       pyginterface.h \
-       pygobject.h \
-       pygobject-internal.h \
-       pygobject-object.c \
-       pygobject-object.h \
-       pygparamspec.c \
-       pygparamspec.h \
-       pygpointer.c \
-       pygpointer.h \
-       pygtype.c \
-       pygtype.h \
-       pygoptioncontext.c \
-       pygoptioncontext.h \
-       pygoptiongroup.c \
-       pygoptiongroup.h \
-       pygspawn.c \
-       pygspawn.h \
-       pyglib.c \
-       pyglib.h \
-       pyglib-python-compat.h \
-       gimodule.c \
        pygi-repository.c \
        pygi-repository.h \
        pygi-info.c \
        pygi-info.h \
        pygi-foreign.c \
        pygi-foreign.h \
-       pygi-foreign-api.h \
+       pygi-foreign-gvariant.c \
+       pygi-foreign-gvariant.h \
        pygi-struct.c \
        pygi-struct.h \
-       pygi-source.c \
-       pygi-source.h \
        pygi-argument.c \
        pygi-argument.h \
-       pygi-resulttuple.c \
-       pygi-resulttuple.h \
        pygi-type.c \
        pygi-type.h \
        pygi-boxed.c \
@@ -87,54 +56,38 @@ _gi_la_SOURCES = \
        pygi-closure.h \
        pygi-ccallback.c \
        pygi-ccallback.h \
-       pygi-util.c \
-       pygi-util.h \
+       pygi-callbacks.c \
+       pygi-callbacks.h \
+       pygi.h \
+       pygi-private.h \
        pygi-property.c \
        pygi-property.h \
        pygi-signal-closure.c \
        pygi-signal-closure.h \
+       pygobject-external.h \
+       gimodule.c \
        pygi-invoke.c \
        pygi-invoke.h \
        pygi-invoke-state-struct.h \
        pygi-cache.h \
        pygi-cache.c \
+       pygi-marshal-from-py.c \
+       pygi-marshal-from-py.h \
+       pygi-marshal-to-py.c \
+       pygi-marshal-to-py.h \
        pygi-marshal-cleanup.c \
-       pygi-marshal-cleanup.h \
-       pygi-basictype.c \
-       pygi-basictype.h \
-       pygi-list.c \
-       pygi-list.h \
-       pygi-array.c \
-       pygi-array.h \
-       pygi-error.c \
-       pygi-error.h \
-       pygi-object.c \
-       pygi-object.h \
-       pygi-value.c \
-       pygi-value.h \
-       pygi-enum-marshal.c \
-       pygi-enum-marshal.h \
-       pygi-struct-marshal.c \
-       pygi-struct-marshal.h \
-       pygi-hashtable.c \
-       pygi-hashtable.h
+       pygi-marshal-cleanup.h
 _gi_la_CFLAGS = \
-       $(CODE_COVERAGE_CFLAGS) \
-       $(WARN_CFLAGS) \
-       $(extension_cppflags) \
-       $(GLIB_CFLAGS) \
        $(GI_CFLAGS)
 _gi_la_CPPFLAGS = \
-       $(CODE_COVERAGE_CPPFLAGS) \
-       $(extension_cppflags)
+       $(extension_cppflags) \
+       -I$(top_srcdir)/gi/_glib \
+       -I$(top_srcdir)/gi/_gobject
 _gi_la_LIBADD = \
-       $(CODE_COVERAGE_LIBS) \
        $(extension_libadd) \
-       $(GLIB_LIBS) \
        $(GI_LIBS) \
-       $(FFI_LIBS)
+       $(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la
 _gi_la_LDFLAGS = \
-       $(WARN_LDFLAGS) \
        $(extension_ldflags) \
        -export-symbols-regex "init_gi|PyInit__gi"
 
@@ -145,22 +98,17 @@ endif
 _gi_cairo_la_SOURCES = \
        pygi-foreign-cairo.c
 _gi_cairo_la_CFLAGS = \
-       $(CODE_COVERAGE_CFLAGS) \
-       $(WARN_CFLAGS) \
        $(GI_CFLAGS) \
-       $(CAIRO_CFLAGS) \
        $(PYCAIRO_CFLAGS)
 _gi_cairo_la_CPPFLAGS = \
-       $(CODE_COVERAGE_CPPFLAGS) \
-       $(extension_cppflags)
+       $(extension_cppflags) \
+       -I$(top_srcdir)/gi/_glib \
+       -I$(top_srcdir)/gi/_gobject
 _gi_cairo_la_LIBADD = \
-       $(CODE_COVERAGE_LIBS) \
        $(extension_libadd) \
        $(GI_LIBS) \
-       $(CAIRO_LIBS) \
        $(PYCAIRO_LIBS)
 _gi_cairo_la_LDFLAGS = \
-       $(WARN_LDFLAGS) \
        $(extension_ldflags) \
        -export-symbols-regex "init_gi_cairo|PyInit__gi_cairo"
 
@@ -168,11 +116,22 @@ _gi_cairo_la_LDFLAGS = \
 # This is to ensure we have a symlink to the .so in the
 # build directory, which the Python interpreter can load
 # directly without having to know how to parse .la files.
-%$(PYTHON_SO): %.la
-       $(LN_S) -f .libs/$@ $@
+.la.so:
+       $(LN_S) .libs/$@ $@ || true
 
-all-local: $(LTLIBRARIES:.la=$(PYTHON_SO))
+# if we build in a separate tree, we need to symlink the *.py files from the
+# source tree; Python does not accept the extensions and modules in different
+# paths
+build_pylinks:
+       for f in $(pygi_PYTHON); do \
+           [ -e $(builddir)/$$f ] || $(LN_S) $(srcdir)/$$f $(builddir)/$$f; \
+       done
 
-check-local: $(LTLIBRARIES:.la=$(PYTHON_SO))
+all-local: $(LTLIBRARIES:.la=.so) build_pylinks
+
+check-local: $(LTLIBRARIES:.la=.so) build_pylinks
 clean-local:
-       rm -f $(LTLIBRARIES:.la=$(PYTHON_SO))
+       rm -f $(LTLIBRARIES:.la=.so)
+
+
+-include $(top_srcdir)/git.mk