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