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