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