Add g_object_add/remove_toggle_ref() functions to get notification when a
[platform/upstream/glib.git] / glib / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 if HAVE_GOOD_PRINTF
4 else
5 PRINTF_SUBDIR = gnulib
6 printf_la = gnulib/libgnulib.la
7 endif 
8
9 SUBDIRS = libcharset $(PRINTF_SUBDIR)
10
11 DIST_SUBDIRS = libcharset gnulib
12
13 INCLUDES = -I$(top_srcdir) -DG_LOG_DOMAIN=\"GLib\" \
14         $(GLIB_DEBUG_FLAGS) -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION 
15
16 glib.def: glib.symbols
17         (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/glib.symbols | sed -e '/^$$/d' -e 's/^/        /' -e 's/G_GNUC_[^ ]*//g') > glib.def
18
19 galias.h: glib.symbols
20           $(PERL) $(srcdir)/makegalias.pl < $(srcdir)/glib.symbols > galias.h
21
22 galiasdef.c: glib.symbols
23           $(PERL) $(srcdir)/makegalias.pl -def < $(srcdir)/glib.symbols > galiasdef.c
24
25 if OS_LINUX
26 if HAVE_GNUC_VISIBILITY
27 TESTS = abicheck.sh
28 endif
29 endif
30
31 BUILT_SOURCES = galias.h galiasdef.c
32
33 EXTRA_DIST =                    \
34         makefile.msc.in         \
35         glib.rc.in              \
36         gen-unicode-tables.pl   \
37         makegalias.pl           \
38         abicheck.sh             \
39         glib.symbols
40
41 # These may be in the builddir too
42 BUILT_EXTRA_DIST =              \
43         makefile.msc            \
44         glib.rc                 \
45         galias.h                \
46         galiasdef.c
47
48 lib_LTLIBRARIES = libglib-2.0.la
49
50 if MS_LIB_AVAILABLE
51 noinst_DATA = glib-2.0.lib
52
53 install-ms-lib:
54         $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
55
56 uninstall-ms-lib:
57         -rm $(DESTDIR)$(libdir)/glib-2.0.lib
58 else
59 install-ms-lib:
60 uninstall-ms-lib:
61 endif
62
63 libglib_2_0_la_SOURCES =        \
64         garray.c                \
65         gasyncqueue.c           \
66         gatomic.c               \
67         gbacktrace.c            \
68         gbsearcharray.h         \
69         gcache.c                \
70         gcompletion.c           \
71         gconvert.c              \
72         gdataset.c              \
73         gdatasetprivate.h       \
74         gdate.c                 \
75         gdir.c                  \
76         gerror.c                \
77         gfileutils.c            \
78         ghash.c                 \
79         ghook.c                 \
80         giochannel.c            \
81         gkeyfile.c              \
82         glibintl.h              \
83         glist.c                 \
84         gmain.c                 \
85         gmarkup.c               \
86         gmem.c                  \
87         gmessages.c             \
88         gnode.c                 \
89         goption.c               \
90         gpattern.c              \
91         gprimes.c               \
92         gqsort.c                \
93         gqueue.c                \
94         grel.c                  \
95         grand.c                 \
96         gscanner.c              \
97         gshell.c                \
98         gslist.c                \
99         gstdio.c                \
100         gstrfuncs.c             \
101         gstring.c               \
102         gthread.c               \
103         gthreadinit.h           \
104         gthreadpool.c           \
105         gtimer.c                \
106         gtree.c                 \
107         guniprop.c              \
108         gutf8.c                 \
109         gunibreak.h             \
110         gunibreak.c             \
111         gunichartables.h        \
112         gunicollate.c           \
113         gunicomp.h              \
114         gunidecomp.h            \
115         gunidecomp.c            \
116         gunicodeprivate.h       \
117         gutils.c                \
118         gdebug.h                \
119         gprintf.c               \
120         gprintfint.h
121
122 EXTRA_libglib_2_0_la_SOURCES = \
123         giounix.c       \
124         giowin32.c      \
125         gspawn.c        \
126         gspawn-win32.c  \
127         gwin32.c
128
129 glibincludedir=$(includedir)/glib-2.0
130 glibinclude_HEADERS =   \
131         glib-object.h   \
132         glib.h
133
134 glibsubincludedir=$(includedir)/glib-2.0/glib
135 glibsubinclude_HEADERS =   \
136         galloca.h       \
137         garray.h        \
138         gasyncqueue.h   \
139         gatomic.h       \
140         gbacktrace.h    \
141         gcache.h        \
142         gcompletion.h   \
143         gconvert.h      \
144         gdataset.h      \
145         gdate.h         \
146         gdir.h          \
147         gerror.h        \
148         gfileutils.h    \
149         ghash.h         \
150         ghook.h         \
151         gi18n.h         \
152         gi18n-lib.h     \
153         giochannel.h    \
154         gkeyfile.h      \
155         glist.h         \
156         gmacros.h       \
157         gmain.h         \
158         gmarkup.h       \
159         gmem.h          \
160         gmessages.h     \
161         gnode.h         \
162         goption.h       \
163         gpattern.h      \
164         gprimes.h       \
165         gqsort.h        \
166         gquark.h        \
167         gqueue.h        \
168         grand.h         \
169         grel.h          \
170         gscanner.h      \
171         gshell.h        \
172         gslist.h        \
173         gspawn.h        \
174         gstdio.h        \
175         gstrfuncs.h     \
176         gstring.h       \
177         gthread.h       \
178         gthreadpool.h   \
179         gtimer.h        \
180         gtree.h         \
181         gtypes.h        \
182         gunicode.h      \
183         gutils.h        \
184         gwin32.h        \
185         gprintf.h
186
187 install-data-local: install-ms-lib install-libtool-import-lib
188         @if test -f $(glibincludedir)/glist.h ; then                                    \
189           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
190           echo "*** contents of this directory and type 'make install' again." ;        \
191           false ;                                                                       \
192         fi
193
194 uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
195
196 if PLATFORM_WIN32
197 no_undefined = -no-undefined
198 endif
199
200 if OS_WIN32
201 # This requires a very new libtool
202 export_symbols = -export-symbols glib.def
203
204 install-libtool-import-lib:
205 #       Don't put the binary compatibility entries in the import lib!
206 #       (Unfortunately the GNU linker doesn't yet understand the PRIVATE
207 #       directive in .def files.)
208 #
209         for entry in `grep PRIVATE glib.def | sed -e 's/PRIVATE//'`; do \
210           file=`$(NM) -A .libs/libglib-2.0.dll.a | tr -d '\r' | grep -E $$entry'$$' | head -n 1 | cut -d: -f2`; \
211           ar d .libs/libglib-2.0.dll.a $$file; \
212         done
213         $(RANLIB) .libs/libglib-2.0.dll.a
214         $(INSTALL) .libs/libglib-2.0.dll.a $(DESTDIR)$(libdir)
215         $(INSTALL) glib.def $(DESTDIR)$(libdir)/glib-2.0.def
216
217 uninstall-libtool-import-lib:
218         -rm $(DESTDIR)$(libdir)/libglib-2.0.dll.a $(DESTDIR)$(libdir)/glib-2.0.def
219 else
220 install-libtool-import-lib:
221 uninstall-libtool-import-lib:
222
223 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
224 endif
225
226 libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @G_LIB_WIN32_RESOURCE@ @ICONV_LIBS@ @G_LIBS_EXTRA@ 
227 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @G_LIB_WIN32_RESOURCE@ @GLIB_DEF@
228
229 libglib_2_0_la_LDFLAGS = \
230         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
231         -export-dynamic $(no_undefined) $(export_symbols)
232
233 if OS_WIN32
234 bin_PROGRAMS = gspawn-win32-helper
235 gspawn_win32_helper_LDADD = libglib-2.0.la
236 gspawn_win32_helper_LDFLAGS = -mwindows
237
238 $(G_LIB_WIN32_RESOURCE): glib.rc
239         $(top_srcdir)/build/win32/lt-compile-resource glib.rc $@
240 endif
241
242 glib-2.0.lib: libglib-2.0.la glib.def
243         lib -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:glib.def -out:$@
244
245 dist-hook: $(BUILT_EXTRA_DIST)
246         files='$(BUILT_EXTRA_DIST)'; \
247         for f in $$files; do \
248           if test -f $$f; then d=.; else d=$(srcdir); fi; \
249           cp $$d/$$f $(distdir) || exit 1; done