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