Implement the same PLT reduction technique used in GTK+:
[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 $(srcdir)/glib.symbols | sed -e '/^$$/d' -e 's/^/\t/') > glib.def
18
19 galias.h: glib.symbols
20           ./makegalias.pl < $(srcdir)/glib.symbols > galias.h
21
22 if OS_UNIX
23 TESTS = abicheck.sh
24 endif
25
26 BUILT_SOURCES = galias.h
27
28 EXTRA_DIST =                    \
29         makefile.msc.in         \
30         glib.rc.in              \
31         gen-unicode-tables.pl   \
32         makegalias.pl           \
33         glib.symbols
34
35 # These may be in the builddir too
36 BUILT_EXTRA_DIST =              \
37         makefile.msc            \
38         glib.rc                 \
39         glib.def                \
40         galias.h
41
42 lib_LTLIBRARIES = libglib-2.0.la
43
44 if MS_LIB_AVAILABLE
45 noinst_DATA = glib-2.0.lib
46
47 install-ms-lib:
48         $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
49
50 uninstall-ms-lib:
51         -rm $(DESTDIR)$(libdir)/glib-2.0.lib
52 else
53 install-ms-lib:
54 uninstall-ms-lib:
55 endif
56
57 libglib_2_0_la_SOURCES =        \
58         garray.c                \
59         gasyncqueue.c           \
60         gatomic.c               \
61         gbacktrace.c            \
62         gbsearcharray.h         \
63         gcache.c                \
64         gcompletion.c           \
65         gconvert.c              \
66         gdataset.c              \
67         gdate.c                 \
68         gdir.c                  \
69         gerror.c                \
70         gfileutils.c            \
71         ghash.c                 \
72         ghook.c                 \
73         giochannel.c            \
74         glibintl.h              \
75         glist.c                 \
76         gmain.c                 \
77         gmarkup.c               \
78         gmem.c                  \
79         gmessages.c             \
80         gnode.c                 \
81         goption.c               \
82         gpattern.c              \
83         gprimes.c               \
84         gqsort.c                \
85         gqueue.c                \
86         grel.c                  \
87         grand.c                 \
88         gscanner.c              \
89         gshell.c                \
90         gslist.c                \
91         gstrfuncs.c             \
92         gstring.c               \
93         gthread.c               \
94         gthreadinit.h           \
95         gthreadpool.c           \
96         gtimer.c                \
97         gtree.c                 \
98         guniprop.c              \
99         gutf8.c                 \
100         gunibreak.h             \
101         gunibreak.c             \
102         gunichartables.h        \
103         gunicollate.c           \
104         gunicomp.h              \
105         gunidecomp.h            \
106         gunidecomp.c            \
107         gunicodeprivate.h       \
108         gutils.c                \
109         gdebug.h                \
110         gprintf.c               \
111         gprintfint.h
112
113 EXTRA_libglib_2_0_la_SOURCES = \
114         giounix.c       \
115         giowin32.c      \
116         gspawn.c        \
117         gspawn-win32.c  \
118         gwin32.c
119
120 glibincludedir=$(includedir)/glib-2.0
121 glibinclude_HEADERS =   \
122         glib-object.h   \
123         glib.h
124
125 glibsubincludedir=$(includedir)/glib-2.0/glib
126 glibsubinclude_HEADERS =   \
127         galloca.h       \
128         garray.h        \
129         gasyncqueue.h   \
130         gatomic.h       \
131         gbacktrace.h    \
132         gcache.h        \
133         gcompletion.h   \
134         gconvert.h      \
135         gdataset.h      \
136         gdate.h         \
137         gdir.h          \
138         gerror.h        \
139         gfileutils.h    \
140         ghash.h         \
141         ghook.h         \
142         gi18n.h         \
143         gi18n-lib.h     \
144         giochannel.h    \
145         glist.h         \
146         gmacros.h       \
147         gmain.h         \
148         gmarkup.h       \
149         gmem.h          \
150         gmessages.h     \
151         gnode.h         \
152         goption.h       \
153         gpattern.h      \
154         gprimes.h       \
155         gqsort.h        \
156         gquark.h        \
157         gqueue.h        \
158         grand.h         \
159         grel.h          \
160         gscanner.h      \
161         gshell.h        \
162         gslist.h        \
163         gspawn.h        \
164         gstrfuncs.h     \
165         gstring.h       \
166         gthread.h       \
167         gthreadpool.h   \
168         gtimer.h        \
169         gtree.h         \
170         gtypes.h        \
171         gunicode.h      \
172         gutils.h        \
173         gwin32.h        \
174         gprintf.h
175
176 install-data-local: install-ms-lib install-libtool-import-lib
177         @if test -f $(glibincludedir)/glist.h ; then                                    \
178           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
179           echo "*** contents of this directory and type 'make install' again." ;        \
180           false ;                                                                       \
181         fi
182
183 uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
184
185 if PLATFORM_WIN32
186 no_undefined = -no-undefined
187 endif
188
189 if OS_WIN32
190 # This requires a very new libtool
191 export_symbols = -export-symbols $(srcdir)/glib.def
192
193 install-libtool-import-lib:
194         $(INSTALL) .libs/libglib-2.0.dll.a $(DESTDIR)$(libdir)
195         $(INSTALL) $(srcdir)/glib.def $(DESTDIR)$(libdir)/glib-2.0.def
196
197 uninstall-libtool-import-lib:
198         -rm $(DESTDIR)$(libdir)/libglib-2.0.dll.a $(DESTDIR)$(libdir)/glib-2.0.def
199 else
200 install-libtool-import-lib:
201 uninstall-libtool-import-lib:
202
203 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
204 endif
205
206 libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @G_LIB_WIN32_RESOURCE@ @ICONV_LIBS@ @G_LIBS_EXTRA@ 
207 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @G_LIB_WIN32_RESOURCE@ @GLIB_DEF@
208
209 libglib_2_0_la_LDFLAGS = \
210         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
211         -export-dynamic $(no_undefined) $(export_symbols)
212
213 if OS_WIN32
214 bin_PROGRAMS = gspawn-win32-helper
215 gspawn_win32_helper_LDADD = libglib-2.0.la
216 gspawn_win32_helper_LDFLAGS = -mwindows
217
218 $(G_LIB_WIN32_RESOURCE): glib.rc
219         $(top_srcdir)/build/win32/lt-compile-resource glib.rc $@
220 endif
221
222 glib-2.0.lib: libglib-2.0.la glib.def
223         lib -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:glib.def -out:$@
224
225 dist-hook: $(BUILT_EXTRA_DIST)
226         files='$(BUILT_EXTRA_DIST)'; \
227         for f in $$files; do \
228           if test -f $$f; then d=.; else d=$(srcdir); fi; \
229           cp $$d/$$f $(distdir) || exit 1; done