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