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