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