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