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