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