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