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