merge GSettingsBackend
[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 settings_sources = \
83         gsettingsbackendinternal.h      \
84         gsettingsbackend.c
85
86 settings_headers = \
87         gsettingsbackend.h
88
89 local_sources = \
90         glocaldirectorymonitor.c        \
91         glocaldirectorymonitor.h        \
92         glocalfile.c                    \
93         glocalfile.h                    \
94         glocalfileenumerator.c          \
95         glocalfileenumerator.h          \
96         glocalfileinfo.c                \
97         glocalfileinfo.h                \
98         glocalfileinputstream.c         \
99         glocalfileinputstream.h         \
100         glocalfilemonitor.c             \
101         glocalfilemonitor.h             \
102         glocalfileoutputstream.c        \
103         glocalfileoutputstream.h        \
104         glocalfileiostream.c            \
105         glocalfileiostream.h            \
106         glocalvfs.c                     \
107         glocalvfs.h                     \
108         $(NULL)
109
110 platform_libadd =
111 platform_deps =
112 appinfo_sources =
113
114 if HAVE_INOTIFY
115 SUBDIRS += inotify
116 platform_libadd += inotify/libinotify.la
117 platform_deps += inotify/libinotify.la
118 endif
119
120 if HAVE_FEN
121 AM_CPPFLAGS += -DHAVE_FEN
122 SUBDIRS += fen
123 platform_libadd += fen/libfen.la
124 platform_deps += fen/libfen.la
125 endif
126
127 if OS_WIN32
128 SUBDIRS += win32
129 platform_libadd += win32/libgiowin32.la
130 platform_deps += win32/libgiowin32.la
131 endif
132
133
134 SUBDIRS += .
135
136 if HAVE_FAM
137 SUBDIRS += fam
138 endif
139
140 if OS_UNIX
141 appinfo_sources += gdesktopappinfo.c gdesktopappinfo.h
142 platform_libadd += libasyncns/libasyncns.la xdgmime/libxdgmime.la
143 platform_deps += libasyncns/libasyncns.la xdgmime/libxdgmime.la
144 unix_sources = \
145         gunixconnection.c       \
146         gunixfdlist.c           \
147         gunixfdmessage.c        \
148         gunixmount.c            \
149         gunixmount.h            \
150         gunixmounts.c           \
151         gunixmounts.h           \
152         gunixresolver.c         \
153         gunixresolver.h         \
154         gunixsocketaddress.c    \
155         gunixvolume.c           \
156         gunixvolume.h           \
157         gunixvolumemonitor.c    \
158         gunixvolumemonitor.h    \
159         gunixinputstream.c      \
160         gunixoutputstream.c     \
161         $(NULL)
162
163
164 giounixincludedir=$(includedir)/gio-unix-2.0/gio
165 giounixinclude_HEADERS = \
166         gdesktopappinfo.h       \
167         gfiledescriptorbased.h  \
168         gunixconnection.h       \
169         gunixmounts.h           \
170         gunixfdlist.h           \
171         gunixfdmessage.h        \
172         gunixinputstream.h      \
173         gunixoutputstream.h     \
174         gunixsocketaddress.h    \
175         $(NULL)
176 endif
177
178 if OS_WIN32
179 appinfo_sources += gwin32appinfo.c gwin32appinfo.h
180 platform_libadd += -lshlwapi -lws2_32 -ldnsapi
181 win32_sources = \
182         gwin32mount.c \
183         gwin32mount.h \
184         gwin32resolver.c \
185         gwin32resolver.h \
186         gwin32volumemonitor.c \
187         gwin32volumemonitor.h \
188         $(NULL)
189
190 endif
191
192 SUBDIRS += tests
193
194 libgio_2_0_la_SOURCES =         \
195         gappinfo.c              \
196         gasynchelper.c          \
197         gasynchelper.h          \
198         gasyncinitable.c        \
199         gasyncresult.c          \
200         gbufferedinputstream.c  \
201         gbufferedoutputstream.c \
202         gcancellable.c          \
203         gcontenttype.c          \
204         gcontenttypeprivate.h   \
205         gcharsetconverter.c     \
206         gconverter.c            \
207         gconverterinputstream.c \
208         gconverteroutputstream.c        \
209         gdatainputstream.c      \
210         gdataoutputstream.c     \
211         gdrive.c                \
212         gdummyfile.h            \
213         gdummyfile.c            \
214         gemblem.h               \
215         gemblem.c               \
216         gemblemedicon.h         \
217         gemblemedicon.c         \
218         gfile.c                 \
219         gfileattribute.c        \
220         gfileattribute-priv.h   \
221         gfiledescriptorbased.h  \
222         gfiledescriptorbased.c  \
223         gfileenumerator.c       \
224         gfileicon.c             \
225         gfileinfo.c             \
226         gfileinfo-priv.h        \
227         gfileinputstream.c      \
228         gfilemonitor.c          \
229         gfilenamecompleter.c    \
230         gfileoutputstream.c     \
231         gfileiostream.c         \
232         gfilterinputstream.c    \
233         gfilteroutputstream.c   \
234         gicon.c                 \
235         ginetaddress.c          \
236         ginetsocketaddress.c    \
237         ginitable.c             \
238         ginputstream.c          \
239         gioenums.h              \
240         gioerror.c              \
241         giomodule.c             \
242         giomodule-priv.h        \
243         gioscheduler.c          \
244         giostream.c             \
245         gloadableicon.c         \
246         gmount.c                \
247         gmemoryinputstream.c    \
248         gmemoryoutputstream.c   \
249         gmountoperation.c       \
250         gnativevolumemonitor.c  \
251         gnativevolumemonitor.h  \
252         gnetworkaddress.c       \
253         gnetworkingprivate.h    \
254         gnetworkservice.c       \
255         goutputstream.c         \
256         gpollfilemonitor.c      \
257         gpollfilemonitor.h      \
258         gresolver.c             \
259         gseekable.c             \
260         gsimpleasyncresult.c    \
261         gsocket.c               \
262         gsocketaddress.c        \
263         gsocketaddressenumerator.c \
264         gsocketclient.c         \
265         gsocketconnectable.c    \
266         gsocketconnection.c     \
267         gsocketcontrolmessage.c \
268         gsocketinputstream.c    \
269         gsocketinputstream.h    \
270         gsocketlistener.c       \
271         gsocketoutputstream.c   \
272         gsocketoutputstream.h   \
273         gsocketservice.c        \
274         gsrvtarget.c            \
275         gtcpconnection.c        \
276         gthreadedsocketservice.c\
277         gthemedicon.c           \
278         gthreadedresolver.c     \
279         gthreadedresolver.h     \
280         gunionvolumemonitor.c   \
281         gunionvolumemonitor.h   \
282         gvfs.c                  \
283         gvolume.c               \
284         gvolumemonitor.c        \
285         gzlibcompressor.c       \
286         gzlibdecompressor.c     \
287         gmountprivate.h         \
288         gioenumtypes.h          \
289         gioenumtypes.c          \
290         gioalias.h              \
291         gioaliasdef.c           \
292         $(appinfo_sources)      \
293         $(unix_sources)         \
294         $(win32_sources)        \
295         $(settings_sources)     \
296         $(local_sources)        \
297         $(marshal_sources)      \
298         $(NULL)
299
300 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
301
302 libgio_2_0_la_LIBADD = \
303         $(top_builddir)/glib/libglib-2.0.la             \
304         $(top_builddir)/gobject/libgobject-2.0.la       \
305         $(top_builddir)/gmodule/libgmodule-2.0.la       \
306         $(platform_libadd)                              \
307         $(ZLIB_LIBS)                                    \
308         $(SELINUX_LIBS)                                 \
309         $(GLIB_LIBS)                                    \
310         $(XATTR_LIBS)                                   \
311         $(NULL)
312
313 if PLATFORM_WIN32
314 no_undefined = -no-undefined
315 endif
316
317 if OS_WIN32_AND_DLL_COMPILATION
318 export_symbols = -export-symbols gio.def
319 gio_def = gio.def
320
321 gio_win32_res = gio-win32-res.o
322 gio_win32_res_ldflag = -Wl,$(gio_win32_res)
323
324 install-def-file:
325         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
326
327 uninstall-def-file:
328         -rm $(DESTDIR)$(libdir)/gio-2.0.def
329 else
330 install-def-file:
331 uninstall-def-file:
332
333 export_symbols = -export-symbols-regex '^g_.*'
334 endif
335
336 install-data-local: install-ms-lib install-def-file
337         $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
338
339 uninstall-local: uninstall-ms-lib uninstall-def-file
340
341 libgio_2_0_la_LDFLAGS = \
342         $(gio_win32_res_ldflag) \
343         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
344         -export-dynamic $(no_undefined) $(export_symbols)
345
346 libgio_2_0_la_DEPENDENCIES = $(gio_win32_res) $(gio_def) $(platform_deps)
347
348 gio-win32-res.o: gio.rc
349         $(WINDRES) gio.rc $@
350
351 gio_headers =                   \
352         gappinfo.h              \
353         gasyncinitable.h        \
354         gasyncresult.h          \
355         gbufferedinputstream.h  \
356         gbufferedoutputstream.h \
357         gcancellable.h          \
358         gcontenttype.h          \
359         gcharsetconverter.h     \
360         gconverter.h            \
361         gconverterinputstream.h \
362         gconverteroutputstream.h        \
363         gdatainputstream.h      \
364         gdataoutputstream.h     \
365         gdrive.h                \
366         gemblem.h               \
367         gemblemedicon.h         \
368         gfile.h                 \
369         gfileattribute.h        \
370         gfileenumerator.h       \
371         gfileicon.h             \
372         gfileinfo.h             \
373         gfileinputstream.h      \
374         gfilemonitor.h          \
375         gfilenamecompleter.h    \
376         gfileoutputstream.h     \
377         gfileiostream.h         \
378         gfilterinputstream.h    \
379         gfilteroutputstream.h   \
380         gicon.h                 \
381         ginetaddress.h          \
382         ginetsocketaddress.h    \
383         ginputstream.h          \
384         ginitable.h             \
385         gio.h                   \
386         giotypes.h              \
387         gioenums.h              \
388         gioerror.h              \
389         giomodule.h             \
390         gioscheduler.h          \
391         giostream.h             \
392         gloadableicon.h         \
393         gmount.h                \
394         gmemoryinputstream.h    \
395         gmemoryoutputstream.h   \
396         gmountoperation.h       \
397         gnativevolumemonitor.h  \
398         gnetworkaddress.h       \
399         gnetworkservice.h       \
400         goutputstream.h         \
401         gresolver.h             \
402         gseekable.h             \
403         gsimpleasyncresult.h    \
404         gsocket.h               \
405         gsocketaddress.h        \
406         gsocketaddressenumerator.h \
407         gsocketclient.h         \
408         gsocketconnectable.h    \
409         gsocketconnection.h     \
410         gsocketcontrolmessage.h \
411         gsocketlistener.h       \
412         gsocketservice.h        \
413         gsrvtarget.h            \
414         gtcpconnection.h        \
415         gthreadedsocketservice.h\
416         gthemedicon.h           \
417         gvfs.h                  \
418         gvolume.h               \
419         gvolumemonitor.h        \
420         gzlibcompressor.h       \
421         gzlibdecompressor.h     \
422         $(settings_headers)     \
423         $(NULL)
424
425 gioincludedir=$(includedir)/glib-2.0/gio/
426 gioinclude_HEADERS =            \
427         $(gio_headers)          \
428         gioenumtypes.h
429
430 # these sources (also mentioned above) are generated.
431 BUILT_SOURCES =                 \
432         gio-marshal.h           \
433         gio-marshal.c           \
434         gioalias.h              \
435         gioaliasdef.c           \
436         gioenumtypes.h          \
437         gioenumtypes.c          \
438         $(NULL)
439
440 EXTRA_DIST +=                   \
441         gio-marshal.list        \
442         gio.symbols             \
443         gioenumtypes.h.template \
444         gioenumtypes.c.template \
445         makefile.msc            \
446         makegioalias.pl         \
447         abicheck.sh             \
448         pltcheck.sh             \
449         gio.rc.in               \
450         $(NULL)
451
452 BUILT_EXTRA_DIST =              \
453         gio.rc
454
455 CLEANFILES =                    \
456         $(marshal_sources)      \
457         $(NULL)
458
459 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
460         ( top_builddir=`cd $(top_builddir) && pwd`; \
461           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
462             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
463
464 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
465         ( top_builddir=`cd $(top_builddir) && pwd`; \
466           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
467             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
468
469 gio-2.0.lib: libgio-2.0.la gio.def
470         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@
471
472 bin_PROGRAMS = gio-querymodules
473 gio_querymodules_SOURCES = gio-querymodules.c
474 gio_querymodules_LDADD   = \
475         $(top_builddir)/glib/libglib-2.0.la             \
476         $(top_builddir)/gobject/libgobject-2.0.la       \
477         $(top_builddir)/gmodule/libgmodule-2.0.la       \
478         libgio-2.0.la                                   \
479         $(NULL)
480
481 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gio.vcproj
482         files='$(BUILT_EXTRA_DIST)'; \
483         for f in $$files; do \
484           if test -f $$f; then d=.; else d=$(srcdir); fi; \
485           cp $$d/$$f $(distdir) || exit 1; done
486
487 ../build/win32/vs9/gio.vcproj: $(top_srcdir)/build/win32/vs9/gio.vcprojin
488         for F in $(libgio_2_0_la_SOURCES); do \
489                 case $$F in \
490                 *.c) echo '   <File RelativePath="..\..\..\gio\'$$F'" />' \
491                      ;; \
492                 esac; \
493         done >libgio.sourcefiles
494         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gio.vcprojin >$@
495
496 if HAVE_GLIB_RUNTIME_LIBDIR
497 install-data-hook:
498         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
499         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
500         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
501         rm -f $(DESTDIR)$(libdir)/libgio-2.0.so
502         ln -s $(GLIB_RUNTIME_LIBDIR)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgio-2.0.so
503 endif