add GAction 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         gaction.h                       \
134         gapplication.h
135
136 application_sources = \
137         gactiongroup.c                  \
138         gaction.c                       \
139         gapplication.c
140
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         gasynchelper.c          \
271         gasynchelper.h          \
272         gasyncinitable.c        \
273         gasyncresult.c          \
274         gbufferedinputstream.c  \
275         gbufferedoutputstream.c \
276         gcancellable.c          \
277         gcontenttype.c          \
278         gcontenttypeprivate.h   \
279         gcharsetconverter.c     \
280         gconverter.c            \
281         gconverterinputstream.c \
282         gconverteroutputstream.c        \
283         gcredentials.c          \
284         gdatainputstream.c      \
285         gdataoutputstream.c     \
286         gdrive.c                \
287         gdummyfile.h            \
288         gdummyfile.c            \
289         gemblem.h               \
290         gemblem.c               \
291         gemblemedicon.h         \
292         gemblemedicon.c         \
293         gfile.c                 \
294         gfileattribute.c        \
295         gfileattribute-priv.h   \
296         gfileenumerator.c       \
297         gfileicon.c             \
298         gfileinfo.c             \
299         gfileinfo-priv.h        \
300         gfileinputstream.c      \
301         gfilemonitor.c          \
302         gfilenamecompleter.c    \
303         gfileoutputstream.c     \
304         gfileiostream.c         \
305         gfilterinputstream.c    \
306         gfilteroutputstream.c   \
307         gicon.c                 \
308         ginetaddress.c          \
309         ginetsocketaddress.c    \
310         ginitable.c             \
311         ginputstream.c          \
312         gioenums.h              \
313         gioerror.c              \
314         giomodule.c             \
315         giomodule-priv.h        \
316         gioscheduler.c          \
317         giostream.c             \
318         gloadableicon.c         \
319         gmount.c                \
320         gmemoryinputstream.c    \
321         gmemoryoutputstream.c   \
322         gmountoperation.c       \
323         gnativevolumemonitor.c  \
324         gnativevolumemonitor.h  \
325         gnetworkaddress.c       \
326         gnetworkingprivate.h    \
327         gnetworkservice.c       \
328         goutputstream.c         \
329         gpermission.c           \
330         gpollfilemonitor.c      \
331         gpollfilemonitor.h      \
332         gresolver.c             \
333         gseekable.c             \
334         gsimpleasyncresult.c    \
335         gsimplepermission.c     \
336         gsocket.c               \
337         gsocketaddress.c        \
338         gsocketaddressenumerator.c \
339         gsocketclient.c         \
340         gsocketconnectable.c    \
341         gsocketconnection.c     \
342         gsocketcontrolmessage.c \
343         gsocketinputstream.c    \
344         gsocketinputstream.h    \
345         gsocketlistener.c       \
346         gsocketoutputstream.c   \
347         gsocketoutputstream.h   \
348         gsocketservice.c        \
349         gsrvtarget.c            \
350         gtcpconnection.c        \
351         gthreadedsocketservice.c\
352         gthemedicon.c           \
353         gthreadedresolver.c     \
354         gthreadedresolver.h     \
355         gunionvolumemonitor.c   \
356         gunionvolumemonitor.h   \
357         gvfs.c                  \
358         gvolume.c               \
359         gvolumemonitor.c        \
360         gzlibcompressor.c       \
361         gzlibdecompressor.c     \
362         gmountprivate.h         \
363         gioenumtypes.h          \
364         gioenumtypes.c          \
365         $(appinfo_sources)      \
366         $(unix_sources)         \
367         $(win32_sources)        \
368         $(application_sources)  \
369         $(settings_sources)     \
370         $(gdbus_sources)        \
371         $(local_sources)        \
372         $(marshal_sources)      \
373         $(NULL)
374
375 EXTRA_DIST += gnullapplication.c gdbusapplication.c strinfo.c
376
377 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
378
379 libgio_2_0_la_LIBADD = \
380         $(top_builddir)/glib/libglib-2.0.la             \
381         $(top_builddir)/gobject/libgobject-2.0.la       \
382         $(top_builddir)/gmodule/libgmodule-2.0.la       \
383         $(platform_libadd)                              \
384         $(ZLIB_LIBS)                                    \
385         $(SELINUX_LIBS)                                 \
386         $(GLIB_LIBS)                                    \
387         $(XATTR_LIBS)                                   \
388         $(NULL)
389
390 if PLATFORM_WIN32
391 no_undefined = -no-undefined
392 endif
393
394 if OS_WIN32_AND_DLL_COMPILATION
395 export_symbols = -export-symbols gio.def
396 gio_def = gio.def
397
398 gio_win32_res = gio-win32-res.o
399 gio_win32_res_ldflag = -Wl,$(gio_win32_res)
400
401 install-def-file:
402         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
403
404 uninstall-def-file:
405         -rm $(DESTDIR)$(libdir)/gio-2.0.def
406 else
407 install-def-file:
408 uninstall-def-file:
409
410 export_symbols = -export-symbols-regex '^g_.*'
411 endif
412
413 install-data-local: install-ms-lib install-def-file
414         $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
415
416 uninstall-local: uninstall-ms-lib uninstall-def-file
417
418 libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
419         $(gio_win32_res_ldflag) \
420         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
421         -export-dynamic $(no_undefined) $(export_symbols)
422
423 libgio_2_0_la_DEPENDENCIES = $(gio_win32_res) $(gio_def) $(platform_deps)
424
425 gio-win32-res.o: gio.rc
426         $(WINDRES) gio.rc $@
427
428 gio_headers =                   \
429         gappinfo.h              \
430         gasyncinitable.h        \
431         gasyncresult.h          \
432         gbufferedinputstream.h  \
433         gbufferedoutputstream.h \
434         gcancellable.h          \
435         gcontenttype.h          \
436         gcharsetconverter.h     \
437         gconverter.h            \
438         gconverterinputstream.h \
439         gconverteroutputstream.h        \
440         gdatainputstream.h      \
441         gdataoutputstream.h     \
442         gdrive.h                \
443         gemblem.h               \
444         gemblemedicon.h         \
445         gfile.h                 \
446         gfileattribute.h        \
447         gfileenumerator.h       \
448         gfileicon.h             \
449         gfileinfo.h             \
450         gfileinputstream.h      \
451         gfilemonitor.h          \
452         gfilenamecompleter.h    \
453         gfileoutputstream.h     \
454         gfileiostream.h         \
455         gfilterinputstream.h    \
456         gfilteroutputstream.h   \
457         gicon.h                 \
458         ginetaddress.h          \
459         ginetsocketaddress.h    \
460         ginputstream.h          \
461         ginitable.h             \
462         gio.h                   \
463         giotypes.h              \
464         gioenums.h              \
465         gioerror.h              \
466         giomodule.h             \
467         gioscheduler.h          \
468         giostream.h             \
469         gloadableicon.h         \
470         gmount.h                \
471         gmemoryinputstream.h    \
472         gmemoryoutputstream.h   \
473         gmountoperation.h       \
474         gnativevolumemonitor.h  \
475         gnetworkaddress.h       \
476         gnetworkservice.h       \
477         goutputstream.h         \
478         gpermission.h           \
479         gresolver.h             \
480         gseekable.h             \
481         gsimpleasyncresult.h    \
482         gsimplepermission.h     \
483         gsocket.h               \
484         gsocketaddress.h        \
485         gsocketaddressenumerator.h \
486         gsocketclient.h         \
487         gsocketconnectable.h    \
488         gsocketconnection.h     \
489         gsocketcontrolmessage.h \
490         gsocketlistener.h       \
491         gsocketservice.h        \
492         gsrvtarget.h            \
493         gtcpconnection.h        \
494         gthreadedsocketservice.h\
495         gthemedicon.h           \
496         gvfs.h                  \
497         gvolume.h               \
498         gvolumemonitor.h        \
499         gzlibcompressor.h       \
500         gzlibdecompressor.h     \
501         $(application_headers)  \
502         $(settings_headers)     \
503         $(gdbus_headers)        \
504         $(NULL)
505
506 gioincludedir=$(includedir)/glib-2.0/gio/
507 gioinclude_HEADERS =            \
508         $(gio_headers)          \
509         gioenumtypes.h
510
511 # these sources (also mentioned above) are generated.
512 BUILT_SOURCES =                 \
513         gio-marshal.h           \
514         gio-marshal.c           \
515         gioenumtypes.h          \
516         gioenumtypes.c          \
517         $(NULL)
518
519 EXTRA_DIST +=                   \
520         gio-marshal.list        \
521         gio.symbols             \
522         gioenumtypes.h.template \
523         gioenumtypes.c.template \
524         makefile.msc            \
525         abicheck.sh             \
526         gio.rc.in               \
527         gschema.dtd             \
528         $(NULL)
529
530 BUILT_EXTRA_DIST =              \
531         gio.rc
532
533 CLEANFILES =                    \
534         $(marshal_sources)      \
535         $(NULL)
536
537 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
538         $(AM_V_GEN) ( top_builddir=`cd $(top_builddir) && pwd`; \
539           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
540             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
541
542 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
543         $(AM_V_GEN) ( top_builddir=`cd $(top_builddir) && pwd`; \
544           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
545             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
546
547 gio-2.0.lib: libgio-2.0.la gio.def
548         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@
549
550 bin_PROGRAMS = gio-querymodules glib-compile-schemas gsettings
551
552 gio_querymodules_SOURCES = gio-querymodules.c
553 gio_querymodules_LDADD   = \
554         $(top_builddir)/glib/libglib-2.0.la             \
555         $(top_builddir)/gobject/libgobject-2.0.la       \
556         $(top_builddir)/gmodule/libgmodule-2.0.la       \
557         libgio-2.0.la                                   \
558         $(NULL)
559
560 glib_compile_schemas_LDADD = $(top_builddir)/glib/libglib-2.0.la
561 glib_compile_schemas_SOURCES = \
562         gvdb/gvdb-format.h              \
563         gvdb/gvdb-builder.h             \
564         gvdb/gvdb-builder.c             \
565         gschema-compile.c
566
567 gsettings_LDADD = \
568         $(top_builddir)/glib/libglib-2.0.la             \
569         $(top_builddir)/gobject/libgobject-2.0.la       \
570         libgio-2.0.la
571 gsettings_SOURCES = gsettings-tool.c
572
573 schemadir = $(datadir)/glib-2.0/schemas
574 dist_schema_DATA = gschema.dtd
575
576 # ------------------------------------------------------------------------
577 # gdbus(1) tool
578
579 bin_PROGRAMS += gdbus
580 gdbus_SOURCES = gdbus-tool.c
581 gdbus_LDADD = libgio-2.0.la \
582         $(top_builddir)/glib/libglib-2.0.la             \
583         $(top_builddir)/gobject/libgobject-2.0.la
584
585 completiondir = $(sysconfdir)/bash_completion.d
586 completion_SCRIPTS = \
587         gdbus-bash-completion.sh                \
588         gsettings-bash-completion.sh
589 EXTRA_DIST += $(completion_SCRIPTS)
590
591 # ------------------------------------------------------------------------
592
593 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gio.vcproj
594         files='$(BUILT_EXTRA_DIST)'; \
595         for f in $$files; do \
596           if test -f $$f; then d=.; else d=$(srcdir); fi; \
597           cp $$d/$$f $(distdir) || exit 1; done
598
599 ../build/win32/vs9/gio.vcproj: $(top_srcdir)/build/win32/vs9/gio.vcprojin
600         for F in `echo $(libgio_2_0_la_SOURCES) $(win32_actual_sources) $(win32_actual_more_sources_for_vcproj) | tr '/' '\\'`; do \
601                 case $$F in \
602                 gunix*.c|gdesktopappinfo.c) ;; \
603                 *.c) echo '   <File RelativePath="..\..\..\gio\'$$F'" />' \
604                      ;; \
605                 esac; \
606         done | sort -u >libgio.sourcefiles
607         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gio.vcprojin >$@
608         rm libgio.sourcefiles
609
610 if HAVE_GLIB_RUNTIME_LIBDIR
611 install-data-hook:
612         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
613         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
614         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
615         rm -f $(DESTDIR)$(libdir)/libgio-2.0.so
616         ln -s $(GLIB_RUNTIME_LIBDIR)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgio-2.0.so
617 endif