Move gio tests from gio/tests/ to tests/gio/
[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         gunixconnection.c       \
134         gunixfdmessage.c        \
135         gunixmount.c            \
136         gunixmount.h            \
137         gunixmounts.c           \
138         gunixmounts.h           \
139         gunixresolver.c         \
140         gunixresolver.h         \
141         gunixsocketaddress.c    \
142         gunixvolume.c           \
143         gunixvolume.h           \
144         gunixvolumemonitor.c    \
145         gunixvolumemonitor.h    \
146         gunixinputstream.c      \
147         gunixoutputstream.c     \
148         $(NULL)
149
150
151 giounixincludedir=$(includedir)/gio-unix-2.0/gio
152 giounixinclude_HEADERS = \
153         gdesktopappinfo.h       \
154         gunixconnection.h       \
155         gunixmounts.h           \
156         gunixfdmessage.h        \
157         gunixinputstream.h      \
158         gunixoutputstream.h     \
159         gunixsocketaddress.h    \
160         $(NULL)
161 endif
162
163 if OS_WIN32
164 appinfo_sources += gwin32appinfo.c gwin32appinfo.h
165 platform_libadd += -lshlwapi -lws2_32 -ldnsapi
166 win32_sources = \
167         gwin32mount.c \
168         gwin32mount.h \
169         gwin32resolver.c \
170         gwin32resolver.h \
171         gwin32volumemonitor.c \
172         gwin32volumemonitor.h \
173         $(NULL)
174
175 endif
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         gfileinfo-priv.h        \
204         gfileinputstream.c      \
205         gfilemonitor.c          \
206         gfilenamecompleter.c    \
207         gfileoutputstream.c     \
208         gfileiostream.c         \
209         gfilterinputstream.c    \
210         gfilteroutputstream.c   \
211         gicon.c                 \
212         ginetaddress.c          \
213         ginetsocketaddress.c    \
214         ginitable.c             \
215         ginputstream.c          \
216         gioenums.h              \
217         gioerror.c              \
218         giomodule.c             \
219         giomodule-priv.h        \
220         gioscheduler.c          \
221         giostream.c             \
222         gloadableicon.c         \
223         gmount.c                \
224         gmemoryinputstream.c    \
225         gmemoryoutputstream.c   \
226         gmountoperation.c       \
227         gnativevolumemonitor.c  \
228         gnativevolumemonitor.h  \
229         gnetworkaddress.c       \
230         gnetworkingprivate.h    \
231         gnetworkservice.c       \
232         goutputstream.c         \
233         gpollfilemonitor.c      \
234         gpollfilemonitor.h      \
235         gresolver.c             \
236         gseekable.c             \
237         gsimpleasyncresult.c    \
238         gsocket.c               \
239         gsocketaddress.c        \
240         gsocketaddressenumerator.c \
241         gsocketclient.c         \
242         gsocketconnectable.c    \
243         gsocketconnection.c     \
244         gsocketcontrolmessage.c \
245         gsocketinputstream.c    \
246         gsocketinputstream.h    \
247         gsocketlistener.c       \
248         gsocketoutputstream.c   \
249         gsocketoutputstream.h   \
250         gsocketservice.c        \
251         gsrvtarget.c            \
252         gtcpconnection.c        \
253         gthreadedsocketservice.c\
254         gthemedicon.c           \
255         gthreadedresolver.c     \
256         gthreadedresolver.h     \
257         gunionvolumemonitor.c   \
258         gunionvolumemonitor.h   \
259         gvfs.c                  \
260         gvolume.c               \
261         gvolumemonitor.c        \
262         gmountprivate.h         \
263         gioenumtypes.h          \
264         gioenumtypes.c          \
265         gioalias.h              \
266         gioaliasdef.c           \
267         $(appinfo_sources)      \
268         $(unix_sources)         \
269         $(win32_sources)        \
270         $(local_sources)        \
271         $(marshal_sources)      \
272         $(NULL)
273
274 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
275
276 libgio_2_0_la_LIBADD = \
277         $(top_builddir)/glib/libglib-2.0.la             \
278         $(top_builddir)/gobject/libgobject-2.0.la       \
279         $(top_builddir)/gmodule/libgmodule-2.0.la       \
280         $(platform_libadd)                              \
281         $(SELINUX_LIBS)                                 \
282         $(GLIB_LIBS)                                    \
283         $(XATTR_LIBS)                                   \
284         $(NULL)
285
286 if PLATFORM_WIN32
287 no_undefined = -no-undefined
288 endif
289
290 if OS_WIN32_AND_DLL_COMPILATION
291 export_symbols = -export-symbols gio.def
292 gio_def = gio.def
293
294 install-def-file:
295         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
296
297 uninstall-def-file:
298         -rm $(DESTDIR)$(libdir)/gio-2.0.def
299 else
300 install-def-file:
301 uninstall-def-file:
302
303 export_symbols = -export-symbols-regex '^g_.*'
304 endif
305
306 install-data-local: install-ms-lib install-def-file
307         $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
308
309 uninstall-local: uninstall-ms-lib uninstall-def-file
310
311 libgio_2_0_la_LDFLAGS = \
312         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
313         -export-dynamic $(no_undefined) $(export_symbols)
314
315 libgio_2_0_la_DEPENDENCIES = $(gio_def) $(platform_deps)
316
317 gio_headers =                   \
318         gappinfo.h              \
319         gasyncinitable.h        \
320         gasyncresult.h          \
321         gbufferedinputstream.h  \
322         gbufferedoutputstream.h \
323         gcancellable.h          \
324         gcontenttype.h          \
325         gdatainputstream.h      \
326         gdataoutputstream.h     \
327         gdrive.h                \
328         gemblem.h               \
329         gemblemedicon.h         \
330         gfile.h                 \
331         gfileattribute.h        \
332         gfileenumerator.h       \
333         gfileicon.h             \
334         gfileinfo.h             \
335         gfileinputstream.h      \
336         gfilemonitor.h          \
337         gfilenamecompleter.h    \
338         gfileoutputstream.h     \
339         gfileiostream.h         \
340         gfilterinputstream.h    \
341         gfilteroutputstream.h   \
342         gicon.h                 \
343         ginetaddress.h          \
344         ginetsocketaddress.h    \
345         ginputstream.h          \
346         ginitable.h             \
347         gio.h                   \
348         giotypes.h              \
349         gioenums.h              \
350         gioerror.h              \
351         giomodule.h             \
352         gioscheduler.h          \
353         giostream.h             \
354         gloadableicon.h         \
355         gmount.h                \
356         gmemoryinputstream.h    \
357         gmemoryoutputstream.h   \
358         gmountoperation.h       \
359         gnativevolumemonitor.h  \
360         gnetworkaddress.h       \
361         gnetworkservice.h       \
362         goutputstream.h         \
363         gresolver.h             \
364         gseekable.h             \
365         gsimpleasyncresult.h    \
366         gsocket.h               \
367         gsocketaddress.h        \
368         gsocketaddressenumerator.h \
369         gsocketclient.h         \
370         gsocketconnectable.h    \
371         gsocketconnection.h     \
372         gsocketcontrolmessage.h \
373         gsocketlistener.h       \
374         gsocketservice.h        \
375         gsrvtarget.h            \
376         gtcpconnection.h        \
377         gthreadedsocketservice.h\
378         gthemedicon.h           \
379         gvfs.h                  \
380         gvolume.h               \
381         gvolumemonitor.h        \
382         $(NULL)
383
384 gioincludedir=$(includedir)/glib-2.0/gio/
385 gioinclude_HEADERS =            \
386         $(gio_headers)          \
387         gioenumtypes.h
388
389 # these sources (also mentioned above) are generated.
390 BUILT_SOURCES =                 \
391         gio-marshal.h           \
392         gio-marshal.c           \
393         gioalias.h              \
394         gioaliasdef.c           \
395         gioenumtypes.h          \
396         gioenumtypes.c          \
397         $(NULL)
398
399 EXTRA_DIST +=                   \
400         gio-marshal.list        \
401         gio.symbols             \
402         gioenumtypes.h.template \
403         gioenumtypes.c.template \
404         makefile.msc            \
405         makegioalias.pl         \
406         abicheck.sh             \
407         pltcheck.sh             \
408         $(NULL)
409
410 CLEANFILES =                    \
411         $(marshal_sources)      \
412         $(NULL)
413
414 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
415         ( top_builddir=`cd $(top_builddir) && pwd`; \
416           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
417             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
418
419 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
420         ( top_builddir=`cd $(top_builddir) && pwd`; \
421           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
422             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
423
424 gio-2.0.lib: libgio-2.0.la gio.def
425         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@
426
427 if HAVE_GLIB_RUNTIME_LIBDIR
428 install-data-hook:
429         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
430         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
431         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0.$(LT_CURRENT).0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
432         rm -f $(DESTDIR)$(libdir)/libgio-2.0.so
433         ln -s $(GLIB_RUNTIME_LIBDIR)/libgio-2.0.so.0.$(LT_CURRENT).0 $(DESTDIR)$(libdir)/libgio-2.0.so
434 endif