Bug 555121 – Improved build-time handling of gio module-dir
[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 += 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         glocalvfs.c                     \
93         glocalvfs.h                     \
94         $(NULL)
95
96 platform_libadd =
97 platform_deps =
98 appinfo_sources =
99
100 if HAVE_INOTIFY
101 SUBDIRS += inotify
102 platform_libadd += inotify/libinotify.la
103 platform_deps += inotify/libinotify.la
104 endif
105
106 if HAVE_FEN
107 AM_CPPFLAGS += -DHAVE_FEN
108 SUBDIRS += fen
109 platform_libadd += fen/libfen.la
110 platform_deps += fen/libfen.la
111 endif
112
113 if OS_WIN32
114 SUBDIRS += win32
115 platform_libadd += win32/libgiowin32.la
116 platform_deps += win32/libgiowin32.la
117 endif
118
119
120 SUBDIRS += .
121
122 if HAVE_FAM
123 SUBDIRS += fam
124 endif
125
126 if OS_UNIX
127 appinfo_sources += gdesktopappinfo.c gdesktopappinfo.h
128 platform_libadd += xdgmime/libxdgmime.la
129 platform_deps += xdgmime/libxdgmime.la
130 unix_sources = \
131         gunixmount.c            \
132         gunixmount.h            \
133         gunixmounts.c           \
134         gunixmounts.h           \
135         gunixvolume.c           \
136         gunixvolume.h           \
137         gunixvolumemonitor.c    \
138         gunixvolumemonitor.h    \
139         gunixinputstream.c      \
140         gunixoutputstream.c     \
141         $(NULL)
142
143
144 giounixincludedir=$(includedir)/gio-unix-2.0/gio
145 giounixinclude_HEADERS = \
146         gdesktopappinfo.h       \
147         gunixmounts.h           \
148         gunixinputstream.h      \
149         gunixoutputstream.h     \
150         $(NULL)
151 endif
152
153 if OS_WIN32
154 appinfo_sources += gwin32appinfo.c gwin32appinfo.h
155 platform_libadd += -lshlwapi
156 win32_sources = \
157         gwin32mount.c \
158         gwin32mount.h \
159         gwin32volumemonitor.c \
160         gwin32volumemonitor.h \
161         $(NULL)
162
163 endif
164
165 SUBDIRS += tests
166
167 libgio_2_0_la_SOURCES =         \
168         gappinfo.c              \
169         gasynchelper.c          \
170         gasynchelper.h          \
171         gasyncresult.c          \
172         gbufferedinputstream.c  \
173         gbufferedoutputstream.c \
174         gcancellable.c          \
175         gcontenttype.c          \
176         gcontenttypeprivate.h   \
177         gdatainputstream.c      \
178         gdataoutputstream.c     \
179         gdrive.c                \
180         gdummyfile.h            \
181         gdummyfile.c            \
182         gemblem.h               \
183         gemblem.c               \
184         gemblemedicon.h         \
185         gemblemedicon.c         \
186         gfile.c                 \
187         gfileattribute.c        \
188         gfileattribute-priv.h   \
189         gfileenumerator.c       \
190         gfileicon.c             \
191         gfileinfo.c             \
192         gfileinputstream.c      \
193         gfilemonitor.c          \
194         gfilenamecompleter.c    \
195         gfileoutputstream.c     \
196         gfilterinputstream.c    \
197         gfilteroutputstream.c   \
198         gicon.c                 \
199         ginputstream.c          \
200         gioenums.h              \
201         gioerror.c              \
202         giomodule.c             \
203         giomodule-priv.h        \
204         gioscheduler.c          \
205         gloadableicon.c         \
206         gmount.c                \
207         gmemoryinputstream.c    \
208         gmemoryoutputstream.c   \
209         gmountoperation.c       \
210         gnativevolumemonitor.c  \
211         gnativevolumemonitor.h  \
212         goutputstream.c         \
213         gpollfilemonitor.c      \
214         gpollfilemonitor.h      \
215         gseekable.c             \
216         gsimpleasyncresult.c    \
217         gthemedicon.c           \
218         gunionvolumemonitor.c   \
219         gunionvolumemonitor.h   \
220         gvfs.c                  \
221         gvolume.c               \
222         gvolumemonitor.c        \
223         gmountprivate.h         \
224         gioenumtypes.h          \
225         gioenumtypes.c          \
226         gioalias.h              \
227         gioaliasdef.c           \
228         $(appinfo_sources)      \
229         $(unix_sources)         \
230         $(win32_sources)        \
231         $(local_sources)        \
232         $(marshal_sources)      \
233         $(NULL)
234
235 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
236
237 libgio_2_0_la_LIBADD = \
238         $(top_builddir)/glib/libglib-2.0.la             \
239         $(top_builddir)/gobject/libgobject-2.0.la       \
240         $(top_builddir)/gmodule/libgmodule-2.0.la       \
241         $(platform_libadd)                              \
242         $(SELINUX_LIBS)                                 \
243         $(GLIB_LIBS)                                    \
244         $(XATTR_LIBS)                                   \
245         $(NULL)
246
247 if PLATFORM_WIN32
248 no_undefined = -no-undefined
249 endif
250
251 if OS_WIN32_AND_DLL_COMPILATION
252 export_symbols = -export-symbols gio.def
253 gio_def = gio.def
254
255 install-def-file:
256         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
257
258 uninstall-def-file:
259         -rm $(DESTDIR)$(libdir)/gio-2.0.def
260 else
261 install-def-file:
262 uninstall-def-file:
263
264 export_symbols = -export-symbols-regex '^g_.*'
265 endif
266
267 install-data-local: install-ms-lib install-def-file
268         $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
269
270 uninstall-local: uninstall-ms-lib uninstall-def-file
271
272 libgio_2_0_la_LDFLAGS = \
273         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
274         -export-dynamic $(no_undefined) $(export_symbols)
275
276 libgio_2_0_la_DEPENDENCIES = $(gio_def) $(platform_deps)
277
278 gio_headers =                   \
279         gappinfo.h              \
280         gasyncresult.h          \
281         gbufferedinputstream.h  \
282         gbufferedoutputstream.h \
283         gcancellable.h          \
284         gcontenttype.h          \
285         gdatainputstream.h      \
286         gdataoutputstream.h     \
287         gdrive.h                \
288         gemblem.h               \
289         gemblemedicon.h         \
290         gfile.h                 \
291         gfileattribute.h        \
292         gfileenumerator.h       \
293         gfileicon.h             \
294         gfileinfo.h             \
295         gfileinputstream.h      \
296         gfilemonitor.h          \
297         gfilenamecompleter.h    \
298         gfileoutputstream.h     \
299         gfilterinputstream.h    \
300         gfilteroutputstream.h   \
301         gicon.h                 \
302         ginputstream.h          \
303         gio.h                   \
304         giotypes.h              \
305         gioenums.h              \
306         gioerror.h              \
307         giomodule.h             \
308         gioscheduler.h          \
309         gloadableicon.h         \
310         gmount.h                \
311         gmemoryinputstream.h    \
312         gmemoryoutputstream.h   \
313         gmountoperation.h       \
314         gnativevolumemonitor.h  \
315         goutputstream.h         \
316         gseekable.h             \
317         gsimpleasyncresult.h    \
318         gthemedicon.h           \
319         gvfs.h                  \
320         gvolume.h               \
321         gvolumemonitor.h        \
322         $(NULL)
323
324 gioincludedir=$(includedir)/glib-2.0/gio/
325 gioinclude_HEADERS =            \
326         $(gio_headers)          \
327         gioenumtypes.h
328
329 # these sources (also mentioned above) are generated.
330 BUILT_SOURCES =                 \
331         gio-marshal.h           \
332         gio-marshal.c           \
333         gioalias.h              \
334         gioaliasdef.c           \
335         gioenumtypes.h          \
336         gioenumtypes.c          \
337         $(NULL)
338
339 EXTRA_DIST +=                   \
340         gio-marshal.list        \
341         gio.symbols             \
342         gioenumtypes.h.template \
343         gioenumtypes.c.template \
344         makefile.msc            \
345         makegioalias.pl         \
346         abicheck.sh             \
347         pltcheck.sh             \
348         $(NULL)
349
350 CLEANFILES =                    \
351         $(marshal_sources)      \
352         $(NULL)
353
354 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
355         ( top_builddir=`cd $(top_builddir) && pwd`; \
356           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
357             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
358
359 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
360         ( top_builddir=`cd $(top_builddir) && pwd`; \
361           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
362             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
363
364 gio-2.0.lib: libgio-2.0.la gio.def
365         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@