Fix --runtime-libdir option
[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         gunixfdmessage.c        \
135         gunixmount.c            \
136         gunixmount.h            \
137         gunixmounts.c           \
138         gunixmounts.h           \
139         gunixresolver.c         \
140         gunixresolver.h         \
141         gunixsocketaddress.c    \
142         gunixvolume.c           \
143         gunixvolume.h           \
144         gunixvolumemonitor.c    \
145         gunixvolumemonitor.h    \
146         gunixinputstream.c      \
147         gunixoutputstream.c     \
148         $(NULL)
149
150
151 giounixincludedir=$(includedir)/gio-unix-2.0/gio
152 giounixinclude_HEADERS = \
153         gdesktopappinfo.h       \
154         gunixconnection.h       \
155         gunixmounts.h           \
156         gunixfdmessage.h        \
157         gunixinputstream.h      \
158         gunixoutputstream.h     \
159         gunixsocketaddress.h    \
160         $(NULL)
161 endif
162
163 if OS_WIN32
164 appinfo_sources += gwin32appinfo.c gwin32appinfo.h
165 platform_libadd += -lshlwapi -lws2_32 -ldnsapi
166 win32_sources = \
167         gwin32mount.c \
168         gwin32mount.h \
169         gwin32resolver.c \
170         gwin32resolver.h \
171         gwin32volumemonitor.c \
172         gwin32volumemonitor.h \
173         $(NULL)
174
175 endif
176
177 SUBDIRS += tests
178
179 libgio_2_0_la_SOURCES =         \
180         gappinfo.c              \
181         gasynchelper.c          \
182         gasynchelper.h          \
183         gasyncinitable.c        \
184         gasyncresult.c          \
185         gbufferedinputstream.c  \
186         gbufferedoutputstream.c \
187         gcancellable.c          \
188         gcontenttype.c          \
189         gcontenttypeprivate.h   \
190         gdatainputstream.c      \
191         gdataoutputstream.c     \
192         gdrive.c                \
193         gdummyfile.h            \
194         gdummyfile.c            \
195         gemblem.h               \
196         gemblem.c               \
197         gemblemedicon.h         \
198         gemblemedicon.c         \
199         gfile.c                 \
200         gfileattribute.c        \
201         gfileattribute-priv.h   \
202         gfileenumerator.c       \
203         gfileicon.c             \
204         gfileinfo.c             \
205         gfileinfo-priv.h        \
206         gfileinputstream.c      \
207         gfilemonitor.c          \
208         gfilenamecompleter.c    \
209         gfileoutputstream.c     \
210         gfileiostream.c         \
211         gfilterinputstream.c    \
212         gfilteroutputstream.c   \
213         gicon.c                 \
214         ginetaddress.c          \
215         ginetsocketaddress.c    \
216         ginitable.c             \
217         ginputstream.c          \
218         gioenums.h              \
219         gioerror.c              \
220         giomodule.c             \
221         giomodule-priv.h        \
222         gioscheduler.c          \
223         giostream.c             \
224         gloadableicon.c         \
225         gmount.c                \
226         gmemoryinputstream.c    \
227         gmemoryoutputstream.c   \
228         gmountoperation.c       \
229         gnativevolumemonitor.c  \
230         gnativevolumemonitor.h  \
231         gnetworkaddress.c       \
232         gnetworkingprivate.h    \
233         gnetworkservice.c       \
234         goutputstream.c         \
235         gpollfilemonitor.c      \
236         gpollfilemonitor.h      \
237         gresolver.c             \
238         gseekable.c             \
239         gsimpleasyncresult.c    \
240         gsocket.c               \
241         gsocketaddress.c        \
242         gsocketaddressenumerator.c \
243         gsocketclient.c         \
244         gsocketconnectable.c    \
245         gsocketconnection.c     \
246         gsocketcontrolmessage.c \
247         gsocketinputstream.c    \
248         gsocketinputstream.h    \
249         gsocketlistener.c       \
250         gsocketoutputstream.c   \
251         gsocketoutputstream.h   \
252         gsocketservice.c        \
253         gsrvtarget.c            \
254         gtcpconnection.c        \
255         gthreadedsocketservice.c\
256         gthemedicon.c           \
257         gthreadedresolver.c     \
258         gthreadedresolver.h     \
259         gunionvolumemonitor.c   \
260         gunionvolumemonitor.h   \
261         gvfs.c                  \
262         gvolume.c               \
263         gvolumemonitor.c        \
264         gmountprivate.h         \
265         gioenumtypes.h          \
266         gioenumtypes.c          \
267         gioalias.h              \
268         gioaliasdef.c           \
269         $(appinfo_sources)      \
270         $(unix_sources)         \
271         $(win32_sources)        \
272         $(local_sources)        \
273         $(marshal_sources)      \
274         $(NULL)
275
276 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
277
278 libgio_2_0_la_LIBADD = \
279         $(top_builddir)/glib/libglib-2.0.la             \
280         $(top_builddir)/gobject/libgobject-2.0.la       \
281         $(top_builddir)/gmodule/libgmodule-2.0.la       \
282         $(platform_libadd)                              \
283         $(SELINUX_LIBS)                                 \
284         $(GLIB_LIBS)                                    \
285         $(XATTR_LIBS)                                   \
286         $(NULL)
287
288 if PLATFORM_WIN32
289 no_undefined = -no-undefined
290 endif
291
292 if OS_WIN32_AND_DLL_COMPILATION
293 export_symbols = -export-symbols gio.def
294 gio_def = gio.def
295
296 install-def-file:
297         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
298
299 uninstall-def-file:
300         -rm $(DESTDIR)$(libdir)/gio-2.0.def
301 else
302 install-def-file:
303 uninstall-def-file:
304
305 export_symbols = -export-symbols-regex '^g_.*'
306 endif
307
308 install-data-local: install-ms-lib install-def-file
309         $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
310
311 uninstall-local: uninstall-ms-lib uninstall-def-file
312
313 libgio_2_0_la_LDFLAGS = \
314         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
315         -export-dynamic $(no_undefined) $(export_symbols)
316
317 libgio_2_0_la_DEPENDENCIES = $(gio_def) $(platform_deps)
318
319 gio_headers =                   \
320         gappinfo.h              \
321         gasyncinitable.h        \
322         gasyncresult.h          \
323         gbufferedinputstream.h  \
324         gbufferedoutputstream.h \
325         gcancellable.h          \
326         gcontenttype.h          \
327         gdatainputstream.h      \
328         gdataoutputstream.h     \
329         gdrive.h                \
330         gemblem.h               \
331         gemblemedicon.h         \
332         gfile.h                 \
333         gfileattribute.h        \
334         gfileenumerator.h       \
335         gfileicon.h             \
336         gfileinfo.h             \
337         gfileinputstream.h      \
338         gfilemonitor.h          \
339         gfilenamecompleter.h    \
340         gfileoutputstream.h     \
341         gfileiostream.h         \
342         gfilterinputstream.h    \
343         gfilteroutputstream.h   \
344         gicon.h                 \
345         ginetaddress.h          \
346         ginetsocketaddress.h    \
347         ginputstream.h          \
348         ginitable.h             \
349         gio.h                   \
350         giotypes.h              \
351         gioenums.h              \
352         gioerror.h              \
353         giomodule.h             \
354         gioscheduler.h          \
355         giostream.h             \
356         gloadableicon.h         \
357         gmount.h                \
358         gmemoryinputstream.h    \
359         gmemoryoutputstream.h   \
360         gmountoperation.h       \
361         gnativevolumemonitor.h  \
362         gnetworkaddress.h       \
363         gnetworkservice.h       \
364         goutputstream.h         \
365         gresolver.h             \
366         gseekable.h             \
367         gsimpleasyncresult.h    \
368         gsocket.h               \
369         gsocketaddress.h        \
370         gsocketaddressenumerator.h \
371         gsocketclient.h         \
372         gsocketconnectable.h    \
373         gsocketconnection.h     \
374         gsocketcontrolmessage.h \
375         gsocketlistener.h       \
376         gsocketservice.h        \
377         gsrvtarget.h            \
378         gtcpconnection.h        \
379         gthreadedsocketservice.h\
380         gthemedicon.h           \
381         gvfs.h                  \
382         gvolume.h               \
383         gvolumemonitor.h        \
384         $(NULL)
385
386 gioincludedir=$(includedir)/glib-2.0/gio/
387 gioinclude_HEADERS =            \
388         $(gio_headers)          \
389         gioenumtypes.h
390
391 # these sources (also mentioned above) are generated.
392 BUILT_SOURCES =                 \
393         gio-marshal.h           \
394         gio-marshal.c           \
395         gioalias.h              \
396         gioaliasdef.c           \
397         gioenumtypes.h          \
398         gioenumtypes.c          \
399         $(NULL)
400
401 EXTRA_DIST +=                   \
402         gio-marshal.list        \
403         gio.symbols             \
404         gioenumtypes.h.template \
405         gioenumtypes.c.template \
406         makefile.msc            \
407         makegioalias.pl         \
408         abicheck.sh             \
409         pltcheck.sh             \
410         $(NULL)
411
412 CLEANFILES =                    \
413         $(marshal_sources)      \
414         $(NULL)
415
416 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
417         ( top_builddir=`cd $(top_builddir) && pwd`; \
418           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
419             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
420
421 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
422         ( top_builddir=`cd $(top_builddir) && pwd`; \
423           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
424             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
425
426 gio-2.0.lib: libgio-2.0.la gio.def
427         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@
428
429 if HAVE_GLIB_RUNTIME_LIBDIR
430 install-data-hook:
431         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
432         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
433         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
434         rm -f $(DESTDIR)$(libdir)/libgio-2.0.so
435         ln -s $(GLIB_RUNTIME_LIBDIR)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgio-2.0.so
436 endif