Replace -I with $(glib_INCLUDES) and friends
[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         $(AM_V_GEN) (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 if OS_LINUX
31 if HAVE_GNUC_VISIBILITY
32 TESTS = abicheck.sh
33 endif
34 endif
35
36 if HAVE_THREADS
37 THREAD_FLAGS=-DG_THREADS_MANDATORY
38 endif
39
40 AM_CPPFLAGS = \
41         -DG_LOG_DOMAIN=\"GLib-GIO\"                     \
42         $(gmodule_INCLUDES)                             \
43         $(GLIB_DEBUG_FLAGS)                             \
44         $(THREAD_FLAGS)                                 \
45         -DG_DISABLE_DEPRECATED                          \
46         -DGIO_COMPILATION                               \
47         -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\"  
48
49 lib_LTLIBRARIES = libgio-2.0.la
50
51 marshal_sources = \
52         gio-marshal.h   \
53         gio-marshal.c   \
54         $(NULL)
55
56 if CROSS_COMPILING
57   glib_genmarshal=$(GLIB_GENMARSHAL)
58 else
59   glib_genmarshal=../gobject/glib-genmarshal
60 endif
61
62 gio-marshal.h: gio-marshal.list
63         $(AM_V_GEN) $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --header --internal > $@.tmp && \
64           mv $@.tmp $@
65
66 gio-marshal.c: gio-marshal.h gio-marshal.list
67         $(AM_V_GEN) (echo "#include \"gio-marshal.h\""; \
68         $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --body --internal) > $@.tmp && \
69           mv $@.tmp $@
70
71 gdbus_headers =                         \
72         gdbusauthobserver.h             \
73         gcredentials.h                  \
74         gdbusutils.h                    \
75         gdbuserror.h                    \
76         gdbusaddress.h                  \
77         gdbusconnection.h               \
78         gdbusmessage.h                  \
79         gdbusnameowning.h               \
80         gdbusnamewatching.h             \
81         gdbusproxy.h                    \
82         gdbusintrospection.h            \
83         gdbusmethodinvocation.h         \
84         gdbusserver.h                   \
85         $(NULL)
86
87 gdbus_sources =                                                         \
88         gdbusutils.h                    gdbusutils.c                    \
89         gdbusaddress.h                  gdbusaddress.c                  \
90         gdbusauthobserver.h             gdbusauthobserver.c             \
91         gdbusauth.h                     gdbusauth.c                     \
92         gdbusauthmechanism.h            gdbusauthmechanism.c            \
93         gdbusauthmechanismanon.h        gdbusauthmechanismanon.c        \
94         gdbusauthmechanismexternal.h    gdbusauthmechanismexternal.c    \
95         gdbusauthmechanismsha1.h        gdbusauthmechanismsha1.c        \
96         gdbuserror.h                    gdbuserror.c                    \
97         gdbusconnection.h               gdbusconnection.c               \
98         gdbusmessage.h                  gdbusmessage.c                  \
99         gdbusnameowning.h               gdbusnameowning.c               \
100         gdbusnamewatching.h             gdbusnamewatching.c             \
101         gdbusproxy.h                    gdbusproxy.c                    \
102         gdbusprivate.h                  gdbusprivate.c                  \
103         gdbusintrospection.h            gdbusintrospection.c            \
104         gdbusmethodinvocation.h         gdbusmethodinvocation.c         \
105         gdbusserver.h                   gdbusserver.c                   \
106         $(NULL)
107
108 settings_headers = \
109         gsettingsbackend.h              \
110         gsettings.h
111
112 settings_sources = \
113         gvdb/gvdb-format.h              \
114         gvdb/gvdb-reader.h              \
115         gvdb/gvdb-reader.c              \
116         gdelayedsettingsbackend.h       \
117         gdelayedsettingsbackend.c       \
118         gkeyfilesettingsbackend.c       \
119         gmemorysettingsbackend.h        \
120         gmemorysettingsbackend.c        \
121         gnullsettingsbackend.h          \
122         gnullsettingsbackend.c          \
123         gsettingsbackendinternal.h      \
124         gsettingsbackend.c              \
125         gsettingsschema.h               \
126         gsettingsschema.c               \
127         gsettings-mapping.h             \
128         gsettings-mapping.c             \
129         gsettings.c
130
131 local_sources = \
132         glocaldirectorymonitor.c        \
133         glocaldirectorymonitor.h        \
134         glocalfile.c                    \
135         glocalfile.h                    \
136         glocalfileenumerator.c          \
137         glocalfileenumerator.h          \
138         glocalfileinfo.c                \
139         glocalfileinfo.h                \
140         glocalfileinputstream.c         \
141         glocalfileinputstream.h         \
142         glocalfilemonitor.c             \
143         glocalfilemonitor.h             \
144         glocalfileoutputstream.c        \
145         glocalfileoutputstream.h        \
146         glocalfileiostream.c            \
147         glocalfileiostream.h            \
148         glocalvfs.c                     \
149         glocalvfs.h                     \
150         $(NULL)
151
152 platform_libadd =
153 platform_deps =
154 appinfo_sources =
155
156 if HAVE_INOTIFY
157 SUBDIRS += inotify
158 platform_libadd += inotify/libinotify.la
159 platform_deps += inotify/libinotify.la
160 endif
161
162 if HAVE_FEN
163 AM_CPPFLAGS += -DHAVE_FEN
164 SUBDIRS += fen
165 platform_libadd += fen/libfen.la
166 platform_deps += fen/libfen.la
167 endif
168
169 if OS_WIN32
170 SUBDIRS += win32
171 platform_libadd += win32/libgiowin32.la
172 platform_deps += win32/libgiowin32.la
173 endif
174
175
176 SUBDIRS += .
177
178 if HAVE_FAM
179 SUBDIRS += fam
180 endif
181
182 if OS_UNIX
183 appinfo_sources += gdesktopappinfo.c
184 platform_libadd += libasyncns/libasyncns.la xdgmime/libxdgmime.la
185 platform_deps += libasyncns/libasyncns.la xdgmime/libxdgmime.la
186 unix_sources = \
187         gfiledescriptorbased.c  \
188         gunixconnection.c       \
189         gunixcredentialsmessage.c       \
190         gunixfdlist.c           \
191         gunixfdmessage.c        \
192         gunixmount.c            \
193         gunixmount.h            \
194         gunixmounts.c           \
195         gunixresolver.c         \
196         gunixresolver.h         \
197         gunixsocketaddress.c    \
198         gunixvolume.c           \
199         gunixvolume.h           \
200         gunixvolumemonitor.c    \
201         gunixvolumemonitor.h    \
202         gunixinputstream.c      \
203         gunixoutputstream.c     \
204         $(NULL)
205
206
207 giounixincludedir=$(includedir)/gio-unix-2.0/gio
208 giounixinclude_HEADERS = \
209         gdesktopappinfo.h       \
210         gfiledescriptorbased.h  \
211         gunixconnection.h       \
212         gunixcredentialsmessage.h       \
213         gunixmounts.h           \
214         gunixfdlist.h           \
215         gunixfdmessage.h        \
216         gunixinputstream.h      \
217         gunixoutputstream.h     \
218         gunixsocketaddress.h    \
219         $(NULL)
220 endif
221
222 win32_actual_sources = \
223         gwin32mount.c \
224         gwin32mount.h \
225         gwin32resolver.c \
226         gwin32resolver.h \
227         gwin32volumemonitor.c \
228         gwin32volumemonitor.h \
229         gwin32inputstream.c \
230         gwin32outputstream.c \
231         gwin32outputstream.h \
232         $(NULL)
233
234 win32_more_sources_for_vcproj = \
235         gwin32appinfo.c \
236         win32/gwin32directorymonitor.c \
237         win32/gwinhttpfile.c \
238         win32/gwinhttpfileinputstream.c \
239         win32/gwinhttpfileoutputstream.c \
240         win32/gwinhttpvfs.c
241
242 if OS_WIN32
243 appinfo_sources += gwin32appinfo.c gwin32appinfo.h
244 platform_libadd += -lshlwapi -lws2_32 -ldnsapi
245 win32_sources = $(win32_actual_sources)
246
247 giowin32includedir=$(includedir)/gio-win32-2.0/gio
248 giowin32include_HEADERS = \
249         gwin32inputstream.h \
250         gwin32outputstream.h \
251         $(NULL)
252
253 endif
254
255 SUBDIRS += tests
256
257 libgio_2_0_la_SOURCES =         \
258         gappinfo.c              \
259         gapplication.c          \
260         gapplication.h          \
261         gasynchelper.c          \
262         gasynchelper.h          \
263         gasyncinitable.c        \
264         gasyncresult.c          \
265         gbufferedinputstream.c  \
266         gbufferedoutputstream.c \
267         gcancellable.c          \
268         gcontenttype.c          \
269         gcontenttypeprivate.h   \
270         gcharsetconverter.c     \
271         gconverter.c            \
272         gconverterinputstream.c \
273         gconverteroutputstream.c        \
274         gcredentials.c          \
275         gdatainputstream.c      \
276         gdataoutputstream.c     \
277         gdrive.c                \
278         gdummyfile.h            \
279         gdummyfile.c            \
280         gemblem.h               \
281         gemblem.c               \
282         gemblemedicon.h         \
283         gemblemedicon.c         \
284         gfile.c                 \
285         gfileattribute.c        \
286         gfileattribute-priv.h   \
287         gfileenumerator.c       \
288         gfileicon.c             \
289         gfileinfo.c             \
290         gfileinfo-priv.h        \
291         gfileinputstream.c      \
292         gfilemonitor.c          \
293         gfilenamecompleter.c    \
294         gfileoutputstream.c     \
295         gfileiostream.c         \
296         gfilterinputstream.c    \
297         gfilteroutputstream.c   \
298         gicon.c                 \
299         ginetaddress.c          \
300         ginetsocketaddress.c    \
301         ginitable.c             \
302         ginputstream.c          \
303         gioenums.h              \
304         gioerror.c              \
305         giomodule.c             \
306         giomodule-priv.h        \
307         gioscheduler.c          \
308         giostream.c             \
309         gloadableicon.c         \
310         gmount.c                \
311         gmemoryinputstream.c    \
312         gmemoryoutputstream.c   \
313         gmountoperation.c       \
314         gnativevolumemonitor.c  \
315         gnativevolumemonitor.h  \
316         gnetworkaddress.c       \
317         gnetworkingprivate.h    \
318         gnetworkservice.c       \
319         goutputstream.c         \
320         gpermission.c           \
321         gpollfilemonitor.c      \
322         gpollfilemonitor.h      \
323         gresolver.c             \
324         gseekable.c             \
325         gsimpleasyncresult.c    \
326         gsimplepermission.c     \
327         gsocket.c               \
328         gsocketaddress.c        \
329         gsocketaddressenumerator.c \
330         gsocketclient.c         \
331         gsocketconnectable.c    \
332         gsocketconnection.c     \
333         gsocketcontrolmessage.c \
334         gsocketinputstream.c    \
335         gsocketinputstream.h    \
336         gsocketlistener.c       \
337         gsocketoutputstream.c   \
338         gsocketoutputstream.h   \
339         gsocketservice.c        \
340         gsrvtarget.c            \
341         gtcpconnection.c        \
342         gthreadedsocketservice.c\
343         gthemedicon.c           \
344         gthreadedresolver.c     \
345         gthreadedresolver.h     \
346         gunionvolumemonitor.c   \
347         gunionvolumemonitor.h   \
348         gvfs.c                  \
349         gvolume.c               \
350         gvolumemonitor.c        \
351         gzlibcompressor.c       \
352         gzlibdecompressor.c     \
353         gmountprivate.h         \
354         gioenumtypes.h          \
355         gioenumtypes.c          \
356         $(appinfo_sources)      \
357         $(unix_sources)         \
358         $(win32_sources)        \
359         $(settings_sources)     \
360         $(gdbus_sources)        \
361         $(local_sources)        \
362         $(marshal_sources)      \
363         $(NULL)
364
365 EXTRA_DIST += gnullapplication.c gdbusapplication.c strinfo.c
366
367 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
368
369 libgio_2_0_la_LIBADD = \
370         $(top_builddir)/glib/libglib-2.0.la             \
371         $(top_builddir)/gobject/libgobject-2.0.la       \
372         $(top_builddir)/gmodule/libgmodule-2.0.la       \
373         $(platform_libadd)                              \
374         $(ZLIB_LIBS)                                    \
375         $(SELINUX_LIBS)                                 \
376         $(GLIB_LIBS)                                    \
377         $(XATTR_LIBS)                                   \
378         $(NULL)
379
380 if PLATFORM_WIN32
381 no_undefined = -no-undefined
382 endif
383
384 if OS_WIN32_AND_DLL_COMPILATION
385 export_symbols = -export-symbols gio.def
386 gio_def = gio.def
387
388 gio_win32_res = gio-win32-res.o
389 gio_win32_res_ldflag = -Wl,$(gio_win32_res)
390
391 install-def-file:
392         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
393
394 uninstall-def-file:
395         -rm $(DESTDIR)$(libdir)/gio-2.0.def
396 else
397 install-def-file:
398 uninstall-def-file:
399
400 export_symbols = -export-symbols-regex '^g_.*'
401 endif
402
403 install-data-local: install-ms-lib install-def-file
404         $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
405
406 uninstall-local: uninstall-ms-lib uninstall-def-file
407
408 libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
409         $(gio_win32_res_ldflag) \
410         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
411         -export-dynamic $(no_undefined) $(export_symbols)
412
413 libgio_2_0_la_DEPENDENCIES = $(gio_win32_res) $(gio_def) $(platform_deps)
414
415 gio-win32-res.o: gio.rc
416         $(WINDRES) gio.rc $@
417
418 gio_headers =                   \
419         gappinfo.h              \
420         gapplication.h          \
421         gasyncinitable.h        \
422         gasyncresult.h          \
423         gbufferedinputstream.h  \
424         gbufferedoutputstream.h \
425         gcancellable.h          \
426         gcontenttype.h          \
427         gcharsetconverter.h     \
428         gconverter.h            \
429         gconverterinputstream.h \
430         gconverteroutputstream.h        \
431         gdatainputstream.h      \
432         gdataoutputstream.h     \
433         gdrive.h                \
434         gemblem.h               \
435         gemblemedicon.h         \
436         gfile.h                 \
437         gfileattribute.h        \
438         gfileenumerator.h       \
439         gfileicon.h             \
440         gfileinfo.h             \
441         gfileinputstream.h      \
442         gfilemonitor.h          \
443         gfilenamecompleter.h    \
444         gfileoutputstream.h     \
445         gfileiostream.h         \
446         gfilterinputstream.h    \
447         gfilteroutputstream.h   \
448         gicon.h                 \
449         ginetaddress.h          \
450         ginetsocketaddress.h    \
451         ginputstream.h          \
452         ginitable.h             \
453         gio.h                   \
454         giotypes.h              \
455         gioenums.h              \
456         gioerror.h              \
457         giomodule.h             \
458         gioscheduler.h          \
459         giostream.h             \
460         gloadableicon.h         \
461         gmount.h                \
462         gmemoryinputstream.h    \
463         gmemoryoutputstream.h   \
464         gmountoperation.h       \
465         gnativevolumemonitor.h  \
466         gnetworkaddress.h       \
467         gnetworkservice.h       \
468         goutputstream.h         \
469         gpermission.h           \
470         gresolver.h             \
471         gseekable.h             \
472         gsimpleasyncresult.h    \
473         gsimplepermission.h     \
474         gsocket.h               \
475         gsocketaddress.h        \
476         gsocketaddressenumerator.h \
477         gsocketclient.h         \
478         gsocketconnectable.h    \
479         gsocketconnection.h     \
480         gsocketcontrolmessage.h \
481         gsocketlistener.h       \
482         gsocketservice.h        \
483         gsrvtarget.h            \
484         gtcpconnection.h        \
485         gthreadedsocketservice.h\
486         gthemedicon.h           \
487         gvfs.h                  \
488         gvolume.h               \
489         gvolumemonitor.h        \
490         gzlibcompressor.h       \
491         gzlibdecompressor.h     \
492         $(settings_headers)     \
493         $(gdbus_headers)        \
494         $(NULL)
495
496 gioincludedir=$(includedir)/glib-2.0/gio/
497 gioinclude_HEADERS =            \
498         $(gio_headers)          \
499         gioenumtypes.h
500
501 # these sources (also mentioned above) are generated.
502 BUILT_SOURCES =                 \
503         gio-marshal.h           \
504         gio-marshal.c           \
505         gioenumtypes.h          \
506         gioenumtypes.c          \
507         $(NULL)
508
509 EXTRA_DIST +=                   \
510         gio-marshal.list        \
511         gio.symbols             \
512         gioenumtypes.h.template \
513         gioenumtypes.c.template \
514         makefile.msc            \
515         abicheck.sh             \
516         gio.rc.in               \
517         gschema.dtd             \
518         $(NULL)
519
520 BUILT_EXTRA_DIST =              \
521         gio.rc
522
523 CLEANFILES =                    \
524         $(marshal_sources)      \
525         $(NULL)
526
527 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
528         $(AM_V_GEN) ( top_builddir=`cd $(top_builddir) && pwd`; \
529           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
530             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
531
532 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
533         $(AM_V_GEN) ( top_builddir=`cd $(top_builddir) && pwd`; \
534           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
535             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
536
537 gio-2.0.lib: libgio-2.0.la gio.def
538         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@
539
540 bin_PROGRAMS = gio-querymodules glib-compile-schemas gsettings
541
542 gio_querymodules_SOURCES = gio-querymodules.c
543 gio_querymodules_LDADD   = \
544         $(top_builddir)/glib/libglib-2.0.la             \
545         $(top_builddir)/gobject/libgobject-2.0.la       \
546         $(top_builddir)/gmodule/libgmodule-2.0.la       \
547         libgio-2.0.la                                   \
548         $(NULL)
549
550 glib_compile_schemas_LDADD = $(top_builddir)/glib/libglib-2.0.la
551 glib_compile_schemas_SOURCES = \
552         gvdb/gvdb-format.h              \
553         gvdb/gvdb-builder.h             \
554         gvdb/gvdb-builder.c             \
555         gschema-compile.c
556
557 gsettings_LDADD = \
558         $(top_builddir)/glib/libglib-2.0.la             \
559         $(top_builddir)/gobject/libgobject-2.0.la       \
560         libgio-2.0.la
561 gsettings_SOURCES = gsettings-tool.c
562
563 schemadir = $(datadir)/glib-2.0/schemas
564 dist_schema_DATA = gschema.dtd
565
566 # ------------------------------------------------------------------------
567 # gdbus(1) tool
568
569 bin_PROGRAMS += gdbus
570 gdbus_SOURCES = gdbus-tool.c
571 gdbus_LDADD = libgio-2.0.la \
572         $(top_builddir)/glib/libglib-2.0.la             \
573         $(top_builddir)/gobject/libgobject-2.0.la
574
575 completiondir = $(sysconfdir)/bash_completion.d
576 completion_SCRIPTS = \
577         gdbus-bash-completion.sh                \
578         gsettings-bash-completion.sh
579 EXTRA_DIST += $(completion_SCRIPTS)
580
581 # ------------------------------------------------------------------------
582
583 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gio.vcproj
584         files='$(BUILT_EXTRA_DIST)'; \
585         for f in $$files; do \
586           if test -f $$f; then d=.; else d=$(srcdir); fi; \
587           cp $$d/$$f $(distdir) || exit 1; done
588
589 ../build/win32/vs9/gio.vcproj: $(top_srcdir)/build/win32/vs9/gio.vcprojin
590         for F in `echo $(libgio_2_0_la_SOURCES) $(win32_actual_sources) $(win32_actual_more_sources_for_vcproj) | tr '/' '\\'`; do \
591                 case $$F in \
592                 gunix*.c|gdesktopappinfo.c) ;; \
593                 *.c) echo '   <File RelativePath="..\..\..\gio\'$$F'" />' \
594                      ;; \
595                 esac; \
596         done | sort -u >libgio.sourcefiles
597         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gio.vcprojin >$@
598         rm libgio.sourcefiles
599
600 if HAVE_GLIB_RUNTIME_LIBDIR
601 install-data-hook:
602         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
603         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
604         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
605         rm -f $(DESTDIR)$(libdir)/libgio-2.0.so
606         ln -s $(GLIB_RUNTIME_LIBDIR)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgio-2.0.so
607 endif