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