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