Import GInitable, GSocket and dependencies from gnio
[platform/upstream/glib.git] / gio / Makefile.am
1 include $(top_srcdir)/Makefile.decl
2
3 NULL =
4
5 SUBDIRS=
6
7 if OS_UNIX
8 SUBDIRS += libasyncns xdgmime
9 endif
10
11 if OS_WIN32_AND_DLL_COMPILATION
12 if MS_LIB_AVAILABLE
13 noinst_DATA = gio-2.0.lib
14
15 install_ms_lib_cmd = $(INSTALL) gio-2.0.lib $(DESTDIR)$(libdir)
16 uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gio-2.0.lib
17 endif
18 endif
19
20 install-ms-lib:
21         $(install_ms_lib_cmd)
22
23 uninstall-ms-lib:
24         $(uninstall_ms_lib_cmd)
25
26 gio.def: gio.symbols
27         (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gio.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g' | sort) > gio.def.tmp && \
28           mv gio.def.tmp gio.def
29
30 gioalias.h: gio.symbols
31         $(PERL) $(srcdir)/makegioalias.pl < $(srcdir)/gio.symbols > gioalias.h.tmp && \
32           mv gioalias.h.tmp gioalias.h
33
34 gioaliasdef.c: gio.symbols
35         $(PERL) $(srcdir)/makegioalias.pl -def < $(srcdir)/gio.symbols > gioaliasdef.c.tmp && \
36           mv gioaliasdef.c.tmp gioaliasdef.c
37
38 if OS_LINUX
39 if HAVE_GNUC_VISIBILITY
40 TESTS = abicheck.sh pltcheck.sh
41 endif
42 endif
43
44 AM_CPPFLAGS = \
45         -DG_LOG_DOMAIN=\"GLib-GIO\"                     \
46         -I$(top_builddir)                               \
47         -I$(top_srcdir)                                 \
48         -I$(top_srcdir)/glib                            \
49         -I$(top_srcdir)/gmodule                         \
50         $(GLIB_DEBUG_FLAGS)                             \
51         -DG_DISABLE_DEPRECATED                          \
52         -DGIO_COMPILATION                               \
53         -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\"  
54
55 lib_LTLIBRARIES = libgio-2.0.la
56
57 marshal_sources = \
58         gio-marshal.h   \
59         gio-marshal.c   \
60         $(NULL)
61
62 if CROSS_COMPILING
63   glib_genmarshal=$(GLIB_GENMARSHAL)
64 else
65   glib_genmarshal=../gobject/glib-genmarshal
66 endif
67
68 gio-marshal.h: gio-marshal.list
69         $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --header --internal > $@.tmp && \
70           mv $@.tmp $@
71
72 gio-marshal.c: gio-marshal.h gio-marshal.list
73         (echo "#include \"gio-marshal.h\""; \
74         $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --body --internal) > $@.tmp && \
75           mv $@.tmp $@
76
77 local_sources = \
78         glocaldirectorymonitor.c        \
79         glocaldirectorymonitor.h        \
80         glocalfile.c                    \
81         glocalfile.h                    \
82         glocalfileenumerator.c          \
83         glocalfileenumerator.h          \
84         glocalfileinfo.c                \
85         glocalfileinfo.h                \
86         glocalfileinputstream.c         \
87         glocalfileinputstream.h         \
88         glocalfilemonitor.c             \
89         glocalfilemonitor.h             \
90         glocalfileoutputstream.c        \
91         glocalfileoutputstream.h        \
92         glocalfileiostream.c            \
93         glocalfileiostream.h            \
94         glocalvfs.c                     \
95         glocalvfs.h                     \
96         $(NULL)
97
98 platform_libadd =
99 platform_deps =
100 appinfo_sources =
101
102 if HAVE_INOTIFY
103 SUBDIRS += inotify
104 platform_libadd += inotify/libinotify.la
105 platform_deps += inotify/libinotify.la
106 endif
107
108 if HAVE_FEN
109 AM_CPPFLAGS += -DHAVE_FEN
110 SUBDIRS += fen
111 platform_libadd += fen/libfen.la
112 platform_deps += fen/libfen.la
113 endif
114
115 if OS_WIN32
116 SUBDIRS += win32
117 platform_libadd += win32/libgiowin32.la
118 platform_deps += win32/libgiowin32.la
119 endif
120
121
122 SUBDIRS += .
123
124 if HAVE_FAM
125 SUBDIRS += fam
126 endif
127
128 if OS_UNIX
129 appinfo_sources += gdesktopappinfo.c gdesktopappinfo.h
130 platform_libadd += libasyncns/libasyncns.la xdgmime/libxdgmime.la
131 platform_deps += libasyncns/libasyncns.la xdgmime/libxdgmime.la
132 unix_sources = \
133         gunixfdmessage.c        \
134         gunixmount.c            \
135         gunixmount.h            \
136         gunixmounts.c           \
137         gunixmounts.h           \
138         gunixresolver.c         \
139         gunixresolver.h         \
140         gunixsocketaddress.c    \
141         gunixvolume.c           \
142         gunixvolume.h           \
143         gunixvolumemonitor.c    \
144         gunixvolumemonitor.h    \
145         gunixinputstream.c      \
146         gunixoutputstream.c     \
147         $(NULL)
148
149
150 giounixincludedir=$(includedir)/gio-unix-2.0/gio
151 giounixinclude_HEADERS = \
152         gdesktopappinfo.h       \
153         gunixmounts.h           \
154         gunixfdmessage.h        \
155         gunixinputstream.h      \
156         gunixoutputstream.h     \
157         gunixsocketaddress.h    \
158         $(NULL)
159 endif
160
161 if OS_WIN32
162 appinfo_sources += gwin32appinfo.c gwin32appinfo.h
163 platform_libadd += -lshlwapi -lws2_32 -ldnsapi
164 win32_sources = \
165         gwin32mount.c \
166         gwin32mount.h \
167         gwin32resolver.c \
168         gwin32resolver.h \
169         gwin32volumemonitor.c \
170         gwin32volumemonitor.h \
171         $(NULL)
172
173 endif
174
175 SUBDIRS += tests
176
177 libgio_2_0_la_SOURCES =         \
178         gappinfo.c              \
179         gasynchelper.c          \
180         gasynchelper.h          \
181         gasyncinitable.c        \
182         gasyncresult.c          \
183         gbufferedinputstream.c  \
184         gbufferedoutputstream.c \
185         gcancellable.c          \
186         gcontenttype.c          \
187         gcontenttypeprivate.h   \
188         gdatainputstream.c      \
189         gdataoutputstream.c     \
190         gdrive.c                \
191         gdummyfile.h            \
192         gdummyfile.c            \
193         gemblem.h               \
194         gemblem.c               \
195         gemblemedicon.h         \
196         gemblemedicon.c         \
197         gfile.c                 \
198         gfileattribute.c        \
199         gfileattribute-priv.h   \
200         gfileenumerator.c       \
201         gfileicon.c             \
202         gfileinfo.c             \
203         gfileinputstream.c      \
204         gfilemonitor.c          \
205         gfilenamecompleter.c    \
206         gfileoutputstream.c     \
207         gfileiostream.c         \
208         gfilterinputstream.c    \
209         gfilteroutputstream.c   \
210         gicon.c                 \
211         ginetaddress.c          \
212         ginetsocketaddress.c    \
213         ginitable.c             \
214         ginputstream.c          \
215         gioenums.h              \
216         gioerror.c              \
217         giomodule.c             \
218         giomodule-priv.h        \
219         gioscheduler.c          \
220         giostream.c             \
221         gloadableicon.c         \
222         gmount.c                \
223         gmemoryinputstream.c    \
224         gmemoryoutputstream.c   \
225         gmountoperation.c       \
226         gnativevolumemonitor.c  \
227         gnativevolumemonitor.h  \
228         gnetworkaddress.c       \
229         gnetworkingprivate.h    \
230         gnetworkservice.c       \
231         goutputstream.c         \
232         gpollfilemonitor.c      \
233         gpollfilemonitor.h      \
234         gresolver.c             \
235         gseekable.c             \
236         gsimpleasyncresult.c    \
237         gsocket.c               \
238         gsocketcontrolmessage.c \
239         gsocketaddress.c        \
240         gsocketaddressenumerator.c \
241         gsocketconnectable.c    \
242         gsrvtarget.c            \
243         gthemedicon.c           \
244         gthreadedresolver.c     \
245         gthreadedresolver.h     \
246         gunionvolumemonitor.c   \
247         gunionvolumemonitor.h   \
248         gvfs.c                  \
249         gvolume.c               \
250         gvolumemonitor.c        \
251         gmountprivate.h         \
252         gioenumtypes.h          \
253         gioenumtypes.c          \
254         gioalias.h              \
255         gioaliasdef.c           \
256         $(appinfo_sources)      \
257         $(unix_sources)         \
258         $(win32_sources)        \
259         $(local_sources)        \
260         $(marshal_sources)      \
261         $(NULL)
262
263 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
264
265 libgio_2_0_la_LIBADD = \
266         $(top_builddir)/glib/libglib-2.0.la             \
267         $(top_builddir)/gobject/libgobject-2.0.la       \
268         $(top_builddir)/gmodule/libgmodule-2.0.la       \
269         $(platform_libadd)                              \
270         $(SELINUX_LIBS)                                 \
271         $(GLIB_LIBS)                                    \
272         $(XATTR_LIBS)                                   \
273         $(NULL)
274
275 if PLATFORM_WIN32
276 no_undefined = -no-undefined
277 endif
278
279 if OS_WIN32_AND_DLL_COMPILATION
280 export_symbols = -export-symbols gio.def
281 gio_def = gio.def
282
283 install-def-file:
284         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
285
286 uninstall-def-file:
287         -rm $(DESTDIR)$(libdir)/gio-2.0.def
288 else
289 install-def-file:
290 uninstall-def-file:
291
292 export_symbols = -export-symbols-regex '^g_.*'
293 endif
294
295 install-data-local: install-ms-lib install-def-file
296         $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
297
298 uninstall-local: uninstall-ms-lib uninstall-def-file
299
300 libgio_2_0_la_LDFLAGS = \
301         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
302         -export-dynamic $(no_undefined) $(export_symbols)
303
304 libgio_2_0_la_DEPENDENCIES = $(gio_def) $(platform_deps)
305
306 gio_headers =                   \
307         gappinfo.h              \
308         gasyncinitable.h        \
309         gasyncresult.h          \
310         gbufferedinputstream.h  \
311         gbufferedoutputstream.h \
312         gcancellable.h          \
313         gcontenttype.h          \
314         gdatainputstream.h      \
315         gdataoutputstream.h     \
316         gdrive.h                \
317         gemblem.h               \
318         gemblemedicon.h         \
319         gfile.h                 \
320         gfileattribute.h        \
321         gfileenumerator.h       \
322         gfileicon.h             \
323         gfileinfo.h             \
324         gfileinputstream.h      \
325         gfilemonitor.h          \
326         gfilenamecompleter.h    \
327         gfileoutputstream.h     \
328         gfileiostream.h         \
329         gfilterinputstream.h    \
330         gfilteroutputstream.h   \
331         gicon.h                 \
332         ginetaddress.h          \
333         ginetsocketaddress.h    \
334         ginputstream.h          \
335         ginitable.h             \
336         gio.h                   \
337         giotypes.h              \
338         gioenums.h              \
339         gioerror.h              \
340         giomodule.h             \
341         gioscheduler.h          \
342         giostream.h             \
343         gloadableicon.h         \
344         gmount.h                \
345         gmemoryinputstream.h    \
346         gmemoryoutputstream.h   \
347         gmountoperation.h       \
348         gnativevolumemonitor.h  \
349         gnetworkaddress.h       \
350         gnetworkservice.h       \
351         goutputstream.h         \
352         gresolver.h             \
353         gseekable.h             \
354         gsimpleasyncresult.h    \
355         gsocket.h               \
356         gsocketcontrolmessage.h \
357         gsocketaddress.h        \
358         gsocketaddressenumerator.h \
359         gsocketconnectable.h    \
360         gsrvtarget.h            \
361         gthemedicon.h           \
362         gvfs.h                  \
363         gvolume.h               \
364         gvolumemonitor.h        \
365         $(NULL)
366
367 gioincludedir=$(includedir)/glib-2.0/gio/
368 gioinclude_HEADERS =            \
369         $(gio_headers)          \
370         gioenumtypes.h
371
372 # these sources (also mentioned above) are generated.
373 BUILT_SOURCES =                 \
374         gio-marshal.h           \
375         gio-marshal.c           \
376         gioalias.h              \
377         gioaliasdef.c           \
378         gioenumtypes.h          \
379         gioenumtypes.c          \
380         $(NULL)
381
382 EXTRA_DIST +=                   \
383         gio-marshal.list        \
384         gio.symbols             \
385         gioenumtypes.h.template \
386         gioenumtypes.c.template \
387         makefile.msc            \
388         makegioalias.pl         \
389         abicheck.sh             \
390         pltcheck.sh             \
391         $(NULL)
392
393 CLEANFILES =                    \
394         $(marshal_sources)      \
395         $(NULL)
396
397 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
398         ( top_builddir=`cd $(top_builddir) && pwd`; \
399           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
400             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
401
402 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
403         ( top_builddir=`cd $(top_builddir) && pwd`; \
404           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
405             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
406
407 gio-2.0.lib: libgio-2.0.la gio.def
408         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@