Make PLT-reduction work with gcc4, and don't include everything in
[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         gdate.c                 \
74         gdir.c                  \
75         gerror.c                \
76         gfileutils.c            \
77         ghash.c                 \
78         ghook.c                 \
79         giochannel.c            \
80         gkeyfile.c              \
81         glibintl.h              \
82         glist.c                 \
83         gmain.c                 \
84         gmarkup.c               \
85         gmem.c                  \
86         gmessages.c             \
87         gnode.c                 \
88         goption.c               \
89         gpattern.c              \
90         gprimes.c               \
91         gqsort.c                \
92         gqueue.c                \
93         grel.c                  \
94         grand.c                 \
95         gscanner.c              \
96         gshell.c                \
97         gslist.c                \
98         gstdio.c                \
99         gstrfuncs.c             \
100         gstring.c               \
101         gthread.c               \
102         gthreadinit.h           \
103         gthreadpool.c           \
104         gtimer.c                \
105         gtree.c                 \
106         guniprop.c              \
107         gutf8.c                 \
108         gunibreak.h             \
109         gunibreak.c             \
110         gunichartables.h        \
111         gunicollate.c           \
112         gunicomp.h              \
113         gunidecomp.h            \
114         gunidecomp.c            \
115         gunicodeprivate.h       \
116         gutils.c                \
117         gdebug.h                \
118         gprintf.c               \
119         gprintfint.h
120
121 EXTRA_libglib_2_0_la_SOURCES = \
122         giounix.c       \
123         giowin32.c      \
124         gspawn.c        \
125         gspawn-win32.c  \
126         gwin32.c
127
128 glibincludedir=$(includedir)/glib-2.0
129 glibinclude_HEADERS =   \
130         glib-object.h   \
131         glib.h
132
133 glibsubincludedir=$(includedir)/glib-2.0/glib
134 glibsubinclude_HEADERS =   \
135         galloca.h       \
136         garray.h        \
137         gasyncqueue.h   \
138         gatomic.h       \
139         gbacktrace.h    \
140         gcache.h        \
141         gcompletion.h   \
142         gconvert.h      \
143         gdataset.h      \
144         gdate.h         \
145         gdir.h          \
146         gerror.h        \
147         gfileutils.h    \
148         ghash.h         \
149         ghook.h         \
150         gi18n.h         \
151         gi18n-lib.h     \
152         giochannel.h    \
153         gkeyfile.h      \
154         glist.h         \
155         gmacros.h       \
156         gmain.h         \
157         gmarkup.h       \
158         gmem.h          \
159         gmessages.h     \
160         gnode.h         \
161         goption.h       \
162         gpattern.h      \
163         gprimes.h       \
164         gqsort.h        \
165         gquark.h        \
166         gqueue.h        \
167         grand.h         \
168         grel.h          \
169         gscanner.h      \
170         gshell.h        \
171         gslist.h        \
172         gspawn.h        \
173         gstdio.h        \
174         gstrfuncs.h     \
175         gstring.h       \
176         gthread.h       \
177         gthreadpool.h   \
178         gtimer.h        \
179         gtree.h         \
180         gtypes.h        \
181         gunicode.h      \
182         gutils.h        \
183         gwin32.h        \
184         gprintf.h
185
186 install-data-local: install-ms-lib install-libtool-import-lib
187         @if test -f $(glibincludedir)/glist.h ; then                                    \
188           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
189           echo "*** contents of this directory and type 'make install' again." ;        \
190           false ;                                                                       \
191         fi
192
193 uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
194
195 if PLATFORM_WIN32
196 no_undefined = -no-undefined
197 endif
198
199 if OS_WIN32
200 # This requires a very new libtool
201 export_symbols = -export-symbols glib.def
202
203 install-libtool-import-lib:
204 #       Don't put the binary compatibility entries in the import lib!
205 #       (Unfortunately the GNU linker doesn't yet understand the PRIVATE
206 #       directive in .def files.)
207 #
208         for entry in `grep PRIVATE glib.def | sed -e 's/PRIVATE//'`; do \
209           file=`$(NM) -A .libs/libglib-2.0.dll.a | tr -d '\r' | grep -E $$entry'$$' | head -n 1 | cut -d: -f2`; \
210           ar d .libs/libglib-2.0.dll.a $$file; \
211         done
212         $(RANLIB) .libs/libglib-2.0.dll.a
213         $(INSTALL) .libs/libglib-2.0.dll.a $(DESTDIR)$(libdir)
214         $(INSTALL) glib.def $(DESTDIR)$(libdir)/glib-2.0.def
215
216 uninstall-libtool-import-lib:
217         -rm $(DESTDIR)$(libdir)/libglib-2.0.dll.a $(DESTDIR)$(libdir)/glib-2.0.def
218 else
219 install-libtool-import-lib:
220 uninstall-libtool-import-lib:
221
222 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
223 endif
224
225 libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @G_LIB_WIN32_RESOURCE@ @ICONV_LIBS@ @G_LIBS_EXTRA@ 
226 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @G_LIB_WIN32_RESOURCE@ @GLIB_DEF@
227
228 libglib_2_0_la_LDFLAGS = \
229         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
230         -export-dynamic $(no_undefined) $(export_symbols)
231
232 if OS_WIN32
233 bin_PROGRAMS = gspawn-win32-helper
234 gspawn_win32_helper_LDADD = libglib-2.0.la
235 gspawn_win32_helper_LDFLAGS = -mwindows
236
237 $(G_LIB_WIN32_RESOURCE): glib.rc
238         $(top_srcdir)/build/win32/lt-compile-resource glib.rc $@
239 endif
240
241 glib-2.0.lib: libglib-2.0.la glib.def
242         lib -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:glib.def -out:$@
243
244 dist-hook: $(BUILT_EXTRA_DIST)
245         files='$(BUILT_EXTRA_DIST)'; \
246         for f in $$files; do \
247           if test -f $$f; then d=.; else d=$(srcdir); fi; \
248           cp $$d/$$f $(distdir) || exit 1; done