add GMemorySettingsBackend
[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         $(NULL)
206
207 endif
208
209 SUBDIRS += tests
210
211 libgio_2_0_la_SOURCES =         \
212         gappinfo.c              \
213         gasynchelper.c          \
214         gasynchelper.h          \
215         gasyncinitable.c        \
216         gasyncresult.c          \
217         gbufferedinputstream.c  \
218         gbufferedoutputstream.c \
219         gcancellable.c          \
220         gcontenttype.c          \
221         gcontenttypeprivate.h   \
222         gcharsetconverter.c     \
223         gconverter.c            \
224         gconverterinputstream.c \
225         gconverteroutputstream.c        \
226         gdatainputstream.c      \
227         gdataoutputstream.c     \
228         gdrive.c                \
229         gdummyfile.h            \
230         gdummyfile.c            \
231         gemblem.h               \
232         gemblem.c               \
233         gemblemedicon.h         \
234         gemblemedicon.c         \
235         gfile.c                 \
236         gfileattribute.c        \
237         gfileattribute-priv.h   \
238         gfiledescriptorbased.h  \
239         gfiledescriptorbased.c  \
240         gfileenumerator.c       \
241         gfileicon.c             \
242         gfileinfo.c             \
243         gfileinfo-priv.h        \
244         gfileinputstream.c      \
245         gfilemonitor.c          \
246         gfilenamecompleter.c    \
247         gfileoutputstream.c     \
248         gfileiostream.c         \
249         gfilterinputstream.c    \
250         gfilteroutputstream.c   \
251         gicon.c                 \
252         ginetaddress.c          \
253         ginetsocketaddress.c    \
254         ginitable.c             \
255         ginputstream.c          \
256         gioenums.h              \
257         gioerror.c              \
258         giomodule.c             \
259         giomodule-priv.h        \
260         gioscheduler.c          \
261         giostream.c             \
262         gloadableicon.c         \
263         gmount.c                \
264         gmemoryinputstream.c    \
265         gmemoryoutputstream.c   \
266         gmountoperation.c       \
267         gnativevolumemonitor.c  \
268         gnativevolumemonitor.h  \
269         gnetworkaddress.c       \
270         gnetworkingprivate.h    \
271         gnetworkservice.c       \
272         goutputstream.c         \
273         gpollfilemonitor.c      \
274         gpollfilemonitor.h      \
275         gresolver.c             \
276         gseekable.c             \
277         gsimpleasyncresult.c    \
278         gsocket.c               \
279         gsocketaddress.c        \
280         gsocketaddressenumerator.c \
281         gsocketclient.c         \
282         gsocketconnectable.c    \
283         gsocketconnection.c     \
284         gsocketcontrolmessage.c \
285         gsocketinputstream.c    \
286         gsocketinputstream.h    \
287         gsocketlistener.c       \
288         gsocketoutputstream.c   \
289         gsocketoutputstream.h   \
290         gsocketservice.c        \
291         gsrvtarget.c            \
292         gtcpconnection.c        \
293         gthreadedsocketservice.c\
294         gthemedicon.c           \
295         gthreadedresolver.c     \
296         gthreadedresolver.h     \
297         gunionvolumemonitor.c   \
298         gunionvolumemonitor.h   \
299         gvfs.c                  \
300         gvolume.c               \
301         gvolumemonitor.c        \
302         gzlibcompressor.c       \
303         gzlibdecompressor.c     \
304         gmountprivate.h         \
305         gioenumtypes.h          \
306         gioenumtypes.c          \
307         gioalias.h              \
308         gioaliasdef.c           \
309         $(appinfo_sources)      \
310         $(unix_sources)         \
311         $(win32_sources)        \
312         $(settings_sources)     \
313         $(local_sources)        \
314         $(marshal_sources)      \
315         $(NULL)
316
317 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
318
319 libgio_2_0_la_LIBADD = \
320         $(top_builddir)/glib/libglib-2.0.la             \
321         $(top_builddir)/gobject/libgobject-2.0.la       \
322         $(top_builddir)/gmodule/libgmodule-2.0.la       \
323         $(platform_libadd)                              \
324         $(ZLIB_LIBS)                                    \
325         $(SELINUX_LIBS)                                 \
326         $(GLIB_LIBS)                                    \
327         $(XATTR_LIBS)                                   \
328         $(NULL)
329
330 if PLATFORM_WIN32
331 no_undefined = -no-undefined
332 endif
333
334 if OS_WIN32_AND_DLL_COMPILATION
335 export_symbols = -export-symbols gio.def
336 gio_def = gio.def
337
338 gio_win32_res = gio-win32-res.o
339 gio_win32_res_ldflag = -Wl,$(gio_win32_res)
340
341 install-def-file:
342         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
343
344 uninstall-def-file:
345         -rm $(DESTDIR)$(libdir)/gio-2.0.def
346 else
347 install-def-file:
348 uninstall-def-file:
349
350 export_symbols = -export-symbols-regex '^g_.*'
351 endif
352
353 install-data-local: install-ms-lib install-def-file
354         $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
355
356 uninstall-local: uninstall-ms-lib uninstall-def-file
357
358 libgio_2_0_la_LDFLAGS = \
359         $(gio_win32_res_ldflag) \
360         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
361         -export-dynamic $(no_undefined) $(export_symbols)
362
363 libgio_2_0_la_DEPENDENCIES = $(gio_win32_res) $(gio_def) $(platform_deps)
364
365 gio-win32-res.o: gio.rc
366         $(WINDRES) gio.rc $@
367
368 gio_headers =                   \
369         gappinfo.h              \
370         gasyncinitable.h        \
371         gasyncresult.h          \
372         gbufferedinputstream.h  \
373         gbufferedoutputstream.h \
374         gcancellable.h          \
375         gcontenttype.h          \
376         gcharsetconverter.h     \
377         gconverter.h            \
378         gconverterinputstream.h \
379         gconverteroutputstream.h        \
380         gdatainputstream.h      \
381         gdataoutputstream.h     \
382         gdrive.h                \
383         gemblem.h               \
384         gemblemedicon.h         \
385         gfile.h                 \
386         gfileattribute.h        \
387         gfileenumerator.h       \
388         gfileicon.h             \
389         gfileinfo.h             \
390         gfileinputstream.h      \
391         gfilemonitor.h          \
392         gfilenamecompleter.h    \
393         gfileoutputstream.h     \
394         gfileiostream.h         \
395         gfilterinputstream.h    \
396         gfilteroutputstream.h   \
397         gicon.h                 \
398         ginetaddress.h          \
399         ginetsocketaddress.h    \
400         ginputstream.h          \
401         ginitable.h             \
402         gio.h                   \
403         giotypes.h              \
404         gioenums.h              \
405         gioerror.h              \
406         giomodule.h             \
407         gioscheduler.h          \
408         giostream.h             \
409         gloadableicon.h         \
410         gmount.h                \
411         gmemoryinputstream.h    \
412         gmemoryoutputstream.h   \
413         gmountoperation.h       \
414         gnativevolumemonitor.h  \
415         gnetworkaddress.h       \
416         gnetworkservice.h       \
417         goutputstream.h         \
418         gresolver.h             \
419         gseekable.h             \
420         gsimpleasyncresult.h    \
421         gsocket.h               \
422         gsocketaddress.h        \
423         gsocketaddressenumerator.h \
424         gsocketclient.h         \
425         gsocketconnectable.h    \
426         gsocketconnection.h     \
427         gsocketcontrolmessage.h \
428         gsocketlistener.h       \
429         gsocketservice.h        \
430         gsrvtarget.h            \
431         gtcpconnection.h        \
432         gthreadedsocketservice.h\
433         gthemedicon.h           \
434         gvfs.h                  \
435         gvolume.h               \
436         gvolumemonitor.h        \
437         gzlibcompressor.h       \
438         gzlibdecompressor.h     \
439         $(settings_headers)     \
440         $(NULL)
441
442 gioincludedir=$(includedir)/glib-2.0/gio/
443 gioinclude_HEADERS =            \
444         $(gio_headers)          \
445         gioenumtypes.h
446
447 # these sources (also mentioned above) are generated.
448 BUILT_SOURCES =                 \
449         gio-marshal.h           \
450         gio-marshal.c           \
451         gioalias.h              \
452         gioaliasdef.c           \
453         gioenumtypes.h          \
454         gioenumtypes.c          \
455         $(NULL)
456
457 EXTRA_DIST +=                   \
458         gio-marshal.list        \
459         gio.symbols             \
460         gioenumtypes.h.template \
461         gioenumtypes.c.template \
462         makefile.msc            \
463         makegioalias.pl         \
464         abicheck.sh             \
465         pltcheck.sh             \
466         gio.rc.in               \
467         $(NULL)
468
469 BUILT_EXTRA_DIST =              \
470         gio.rc
471
472 CLEANFILES =                    \
473         $(marshal_sources)      \
474         $(NULL)
475
476 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
477         ( top_builddir=`cd $(top_builddir) && pwd`; \
478           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
479             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
480
481 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
482         ( top_builddir=`cd $(top_builddir) && pwd`; \
483           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
484             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
485
486 gio-2.0.lib: libgio-2.0.la gio.def
487         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@
488
489 bin_PROGRAMS = gio-querymodules gschema-compile
490 gio_querymodules_SOURCES = gio-querymodules.c
491 gio_querymodules_LDADD   = \
492         $(top_builddir)/glib/libglib-2.0.la             \
493         $(top_builddir)/gobject/libgobject-2.0.la       \
494         $(top_builddir)/gmodule/libgmodule-2.0.la       \
495         libgio-2.0.la                                   \
496         $(NULL)
497
498 gschema_compile_LDADD = $(top_builddir)/glib/libglib-2.0.la
499 gschema_compile_SOURCES = \
500         gvdb/gvdb-format.h              \
501         gvdb/gvdb-builder.h             \
502         gvdb/gvdb-builder.c             \
503         gschema-compile.c
504
505 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gio.vcproj
506         files='$(BUILT_EXTRA_DIST)'; \
507         for f in $$files; do \
508           if test -f $$f; then d=.; else d=$(srcdir); fi; \
509           cp $$d/$$f $(distdir) || exit 1; done
510
511 ../build/win32/vs9/gio.vcproj: $(top_srcdir)/build/win32/vs9/gio.vcprojin
512         for F in $(libgio_2_0_la_SOURCES); do \
513                 case $$F in \
514                 *.c) echo '   <File RelativePath="..\..\..\gio\'$$F'" />' \
515                      ;; \
516                 esac; \
517         done >libgio.sourcefiles
518         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gio.vcprojin >$@
519
520 if HAVE_GLIB_RUNTIME_LIBDIR
521 install-data-hook:
522         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
523         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
524         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
525         rm -f $(DESTDIR)$(libdir)/libgio-2.0.so
526         ln -s $(GLIB_RUNTIME_LIBDIR)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgio-2.0.so
527 endif