Import GIOStream 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         glocalvfs.c                     \
93         glocalvfs.h                     \
94         $(NULL)
95
96 platform_libadd =
97 platform_deps =
98 appinfo_sources =
99
100 if HAVE_INOTIFY
101 SUBDIRS += inotify
102 platform_libadd += inotify/libinotify.la
103 platform_deps += inotify/libinotify.la
104 endif
105
106 if HAVE_FEN
107 AM_CPPFLAGS += -DHAVE_FEN
108 SUBDIRS += fen
109 platform_libadd += fen/libfen.la
110 platform_deps += fen/libfen.la
111 endif
112
113 if OS_WIN32
114 SUBDIRS += win32
115 platform_libadd += win32/libgiowin32.la
116 platform_deps += win32/libgiowin32.la
117 endif
118
119
120 SUBDIRS += .
121
122 if HAVE_FAM
123 SUBDIRS += fam
124 endif
125
126 if OS_UNIX
127 appinfo_sources += gdesktopappinfo.c gdesktopappinfo.h
128 platform_libadd += libasyncns/libasyncns.la xdgmime/libxdgmime.la
129 platform_deps += libasyncns/libasyncns.la xdgmime/libxdgmime.la
130 unix_sources = \
131         gunixmount.c            \
132         gunixmount.h            \
133         gunixmounts.c           \
134         gunixmounts.h           \
135         gunixresolver.c         \
136         gunixresolver.h         \
137         gunixsocketaddress.c    \
138         gunixvolume.c           \
139         gunixvolume.h           \
140         gunixvolumemonitor.c    \
141         gunixvolumemonitor.h    \
142         gunixinputstream.c      \
143         gunixoutputstream.c     \
144         $(NULL)
145
146
147 giounixincludedir=$(includedir)/gio-unix-2.0/gio
148 giounixinclude_HEADERS = \
149         gdesktopappinfo.h       \
150         gunixmounts.h           \
151         gunixinputstream.h      \
152         gunixoutputstream.h     \
153         gunixsocketaddress.h    \
154         $(NULL)
155 endif
156
157 if OS_WIN32
158 appinfo_sources += gwin32appinfo.c gwin32appinfo.h
159 platform_libadd += -lshlwapi -lws2_32 -ldnsapi
160 win32_sources = \
161         gwin32mount.c \
162         gwin32mount.h \
163         gwin32resolver.c \
164         gwin32resolver.h \
165         gwin32volumemonitor.c \
166         gwin32volumemonitor.h \
167         $(NULL)
168
169 endif
170
171 SUBDIRS += tests
172
173 libgio_2_0_la_SOURCES =         \
174         gappinfo.c              \
175         gasynchelper.c          \
176         gasynchelper.h          \
177         gasyncresult.c          \
178         gbufferedinputstream.c  \
179         gbufferedoutputstream.c \
180         gcancellable.c          \
181         gcontenttype.c          \
182         gcontenttypeprivate.h   \
183         gdatainputstream.c      \
184         gdataoutputstream.c     \
185         gdrive.c                \
186         gdummyfile.h            \
187         gdummyfile.c            \
188         gemblem.h               \
189         gemblem.c               \
190         gemblemedicon.h         \
191         gemblemedicon.c         \
192         gfile.c                 \
193         gfileattribute.c        \
194         gfileattribute-priv.h   \
195         gfileenumerator.c       \
196         gfileicon.c             \
197         gfileinfo.c             \
198         gfileinputstream.c      \
199         gfilemonitor.c          \
200         gfilenamecompleter.c    \
201         gfileoutputstream.c     \
202         gfilterinputstream.c    \
203         gfilteroutputstream.c   \
204         gicon.c                 \
205         ginetaddress.c          \
206         ginetsocketaddress.c    \
207         ginputstream.c          \
208         gioenums.h              \
209         gioerror.c              \
210         giomodule.c             \
211         giomodule-priv.h        \
212         gioscheduler.c          \
213         giostream.c             \
214         gloadableicon.c         \
215         gmount.c                \
216         gmemoryinputstream.c    \
217         gmemoryoutputstream.c   \
218         gmountoperation.c       \
219         gnativevolumemonitor.c  \
220         gnativevolumemonitor.h  \
221         gnetworkaddress.c       \
222         gnetworkingprivate.h    \
223         gnetworkservice.c       \
224         goutputstream.c         \
225         gpollfilemonitor.c      \
226         gpollfilemonitor.h      \
227         gresolver.c             \
228         gseekable.c             \
229         gsimpleasyncresult.c    \
230         gsocketaddress.c        \
231         gsocketaddressenumerator.c \
232         gsocketconnectable.c    \
233         gsrvtarget.c            \
234         gthemedicon.c           \
235         gthreadedresolver.c     \
236         gthreadedresolver.h     \
237         gunionvolumemonitor.c   \
238         gunionvolumemonitor.h   \
239         gvfs.c                  \
240         gvolume.c               \
241         gvolumemonitor.c        \
242         gmountprivate.h         \
243         gioenumtypes.h          \
244         gioenumtypes.c          \
245         gioalias.h              \
246         gioaliasdef.c           \
247         $(appinfo_sources)      \
248         $(unix_sources)         \
249         $(win32_sources)        \
250         $(local_sources)        \
251         $(marshal_sources)      \
252         $(NULL)
253
254 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
255
256 libgio_2_0_la_LIBADD = \
257         $(top_builddir)/glib/libglib-2.0.la             \
258         $(top_builddir)/gobject/libgobject-2.0.la       \
259         $(top_builddir)/gmodule/libgmodule-2.0.la       \
260         $(platform_libadd)                              \
261         $(SELINUX_LIBS)                                 \
262         $(GLIB_LIBS)                                    \
263         $(XATTR_LIBS)                                   \
264         $(NULL)
265
266 if PLATFORM_WIN32
267 no_undefined = -no-undefined
268 endif
269
270 if OS_WIN32_AND_DLL_COMPILATION
271 export_symbols = -export-symbols gio.def
272 gio_def = gio.def
273
274 install-def-file:
275         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
276
277 uninstall-def-file:
278         -rm $(DESTDIR)$(libdir)/gio-2.0.def
279 else
280 install-def-file:
281 uninstall-def-file:
282
283 export_symbols = -export-symbols-regex '^g_.*'
284 endif
285
286 install-data-local: install-ms-lib install-def-file
287         $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
288
289 uninstall-local: uninstall-ms-lib uninstall-def-file
290
291 libgio_2_0_la_LDFLAGS = \
292         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
293         -export-dynamic $(no_undefined) $(export_symbols)
294
295 libgio_2_0_la_DEPENDENCIES = $(gio_def) $(platform_deps)
296
297 gio_headers =                   \
298         gappinfo.h              \
299         gasyncresult.h          \
300         gbufferedinputstream.h  \
301         gbufferedoutputstream.h \
302         gcancellable.h          \
303         gcontenttype.h          \
304         gdatainputstream.h      \
305         gdataoutputstream.h     \
306         gdrive.h                \
307         gemblem.h               \
308         gemblemedicon.h         \
309         gfile.h                 \
310         gfileattribute.h        \
311         gfileenumerator.h       \
312         gfileicon.h             \
313         gfileinfo.h             \
314         gfileinputstream.h      \
315         gfilemonitor.h          \
316         gfilenamecompleter.h    \
317         gfileoutputstream.h     \
318         gfilterinputstream.h    \
319         gfilteroutputstream.h   \
320         gicon.h                 \
321         ginetaddress.h          \
322         ginetsocketaddress.h    \
323         ginputstream.h          \
324         gio.h                   \
325         giotypes.h              \
326         gioenums.h              \
327         gioerror.h              \
328         giomodule.h             \
329         gioscheduler.h          \
330         giostream.h             \
331         gloadableicon.h         \
332         gmount.h                \
333         gmemoryinputstream.h    \
334         gmemoryoutputstream.h   \
335         gmountoperation.h       \
336         gnativevolumemonitor.h  \
337         gnetworkaddress.h       \
338         gnetworkservice.h       \
339         goutputstream.h         \
340         gresolver.h             \
341         gseekable.h             \
342         gsimpleasyncresult.h    \
343         gsocketaddress.h        \
344         gsocketaddressenumerator.h \
345         gsocketconnectable.h    \
346         gsrvtarget.h            \
347         gthemedicon.h           \
348         gvfs.h                  \
349         gvolume.h               \
350         gvolumemonitor.h        \
351         $(NULL)
352
353 gioincludedir=$(includedir)/glib-2.0/gio/
354 gioinclude_HEADERS =            \
355         $(gio_headers)          \
356         gioenumtypes.h
357
358 # these sources (also mentioned above) are generated.
359 BUILT_SOURCES =                 \
360         gio-marshal.h           \
361         gio-marshal.c           \
362         gioalias.h              \
363         gioaliasdef.c           \
364         gioenumtypes.h          \
365         gioenumtypes.c          \
366         $(NULL)
367
368 EXTRA_DIST +=                   \
369         gio-marshal.list        \
370         gio.symbols             \
371         gioenumtypes.h.template \
372         gioenumtypes.c.template \
373         makefile.msc            \
374         makegioalias.pl         \
375         abicheck.sh             \
376         pltcheck.sh             \
377         $(NULL)
378
379 CLEANFILES =                    \
380         $(marshal_sources)      \
381         $(NULL)
382
383 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
384         ( top_builddir=`cd $(top_builddir) && pwd`; \
385           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
386             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
387
388 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
389         ( top_builddir=`cd $(top_builddir) && pwd`; \
390           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
391             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
392
393 gio-2.0.lib: libgio-2.0.la gio.def
394         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@