Initial GDBus code-drop from GDBus-standalone repo
[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         (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gio.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g' | sort) > gio.def.tmp && \
28           mv gio.def.tmp gio.def
29
30 gioalias.h: gio.symbols
31         $(PERL) $(srcdir)/makegioalias.pl < $(srcdir)/gio.symbols > gioalias.h.tmp && \
32           mv gioalias.h.tmp gioalias.h
33
34 gioaliasdef.c: gio.symbols
35         $(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         $(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         (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         gunixcredentialsmessage.h       \
86         gdbusutils.h                    \
87         gdbuserror.h                    \
88         gdbusaddress.h                  \
89         gdbusconnection.h               \
90         gdbusmessage.h                  \
91         gdbusnameowning.h               \
92         gdbusnamewatching.h             \
93         gdbusproxywatching.h            \
94         gdbusproxy.h                    \
95         gdbusintrospection.h            \
96         gdbusmethodinvocation.h         \
97         gdbusserver.h                   \
98         $(NULL)
99
100 gdbus_sources =                                                         \
101         gdbusutils.h                    gdbusutils.c                    \
102         gcredentials.h                  gcredentials.c                  \
103         gunixcredentialsmessage.h       gunixcredentialsmessage.c       \
104         gdbusaddress.h                  gdbusaddress.c                  \
105         gdbusauthobserver.h             gdbusauthobserver.c             \
106         gdbusauth.h                     gdbusauth.c                     \
107         gdbusauthmechanism.h            gdbusauthmechanism.c            \
108         gdbusauthmechanismanon.h        gdbusauthmechanismanon.c        \
109         gdbusauthmechanismexternal.h    gdbusauthmechanismexternal.c    \
110         gdbusauthmechanismsha1.h        gdbusauthmechanismsha1.c        \
111         gdbuserror.h                    gdbuserror.c                    \
112         gdbusconnection.h               gdbusconnection.c               \
113         gdbusmessage.h                  gdbusmessage.c                  \
114         gdbusnameowning.h               gdbusnameowning.c               \
115         gdbusnamewatching.h             gdbusnamewatching.c             \
116         gdbusproxywatching.h            gdbusproxywatching.c            \
117         gdbusproxy.h                    gdbusproxy.c                    \
118         gdbusprivate.h                  gdbusprivate.c                  \
119         gdbusintrospection.h            gdbusintrospection.c            \
120         gdbusmethodinvocation.h         gdbusmethodinvocation.c         \
121         gdbusserver.h                   gdbusserver.c                   \
122         $(NULL)
123
124 settings_headers = \
125         gsettingsbackend.h              \
126         gsettings.h
127
128 settings_sources = \
129         gvdb/gvdb-format.h              \
130         gvdb/gvdb-reader.h              \
131         gvdb/gvdb-reader.c              \
132         gdelayedsettingsbackend.h       \
133         gdelayedsettingsbackend.c       \
134         gkeyfilesettingsbackend.h       \
135         gkeyfilesettingsbackend.c       \
136         gmemorysettingsbackend.h        \
137         gmemorysettingsbackend.c        \
138         gnullsettingsbackend.h          \
139         gnullsettingsbackend.c          \
140         gsettingsbackendinternal.h      \
141         gsettingsbackend.c              \
142         gsettingsschema.h               \
143         gsettingsschema.c               \
144         gsettings-mapping.h             \
145         gsettings-mapping.c             \
146         gsettings.c
147
148 local_sources = \
149         glocaldirectorymonitor.c        \
150         glocaldirectorymonitor.h        \
151         glocalfile.c                    \
152         glocalfile.h                    \
153         glocalfileenumerator.c          \
154         glocalfileenumerator.h          \
155         glocalfileinfo.c                \
156         glocalfileinfo.h                \
157         glocalfileinputstream.c         \
158         glocalfileinputstream.h         \
159         glocalfilemonitor.c             \
160         glocalfilemonitor.h             \
161         glocalfileoutputstream.c        \
162         glocalfileoutputstream.h        \
163         glocalfileiostream.c            \
164         glocalfileiostream.h            \
165         glocalvfs.c                     \
166         glocalvfs.h                     \
167         $(NULL)
168
169 platform_libadd =
170 platform_deps =
171 appinfo_sources =
172
173 if HAVE_INOTIFY
174 SUBDIRS += inotify
175 platform_libadd += inotify/libinotify.la
176 platform_deps += inotify/libinotify.la
177 endif
178
179 if HAVE_FEN
180 AM_CPPFLAGS += -DHAVE_FEN
181 SUBDIRS += fen
182 platform_libadd += fen/libfen.la
183 platform_deps += fen/libfen.la
184 endif
185
186 if OS_WIN32
187 SUBDIRS += win32
188 platform_libadd += win32/libgiowin32.la
189 platform_deps += win32/libgiowin32.la
190 endif
191
192
193 SUBDIRS += .
194
195 if HAVE_FAM
196 SUBDIRS += fam
197 endif
198
199 if OS_UNIX
200 appinfo_sources += gdesktopappinfo.c gdesktopappinfo.h
201 platform_libadd += libasyncns/libasyncns.la xdgmime/libxdgmime.la
202 platform_deps += libasyncns/libasyncns.la xdgmime/libxdgmime.la
203 unix_sources = \
204         gunixconnection.c       \
205         gunixfdlist.c           \
206         gunixfdmessage.c        \
207         gunixmount.c            \
208         gunixmount.h            \
209         gunixmounts.c           \
210         gunixmounts.h           \
211         gunixresolver.c         \
212         gunixresolver.h         \
213         gunixsocketaddress.c    \
214         gunixvolume.c           \
215         gunixvolume.h           \
216         gunixvolumemonitor.c    \
217         gunixvolumemonitor.h    \
218         gunixinputstream.c      \
219         gunixoutputstream.c     \
220         $(NULL)
221
222
223 giounixincludedir=$(includedir)/gio-unix-2.0/gio
224 giounixinclude_HEADERS = \
225         gdesktopappinfo.h       \
226         gfiledescriptorbased.h  \
227         gunixconnection.h       \
228         gunixmounts.h           \
229         gunixfdlist.h           \
230         gunixfdmessage.h        \
231         gunixinputstream.h      \
232         gunixoutputstream.h     \
233         gunixsocketaddress.h    \
234         $(NULL)
235 endif
236
237 if OS_WIN32
238 appinfo_sources += gwin32appinfo.c gwin32appinfo.h
239 platform_libadd += -lshlwapi -lws2_32 -ldnsapi
240 win32_sources = \
241         gwin32mount.c \
242         gwin32mount.h \
243         gwin32resolver.c \
244         gwin32resolver.h \
245         gwin32volumemonitor.c \
246         gwin32volumemonitor.h \
247         gwin32inputstream.c \
248         gwin32outputstream.c \
249         gwin32outputstream.h \
250         $(NULL)
251
252 win32_more_sources_for_vcproj = \
253         gwin32appinfo.c \
254         win32/gwin32directorymonitor.c \
255         win32/gwinhttpfile.c \
256         win32/gwinhttpfileinputstream.c \
257         win32/gwinhttpfileoutputstream.c \
258         win32/gwinhttpvfs.c
259
260 giowin32includedir=$(includedir)/gio-win32-2.0/gio
261 giowin32include_HEADERS = \
262         gwin32inputstream.h \
263         gwin32outputstream.h \
264         $(NULL)
265
266 endif
267
268 SUBDIRS += tests
269
270 libgio_2_0_la_SOURCES =         \
271         gappinfo.c              \
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         gdatainputstream.c      \
286         gdataoutputstream.c     \
287         gdrive.c                \
288         gdummyfile.h            \
289         gdummyfile.c            \
290         gemblem.h               \
291         gemblem.c               \
292         gemblemedicon.h         \
293         gemblemedicon.c         \
294         gfile.c                 \
295         gfileattribute.c        \
296         gfileattribute-priv.h   \
297         gfiledescriptorbased.h  \
298         gfiledescriptorbased.c  \
299         gfileenumerator.c       \
300         gfileicon.c             \
301         gfileinfo.c             \
302         gfileinfo-priv.h        \
303         gfileinputstream.c      \
304         gfilemonitor.c          \
305         gfilenamecompleter.c    \
306         gfileoutputstream.c     \
307         gfileiostream.c         \
308         gfilterinputstream.c    \
309         gfilteroutputstream.c   \
310         gicon.c                 \
311         ginetaddress.c          \
312         ginetsocketaddress.c    \
313         ginitable.c             \
314         ginputstream.c          \
315         gioenums.h              \
316         gioerror.c              \
317         giomodule.c             \
318         giomodule-priv.h        \
319         gioscheduler.c          \
320         giostream.c             \
321         gloadableicon.c         \
322         gmount.c                \
323         gmemoryinputstream.c    \
324         gmemoryoutputstream.c   \
325         gmountoperation.c       \
326         gnativevolumemonitor.c  \
327         gnativevolumemonitor.h  \
328         gnetworkaddress.c       \
329         gnetworkingprivate.h    \
330         gnetworkservice.c       \
331         goutputstream.c         \
332         gpollfilemonitor.c      \
333         gpollfilemonitor.h      \
334         gresolver.c             \
335         gseekable.c             \
336         gsimpleasyncresult.c    \
337         gsocket.c               \
338         gsocketaddress.c        \
339         gsocketaddressenumerator.c \
340         gsocketclient.c         \
341         gsocketconnectable.c    \
342         gsocketconnection.c     \
343         gsocketcontrolmessage.c \
344         gsocketinputstream.c    \
345         gsocketinputstream.h    \
346         gsocketlistener.c       \
347         gsocketoutputstream.c   \
348         gsocketoutputstream.h   \
349         gsocketservice.c        \
350         gsrvtarget.c            \
351         gtcpconnection.c        \
352         gthreadedsocketservice.c\
353         gthemedicon.c           \
354         gthreadedresolver.c     \
355         gthreadedresolver.h     \
356         gunionvolumemonitor.c   \
357         gunionvolumemonitor.h   \
358         gvfs.c                  \
359         gvolume.c               \
360         gvolumemonitor.c        \
361         gzlibcompressor.c       \
362         gzlibdecompressor.c     \
363         gmountprivate.h         \
364         gioenumtypes.h          \
365         gioenumtypes.c          \
366         gioalias.h              \
367         gioaliasdef.c           \
368         $(appinfo_sources)      \
369         $(unix_sources)         \
370         $(win32_sources)        \
371         $(settings_sources)     \
372         $(gdbus_sources)        \
373         $(local_sources)        \
374         $(marshal_sources)      \
375         $(NULL)
376
377 $(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 = \
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         gresolver.h             \
479         gseekable.h             \
480         gsimpleasyncresult.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         $(settings_headers)     \
500         $(gdbus_headers)        \
501         $(NULL)
502
503 gioincludedir=$(includedir)/glib-2.0/gio/
504 gioinclude_HEADERS =            \
505         $(gio_headers)          \
506         gioenumtypes.h
507
508 # these sources (also mentioned above) are generated.
509 BUILT_SOURCES =                 \
510         gio-marshal.h           \
511         gio-marshal.c           \
512         gioalias.h              \
513         gioaliasdef.c           \
514         gioenumtypes.h          \
515         gioenumtypes.c          \
516         $(NULL)
517
518 EXTRA_DIST +=                   \
519         gio-marshal.list        \
520         gio.symbols             \
521         gioenumtypes.h.template \
522         gioenumtypes.c.template \
523         makefile.msc            \
524         makegioalias.pl         \
525         abicheck.sh             \
526         pltcheck.sh             \
527         gio.rc.in               \
528         gschema.dtd             \
529         $(NULL)
530
531 BUILT_EXTRA_DIST =              \
532         gio.rc
533
534 CLEANFILES =                    \
535         $(marshal_sources)      \
536         $(NULL)
537
538 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
539         ( top_builddir=`cd $(top_builddir) && pwd`; \
540           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
541             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
542
543 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
544         ( top_builddir=`cd $(top_builddir) && pwd`; \
545           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
546             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
547
548 gio-2.0.lib: libgio-2.0.la gio.def
549         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@
550
551 dist_bin_SCRIPTS = gsettings-schema-convert
552 bin_PROGRAMS = gio-querymodules glib-compile-schemas gsettings
553
554 gio_querymodules_SOURCES = gio-querymodules.c
555 gio_querymodules_LDADD   = \
556         $(top_builddir)/glib/libglib-2.0.la             \
557         $(top_builddir)/gobject/libgobject-2.0.la       \
558         $(top_builddir)/gmodule/libgmodule-2.0.la       \
559         libgio-2.0.la                                   \
560         $(NULL)
561
562 glib_compile_schemas_LDADD = $(top_builddir)/glib/libglib-2.0.la
563 glib_compile_schemas_SOURCES = \
564         gvdb/gvdb-format.h              \
565         gvdb/gvdb-builder.h             \
566         gvdb/gvdb-builder.c             \
567         gschema-compile.c
568
569 gsettings_LDADD = \
570         $(top_builddir)/glib/libglib-2.0.la             \
571         libgio-2.0.la
572 gsettings_SOURCES = gsettings-tool.c
573
574 schemadir = $(datadir)/glib-2.0/schemas
575 dist_schema_DATA = gschema.dtd
576
577 # ------------------------------------------------------------------------
578 # gdbus(1) tool
579
580 bin_PROGRAMS += gdbus
581 gdbus_SOURCES = gdbus-tool.c
582 gdbus_LDADD = libgio-2.0.la
583
584 completiondir = $(sysconfdir)/bash_completion.d
585 completion_SCRIPTS = gdbus-bash-completion.sh
586 EXTRA_DIST += $(completion_SCRIPTS)
587
588 # ------------------------------------------------------------------------
589
590 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gio.vcproj
591         files='$(BUILT_EXTRA_DIST)'; \
592         for f in $$files; do \
593           if test -f $$f; then d=.; else d=$(srcdir); fi; \
594           cp $$d/$$f $(distdir) || exit 1; done
595
596 ../build/win32/vs9/gio.vcproj: $(top_srcdir)/build/win32/vs9/gio.vcprojin
597         for F in `echo $(libgio_2_0_la_SOURCES) $(win32_sources) $(win32_more_sources_for_vcproj) | tr '/' '\\'`; do \
598                 case $$F in \
599                 gunix*.c|gdesktopappinfo.c) ;; \
600                 *.c) echo '   <File RelativePath="..\..\..\gio\'$$F'" />' \
601                      ;; \
602                 esac; \
603         done | sort -u >libgio.sourcefiles
604         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gio.vcprojin >$@
605         rm libgio.sourcefiles
606
607 if HAVE_GLIB_RUNTIME_LIBDIR
608 install-data-hook:
609         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
610         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
611         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
612         rm -f $(DESTDIR)$(libdir)/libgio-2.0.so
613         ln -s $(GLIB_RUNTIME_LIBDIR)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgio-2.0.so
614 endif