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