Merge remote branch 'gvdb/master'
[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 if HAVE_THREADS
45 THREAD_FLAGS=-DG_THREADS_MANDATORY
46 endif
47
48 AM_CPPFLAGS = \
49         -DG_LOG_DOMAIN=\"GLib-GIO\"                     \
50         -I$(top_builddir)                               \
51         -I$(top_srcdir)                                 \
52         -I$(top_srcdir)/glib                            \
53         -I$(top_srcdir)/gmodule                         \
54         $(GLIB_DEBUG_FLAGS)                             \
55         $(THREAD_FLAGS)                                 \
56         -DG_DISABLE_DEPRECATED                          \
57         -DGIO_COMPILATION                               \
58         -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\"  
59
60 lib_LTLIBRARIES = libgio-2.0.la
61
62 marshal_sources = \
63         gio-marshal.h   \
64         gio-marshal.c   \
65         $(NULL)
66
67 if CROSS_COMPILING
68   glib_genmarshal=$(GLIB_GENMARSHAL)
69 else
70   glib_genmarshal=../gobject/glib-genmarshal
71 endif
72
73 gio-marshal.h: gio-marshal.list
74         $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --header --internal > $@.tmp && \
75           mv $@.tmp $@
76
77 gio-marshal.c: gio-marshal.h gio-marshal.list
78         (echo "#include \"gio-marshal.h\""; \
79         $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --body --internal) > $@.tmp && \
80           mv $@.tmp $@
81
82 settings_headers = \
83         gsettingsbackend.h              \
84         gsettings.h
85
86 settings_sources = \
87         gvdb/gvdb-format.h              \
88         gvdb/gvdb-reader.h              \
89         gvdb/gvdb-reader.c              \
90         gdelayedsettingsbackend.h       \
91         gdelayedsettingsbackend.c       \
92         gkeyfilesettingsbackend.h       \
93         gkeyfilesettingsbackend.c       \
94         gmemorysettingsbackend.h        \
95         gmemorysettingsbackend.c        \
96         gnullsettingsbackend.h          \
97         gnullsettingsbackend.c          \
98         gsettingsbackendinternal.h      \
99         gsettingsbackend.c              \
100         gsettingsschema.h               \
101         gsettingsschema.c               \
102         gsettings-mapping.h             \
103         gsettings-mapping.c             \
104         gsettings.c
105
106 local_sources = \
107         glocaldirectorymonitor.c        \
108         glocaldirectorymonitor.h        \
109         glocalfile.c                    \
110         glocalfile.h                    \
111         glocalfileenumerator.c          \
112         glocalfileenumerator.h          \
113         glocalfileinfo.c                \
114         glocalfileinfo.h                \
115         glocalfileinputstream.c         \
116         glocalfileinputstream.h         \
117         glocalfilemonitor.c             \
118         glocalfilemonitor.h             \
119         glocalfileoutputstream.c        \
120         glocalfileoutputstream.h        \
121         glocalfileiostream.c            \
122         glocalfileiostream.h            \
123         glocalvfs.c                     \
124         glocalvfs.h                     \
125         $(NULL)
126
127 platform_libadd =
128 platform_deps =
129 appinfo_sources =
130
131 if HAVE_INOTIFY
132 SUBDIRS += inotify
133 platform_libadd += inotify/libinotify.la
134 platform_deps += inotify/libinotify.la
135 endif
136
137 if HAVE_FEN
138 AM_CPPFLAGS += -DHAVE_FEN
139 SUBDIRS += fen
140 platform_libadd += fen/libfen.la
141 platform_deps += fen/libfen.la
142 endif
143
144 if OS_WIN32
145 SUBDIRS += win32
146 platform_libadd += win32/libgiowin32.la
147 platform_deps += win32/libgiowin32.la
148 endif
149
150
151 SUBDIRS += .
152
153 if HAVE_FAM
154 SUBDIRS += fam
155 endif
156
157 if OS_UNIX
158 appinfo_sources += gdesktopappinfo.c gdesktopappinfo.h
159 platform_libadd += libasyncns/libasyncns.la xdgmime/libxdgmime.la
160 platform_deps += libasyncns/libasyncns.la xdgmime/libxdgmime.la
161 unix_sources = \
162         gunixconnection.c       \
163         gunixfdlist.c           \
164         gunixfdmessage.c        \
165         gunixmount.c            \
166         gunixmount.h            \
167         gunixmounts.c           \
168         gunixmounts.h           \
169         gunixresolver.c         \
170         gunixresolver.h         \
171         gunixsocketaddress.c    \
172         gunixvolume.c           \
173         gunixvolume.h           \
174         gunixvolumemonitor.c    \
175         gunixvolumemonitor.h    \
176         gunixinputstream.c      \
177         gunixoutputstream.c     \
178         $(NULL)
179
180
181 giounixincludedir=$(includedir)/gio-unix-2.0/gio
182 giounixinclude_HEADERS = \
183         gdesktopappinfo.h       \
184         gfiledescriptorbased.h  \
185         gunixconnection.h       \
186         gunixmounts.h           \
187         gunixfdlist.h           \
188         gunixfdmessage.h        \
189         gunixinputstream.h      \
190         gunixoutputstream.h     \
191         gunixsocketaddress.h    \
192         $(NULL)
193 endif
194
195 if OS_WIN32
196 appinfo_sources += gwin32appinfo.c gwin32appinfo.h
197 platform_libadd += -lshlwapi -lws2_32 -ldnsapi
198 win32_sources = \
199         gwin32mount.c \
200         gwin32mount.h \
201         gwin32resolver.c \
202         gwin32resolver.h \
203         gwin32volumemonitor.c \
204         gwin32volumemonitor.h \
205         gwin32inputstream.c \
206         gwin32outputstream.c \
207         gwin32outputstream.h \
208         $(NULL)
209
210 giowin32includedir=$(includedir)/gio-win32-2.0/gio
211 giowin32include_HEADERS = \
212         gwin32inputstream.h \
213         gwin32outputstream.h \
214         $(NULL)
215
216 endif
217
218 SUBDIRS += tests
219
220 libgio_2_0_la_SOURCES =         \
221         gappinfo.c              \
222         gasynchelper.c          \
223         gasynchelper.h          \
224         gasyncinitable.c        \
225         gasyncresult.c          \
226         gbufferedinputstream.c  \
227         gbufferedoutputstream.c \
228         gcancellable.c          \
229         gcontenttype.c          \
230         gcontenttypeprivate.h   \
231         gcharsetconverter.c     \
232         gconverter.c            \
233         gconverterinputstream.c \
234         gconverteroutputstream.c        \
235         gdatainputstream.c      \
236         gdataoutputstream.c     \
237         gdrive.c                \
238         gdummyfile.h            \
239         gdummyfile.c            \
240         gemblem.h               \
241         gemblem.c               \
242         gemblemedicon.h         \
243         gemblemedicon.c         \
244         gfile.c                 \
245         gfileattribute.c        \
246         gfileattribute-priv.h   \
247         gfiledescriptorbased.h  \
248         gfiledescriptorbased.c  \
249         gfileenumerator.c       \
250         gfileicon.c             \
251         gfileinfo.c             \
252         gfileinfo-priv.h        \
253         gfileinputstream.c      \
254         gfilemonitor.c          \
255         gfilenamecompleter.c    \
256         gfileoutputstream.c     \
257         gfileiostream.c         \
258         gfilterinputstream.c    \
259         gfilteroutputstream.c   \
260         gicon.c                 \
261         ginetaddress.c          \
262         ginetsocketaddress.c    \
263         ginitable.c             \
264         ginputstream.c          \
265         gioenums.h              \
266         gioerror.c              \
267         giomodule.c             \
268         giomodule-priv.h        \
269         gioscheduler.c          \
270         giostream.c             \
271         gloadableicon.c         \
272         gmount.c                \
273         gmemoryinputstream.c    \
274         gmemoryoutputstream.c   \
275         gmountoperation.c       \
276         gnativevolumemonitor.c  \
277         gnativevolumemonitor.h  \
278         gnetworkaddress.c       \
279         gnetworkingprivate.h    \
280         gnetworkservice.c       \
281         goutputstream.c         \
282         gpollfilemonitor.c      \
283         gpollfilemonitor.h      \
284         gresolver.c             \
285         gseekable.c             \
286         gsimpleasyncresult.c    \
287         gsocket.c               \
288         gsocketaddress.c        \
289         gsocketaddressenumerator.c \
290         gsocketclient.c         \
291         gsocketconnectable.c    \
292         gsocketconnection.c     \
293         gsocketcontrolmessage.c \
294         gsocketinputstream.c    \
295         gsocketinputstream.h    \
296         gsocketlistener.c       \
297         gsocketoutputstream.c   \
298         gsocketoutputstream.h   \
299         gsocketservice.c        \
300         gsrvtarget.c            \
301         gtcpconnection.c        \
302         gthreadedsocketservice.c\
303         gthemedicon.c           \
304         gthreadedresolver.c     \
305         gthreadedresolver.h     \
306         gunionvolumemonitor.c   \
307         gunionvolumemonitor.h   \
308         gvfs.c                  \
309         gvolume.c               \
310         gvolumemonitor.c        \
311         gzlibcompressor.c       \
312         gzlibdecompressor.c     \
313         gmountprivate.h         \
314         gioenumtypes.h          \
315         gioenumtypes.c          \
316         gioalias.h              \
317         gioaliasdef.c           \
318         $(appinfo_sources)      \
319         $(unix_sources)         \
320         $(win32_sources)        \
321         $(settings_sources)     \
322         $(local_sources)        \
323         $(marshal_sources)      \
324         $(NULL)
325
326 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
327
328 libgio_2_0_la_LIBADD = \
329         $(top_builddir)/glib/libglib-2.0.la             \
330         $(top_builddir)/gobject/libgobject-2.0.la       \
331         $(top_builddir)/gmodule/libgmodule-2.0.la       \
332         $(platform_libadd)                              \
333         $(ZLIB_LIBS)                                    \
334         $(SELINUX_LIBS)                                 \
335         $(GLIB_LIBS)                                    \
336         $(XATTR_LIBS)                                   \
337         $(NULL)
338
339 if PLATFORM_WIN32
340 no_undefined = -no-undefined
341 endif
342
343 if OS_WIN32_AND_DLL_COMPILATION
344 export_symbols = -export-symbols gio.def
345 gio_def = gio.def
346
347 gio_win32_res = gio-win32-res.o
348 gio_win32_res_ldflag = -Wl,$(gio_win32_res)
349
350 install-def-file:
351         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
352
353 uninstall-def-file:
354         -rm $(DESTDIR)$(libdir)/gio-2.0.def
355 else
356 install-def-file:
357 uninstall-def-file:
358
359 export_symbols = -export-symbols-regex '^g_.*'
360 endif
361
362 install-data-local: install-ms-lib install-def-file
363         $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
364
365 uninstall-local: uninstall-ms-lib uninstall-def-file
366
367 libgio_2_0_la_LDFLAGS = \
368         $(gio_win32_res_ldflag) \
369         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
370         -export-dynamic $(no_undefined) $(export_symbols)
371
372 libgio_2_0_la_DEPENDENCIES = $(gio_win32_res) $(gio_def) $(platform_deps)
373
374 gio-win32-res.o: gio.rc
375         $(WINDRES) gio.rc $@
376
377 gio_headers =                   \
378         gappinfo.h              \
379         gasyncinitable.h        \
380         gasyncresult.h          \
381         gbufferedinputstream.h  \
382         gbufferedoutputstream.h \
383         gcancellable.h          \
384         gcontenttype.h          \
385         gcharsetconverter.h     \
386         gconverter.h            \
387         gconverterinputstream.h \
388         gconverteroutputstream.h        \
389         gdatainputstream.h      \
390         gdataoutputstream.h     \
391         gdrive.h                \
392         gemblem.h               \
393         gemblemedicon.h         \
394         gfile.h                 \
395         gfileattribute.h        \
396         gfileenumerator.h       \
397         gfileicon.h             \
398         gfileinfo.h             \
399         gfileinputstream.h      \
400         gfilemonitor.h          \
401         gfilenamecompleter.h    \
402         gfileoutputstream.h     \
403         gfileiostream.h         \
404         gfilterinputstream.h    \
405         gfilteroutputstream.h   \
406         gicon.h                 \
407         ginetaddress.h          \
408         ginetsocketaddress.h    \
409         ginputstream.h          \
410         ginitable.h             \
411         gio.h                   \
412         giotypes.h              \
413         gioenums.h              \
414         gioerror.h              \
415         giomodule.h             \
416         gioscheduler.h          \
417         giostream.h             \
418         gloadableicon.h         \
419         gmount.h                \
420         gmemoryinputstream.h    \
421         gmemoryoutputstream.h   \
422         gmountoperation.h       \
423         gnativevolumemonitor.h  \
424         gnetworkaddress.h       \
425         gnetworkservice.h       \
426         goutputstream.h         \
427         gresolver.h             \
428         gseekable.h             \
429         gsimpleasyncresult.h    \
430         gsocket.h               \
431         gsocketaddress.h        \
432         gsocketaddressenumerator.h \
433         gsocketclient.h         \
434         gsocketconnectable.h    \
435         gsocketconnection.h     \
436         gsocketcontrolmessage.h \
437         gsocketlistener.h       \
438         gsocketservice.h        \
439         gsrvtarget.h            \
440         gtcpconnection.h        \
441         gthreadedsocketservice.h\
442         gthemedicon.h           \
443         gvfs.h                  \
444         gvolume.h               \
445         gvolumemonitor.h        \
446         gzlibcompressor.h       \
447         gzlibdecompressor.h     \
448         $(settings_headers)     \
449         $(NULL)
450
451 gioincludedir=$(includedir)/glib-2.0/gio/
452 gioinclude_HEADERS =            \
453         $(gio_headers)          \
454         gioenumtypes.h
455
456 # these sources (also mentioned above) are generated.
457 BUILT_SOURCES =                 \
458         gio-marshal.h           \
459         gio-marshal.c           \
460         gioalias.h              \
461         gioaliasdef.c           \
462         gioenumtypes.h          \
463         gioenumtypes.c          \
464         $(NULL)
465
466 EXTRA_DIST +=                   \
467         gio-marshal.list        \
468         gio.symbols             \
469         gioenumtypes.h.template \
470         gioenumtypes.c.template \
471         makefile.msc            \
472         makegioalias.pl         \
473         abicheck.sh             \
474         pltcheck.sh             \
475         gio.rc.in               \
476         gschema.dtd             \
477         $(NULL)
478
479 BUILT_EXTRA_DIST =              \
480         gio.rc
481
482 CLEANFILES =                    \
483         $(marshal_sources)      \
484         $(NULL)
485
486 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
487         ( top_builddir=`cd $(top_builddir) && pwd`; \
488           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
489             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
490
491 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
492         ( top_builddir=`cd $(top_builddir) && pwd`; \
493           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
494             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
495
496 gio-2.0.lib: libgio-2.0.la gio.def
497         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@
498
499 dist_bin_SCRIPTS = gsettings-schema-convert
500 bin_PROGRAMS = gio-querymodules gschema-compile
501
502 gio_querymodules_SOURCES = gio-querymodules.c
503 gio_querymodules_LDADD   = \
504         $(top_builddir)/glib/libglib-2.0.la             \
505         $(top_builddir)/gobject/libgobject-2.0.la       \
506         $(top_builddir)/gmodule/libgmodule-2.0.la       \
507         libgio-2.0.la                                   \
508         $(NULL)
509
510 gschema_compile_LDADD = $(top_builddir)/glib/libglib-2.0.la
511 gschema_compile_SOURCES = \
512         gvdb/gvdb-format.h              \
513         gvdb/gvdb-builder.h             \
514         gvdb/gvdb-builder.c             \
515         gschema-compile.c
516
517 schemadir = $(datadir)/glib-2.0/schemas
518 dist_schema_DATA = gschema.dtd
519
520 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gio.vcproj
521         files='$(BUILT_EXTRA_DIST)'; \
522         for f in $$files; do \
523           if test -f $$f; then d=.; else d=$(srcdir); fi; \
524           cp $$d/$$f $(distdir) || exit 1; done
525
526 ../build/win32/vs9/gio.vcproj: $(top_srcdir)/build/win32/vs9/gio.vcprojin
527         for F in $(libgio_2_0_la_SOURCES) $(win32_sources); do \
528                 case $$F in \
529                 *.c) echo '   <File RelativePath="..\..\..\gio\'$$F'" />' \
530                      ;; \
531                 esac; \
532         done >libgio.sourcefiles
533         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gio.vcprojin >$@
534
535 if HAVE_GLIB_RUNTIME_LIBDIR
536 install-data-hook:
537         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
538         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
539         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
540         rm -f $(DESTDIR)$(libdir)/libgio-2.0.so
541         ln -s $(GLIB_RUNTIME_LIBDIR)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgio-2.0.so
542 endif