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