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