Actually use the gio.def file when linking the library on Windows. Produce
[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 MS_LIB_AVAILABLE
12 noinst_DATA = gio-2.0.lib
13
14 install-ms-lib:
15         $(INSTALL) gio-2.0.lib $(DESTDIR)$(libdir)
16
17 uninstall-ms-lib:
18         -rm $(DESTDIR)$(libdir)/gio-2.0.lib
19 else
20 install-ms-lib:
21 uninstall-ms-lib:
22 endif
23
24 gio.def: gio.symbols
25         (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 && \
26           mv gio.def.tmp gio.def
27
28 gioalias.h: gio.symbols
29         $(PERL) $(srcdir)/makegioalias.pl < $(srcdir)/gio.symbols > gioalias.h.tmp && \
30           mv gioalias.h.tmp gioalias.h
31
32 gioaliasdef.c: gio.symbols
33         $(PERL) $(srcdir)/makegioalias.pl -def < $(srcdir)/gio.symbols > gioaliasdef.c.tmp && \
34           mv gioaliasdef.c.tmp gioaliasdef.c
35
36 if OS_LINUX
37 if HAVE_GNUC_VISIBILITY
38 TESTS = abicheck.sh pltcheck.sh
39 endif
40 endif
41
42 AM_CPPFLAGS = \
43         -DG_LOG_DOMAIN=\"GLib-GIO\"                     \
44         -I$(top_builddir)                               \
45         -I$(top_srcdir)                                 \
46         -I$(top_srcdir)/glib                            \
47         -I$(top_srcdir)/gmodule                         \
48         $(GLIB_DEBUG_FLAGS)                             \
49         -DG_DISABLE_DEPRECATED                          \
50         -DGIO_COMPILATION                               \
51         -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\"  
52
53 lib_LTLIBRARIES = libgio-2.0.la
54
55 marshal_sources = \
56         gio-marshal.h   \
57         gio-marshal.c   \
58         $(NULL)
59
60 if CROSS_COMPILING
61   glib_genmarshal=$(GLIB_GENMARSHAL)
62 else
63   glib_genmarshal=../gobject/glib-genmarshal
64 endif
65
66 gio-marshal.h: gio-marshal.list
67         $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --header --internal > $@.tmp && \
68           mv $@.tmp $@
69
70 gio-marshal.c: gio-marshal.h gio-marshal.list
71         (echo "#include \"gio-marshal.h\""; \
72         $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --body --internal) > $@.tmp && \
73           mv $@.tmp $@
74
75 local_sources = \
76         glocaldirectorymonitor.c        \
77         glocaldirectorymonitor.h        \
78         glocalfile.c                    \
79         glocalfile.h                    \
80         glocalfileenumerator.c          \
81         glocalfileenumerator.h          \
82         glocalfileinfo.c                \
83         glocalfileinfo.h                \
84         glocalfileinputstream.c         \
85         glocalfileinputstream.h         \
86         glocalfilemonitor.c             \
87         glocalfilemonitor.h             \
88         glocalfileoutputstream.c        \
89         glocalfileoutputstream.h        \
90         glocalvfs.c                     \
91         glocalvfs.h                     \
92         $(NULL)
93
94 platform_libadd =
95 appinfo_sources =
96
97 if HAVE_INOTIFY
98 SUBDIRS += inotify
99 platform_libadd += inotify/libinotify.la
100 endif
101
102 if OS_WIN32
103 SUBDIRS += win32
104 platform_libadd += win32/libgiowin32.la
105 endif
106
107
108 SUBDIRS += .
109
110 if HAVE_FAM
111 SUBDIRS += fam
112 endif
113
114 if OS_UNIX
115 appinfo_sources += gdesktopappinfo.c gdesktopappinfo.h
116 platform_libadd += xdgmime/libxdgmime.la
117 unix_sources = \
118         gunixmount.c            \
119         gunixmount.h            \
120         gunixmounts.c           \
121         gunixmounts.h           \
122         gunixvolume.c           \
123         gunixvolume.h           \
124         gunixvolumemonitor.c    \
125         gunixvolumemonitor.h    \
126         gunixinputstream.c      \
127         gunixoutputstream.c     \
128         $(NULL)
129
130
131 giounixincludedir=$(includedir)/gio-unix-2.0/gio
132 giounixinclude_HEADERS = \
133         gdesktopappinfo.h       \
134         gunixmounts.h           \
135         gunixinputstream.h      \
136         gunixoutputstream.h     \
137         $(NULL)
138 endif
139
140 if OS_WIN32
141 appinfo_sources += gwin32appinfo.c gwin32appinfo.h
142 platform_libadd += -lshlwapi
143 endif
144
145 SUBDIRS += tests
146
147 libgio_2_0_la_SOURCES =         \
148         gappinfo.c              \
149         gasynchelper.c          \
150         gasynchelper.h          \
151         gasyncresult.c          \
152         gbufferedinputstream.c  \
153         gbufferedoutputstream.c \
154         gcancellable.c          \
155         gcontenttype.c          \
156         gcontenttypeprivate.h   \
157         gdatainputstream.c      \
158         gdataoutputstream.c     \
159         gdrive.c                \
160         gdummyfile.h            \
161         gdummyfile.c            \
162         gfile.c                 \
163         gfileattribute.c        \
164         gfileattribute-priv.h   \
165         gfileenumerator.c       \
166         gfileicon.c             \
167         gfileinfo.c             \
168         gfileinputstream.c      \
169         gfilemonitor.c          \
170         gfilenamecompleter.c    \
171         gfileoutputstream.c     \
172         gfilterinputstream.c    \
173         gfilteroutputstream.c   \
174         gicon.c                 \
175         ginputstream.c          \
176         gioerror.c              \
177         giomodule.c             \
178         giomodule-priv.h        \
179         gioscheduler.c          \
180         gloadableicon.c         \
181         gmount.c                \
182         gmemoryinputstream.c    \
183         gmemoryoutputstream.c   \
184         gmountoperation.c       \
185         gnativevolumemonitor.c  \
186         gnativevolumemonitor.h  \
187         goutputstream.c         \
188         gpollfilemonitor.c      \
189         gpollfilemonitor.h      \
190         gseekable.c             \
191         gsimpleasyncresult.c    \
192         gthemedicon.c           \
193         gunionvolumemonitor.c   \
194         gunionvolumemonitor.h   \
195         gvfs.c                  \
196         gvolume.c               \
197         gvolumemonitor.c        \
198         gmountprivate.h         \
199         gioenumtypes.h          \
200         gioenumtypes.c          \
201         gioalias.h              \
202         gioaliasdef.c           \
203         $(appinfo_sources)      \
204         $(unix_sources)         \
205         $(local_sources)        \
206         $(marshal_sources)      \
207         $(NULL)
208
209 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
210
211 libgio_2_0_la_LIBADD = \
212         $(top_builddir)/glib/libglib-2.0.la             \
213         $(top_builddir)/gobject/libgobject-2.0.la       \
214         $(top_builddir)/gmodule/libgmodule-2.0.la       \
215         $(platform_libadd)                              \
216         $(SELINUX_LIBS)                                 \
217         $(GLIB_LIBS)                                    \
218         $(XATTR_LIBS)                                   \
219         $(NULL)
220
221 if PLATFORM_WIN32
222 no_undefined = -no-undefined
223 endif
224
225 if OS_WIN32
226 export_symbols = -export-symbols gio.def
227
228 install-def-file:
229         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
230
231 uninstall-def-file:
232         -rm $(DESTDIR)$(libdir)/gio-2.0.def
233 else
234 install-def-file:
235 uninstall-def-file:
236
237 export_symbols = -export-symbols-regex '^g_.*'
238 endif
239
240 install-data-local: install-ms-lib install-def-file
241
242 uninstall-local: uninstall-ms-lib uninstall-def-file
243
244 libgio_2_0_la_LDFLAGS= -export-dynamic $(no_undefined) $(export_symbols)
245
246 gio_headers =                   \
247         gappinfo.h              \
248         gasyncresult.h          \
249         gbufferedinputstream.h  \
250         gbufferedoutputstream.h \
251         gcancellable.h          \
252         gcontenttype.h          \
253         gdatainputstream.h      \
254         gdataoutputstream.h     \
255         gdrive.h                \
256         gfile.h                 \
257         gfileattribute.h        \
258         gfileenumerator.h       \
259         gfileicon.h             \
260         gfileinfo.h             \
261         gfileinputstream.h      \
262         gfilemonitor.h          \
263         gfilenamecompleter.h    \
264         gfileoutputstream.h     \
265         gfilterinputstream.h    \
266         gfilteroutputstream.h   \
267         gicon.h                 \
268         ginputstream.h          \
269         gio.h                   \
270         gioenumtypes.h          \
271         gioerror.h              \
272         giomodule.h             \
273         gioscheduler.h          \
274         gloadableicon.h         \
275         gmount.h                \
276         gmemoryinputstream.h    \
277         gmemoryoutputstream.h   \
278         gmountoperation.h       \
279         gnativevolumemonitor.h  \
280         goutputstream.h         \
281         gseekable.h             \
282         gsimpleasyncresult.h    \
283         gthemedicon.h           \
284         gvfs.h                  \
285         gvolume.h               \
286         gvolumemonitor.h        \
287         $(NULL)
288
289 gioincludedir=$(includedir)/glib-2.0/gio/
290 gioinclude_HEADERS =            \
291         $(gio_headers)          \
292         gioenumtypes.h
293
294 # these sources (also mentioned above) are generated.
295 BUILT_SOURCES =                 \
296         gio-marshal.h           \
297         gio-marshal.c           \
298         gioalias.h              \
299         gioaliasdef.c           \
300         gioenumtypes.h          \
301         gioenumtypes.c          \
302         $(NULL)
303
304 EXTRA_DIST +=                   \
305         gio-marshal.list        \
306         gio.symbols             \
307         gioenumtypes.h.template \
308         gioenumtypes.c.template \
309         makegioalias.pl         \
310         abicheck.sh             \
311         pltcheck.sh             \
312         $(NULL)
313
314 CLEANFILES =                    \
315         $(marshal_sources)      \
316         $(NULL)
317
318 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
319         ( top_builddir=`cd $(top_builddir) && pwd`; \
320           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
321             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
322
323 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
324         ( top_builddir=`cd $(top_builddir) && pwd`; \
325           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
326             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
327
328 gio-2.0.lib: libgio-2.0.la gio.def
329         lib -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@