summaryrefslogtreecommitdiff
path: root/gio/Makefile.am
blob: b412043ac931b96394a2e0c53d690e2103545974 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
AUTOMAKE_OPTIONS = 1.7

PLATFORM_VERSION = 2.0

INCLUDES = 				\
	-I$(top_srcdir)/glib		\
	-I$(top_srcdir)/gobject		\
	$(PYTHON_INCLUDES) 		\
	$(PYGOBJECT_CFLAGS)		\
	$(GIO_CFLAGS)

# defs files
defsdir = $(pkgdatadir)/$(PLATFORM_VERSION)/defs
defs_DATA =

# python
pyexec_LTLIBRARIES =

# gio extension modules
pkgpyexecdir = $(pyexecdir)/gtk-2.0/gio
pkgpyexec_LTLIBRARIES =

# gio python scripts
pygiodir = $(pkgpyexecdir)
pygio_PYTHON = 	__init__.py

# linker flags
common_ldflags = -module -avoid-version
if PLATFORM_WIN32
common_ldflags += -no-undefined
endif

CLEANFILES =
EXTRA_DIST =

# gio module
GIO_OVERRIDES = 			\
	gio.override			\
	gappinfo.override		\
	gapplaunchcontext.override 	\
	gbufferedinputstream.override	\
	gcancellable.override		\
	gdatainputstream.override	\
	gdrive.override			\
	gfile.override			\
	gfileattribute.override		\
	gfileenumerator.override	\
	gfileinfo.override		\
	gfileinputstream.override	\
	gfileiostream.override		\
	gfileoutputstream.override	\
	gicon.override			\
	giostream.override		\
	ginputstream.override 		\
	gmemoryinputstream.override	\
	gmemoryoutputstream.override	\
	gmount.override			\
	goutputstream.override 		\
	gresolver.override		\
	gsocket.override		\
	gvolume.override		\
	gvolumemonitor.override

GIO_DEFS = gio.defs gio-types.defs $(GIO_OVERRIDES)
CLEANFILES += gio.c
EXTRA_DIST += $(GIO_DEFS) $(GIO_OVERRIDES)
gio.c: $(GIO_DEFS) $(GIO_OVERRIDES)
_gio_la_CFLAGS = $(GIO_CFLAGS)
_gio_la_LDFLAGS = $(common_ldflags) -export-symbols-regex init_gio
_gio_la_LIBADD = $(GIO_LIBS) $(top_builddir)/glib/libpyglib-2.0-@PYTHON_BASENAME@.la
_gio_la_SOURCES = \
	giomodule.c \
	pygio-utils.c \
	pygio-utils.h
nodist__gio_la_SOURCES = gio.c
if BUILD_GIO
pkgpyexec_LTLIBRARIES += _gio.la
defs_DATA += $(GIO_DEFS)
endif

# giounix module
GIOUNIX_DEFS = unix.defs unix-types.defs unix.override
CLEANFILES += unix.c
EXTRA_DIST += $(GIOUNIX_DEFS) unix.override
unix.c: $(GIOUNIX_DEFS) unix.override
unix_la_CFLAGS = $(GIOUNIX_CFLAGS)
unix_la_LDFLAGS = $(common_ldflags) -export-symbols-regex initunix
unix_la_LIBADD = $(GIOUNIX_LIBS) $(PYTHON_LIBS)
unix_la_SOURCES = unixmodule.c
nodist_unix_la_SOURCES = unix.c
if BUILD_GIOUNIX
pkgpyexec_LTLIBRARIES += unix.la
defs_DATA += $(GIOUNIX_DEFS)
endif


# code generator
.defs.c:
	(cd $(srcdir)\
	 && $(PYTHON) $(top_srcdir)/codegen/codegen.py \
	    --py_ssize_t-clean \
	    --register gio-types.defs \
	    --register unix-types.defs \
	    --override $*.override \
	    --prefix py$(*F) $*.defs) > $(*D)/gen-$(*F).c \
	&& cp $(*D)/gen-$(*F).c $(*D)/$(*F).c \
	&& rm -f $(*D)/gen-$(*F).c


if BUILD_GIO
all: $(pkgpyexec_LTLIBRARIES:.la=.so)
check-local: $(pkgpyexec_LTLIBRARIES:.la=.so)
clean-local:
	rm -f $(pkgpyexec_LTLIBRARIES:.la=.so)
.la.so:
	$(LN_S) .libs/$@ $@ || true
endif