4d3b2ad788a1d7e23e56bb4183643b1fb0328dfc
[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 pltcheck.sh
28 endif
29 endif
30
31 BUILT_SOURCES = galias.h galiasdef.c
32
33 MIRRORING_TAB_SOURCES =                         \
34         glib-mirroring-tab/Makefile             \
35         glib-mirroring-tab/gen-mirroring-tab.c  \
36         glib-mirroring-tab/packtab.h            \
37         glib-mirroring-tab/packtab.c
38
39 EXTRA_DIST =                    \
40         makefile.msc.in         \
41         glib.rc.in              \
42         gen-unicode-tables.pl   \
43         gen-script-table.pl     \
44         makegalias.pl           \
45         abicheck.sh             \
46         pltcheck.sh             \
47         glib.symbols            \
48         $(MIRRORING_TAB_SOURCES)
49
50 # These may be in the builddir too
51 BUILT_EXTRA_DIST =              \
52         makefile.msc            \
53         glib.rc                 \
54         galias.h                \
55         galiasdef.c
56
57 lib_LTLIBRARIES = libglib-2.0.la
58
59 if MS_LIB_AVAILABLE
60 noinst_DATA = glib-2.0.lib
61
62 install-ms-lib:
63         $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
64
65 uninstall-ms-lib:
66         -rm $(DESTDIR)$(libdir)/glib-2.0.lib
67 else
68 install-ms-lib:
69 uninstall-ms-lib:
70 endif
71
72 libglib_2_0_la_SOURCES =        \
73         garray.c                \
74         gasyncqueue.c           \
75         gatomic.c               \
76         gbacktrace.c            \
77         gbase64.c               \
78         gbookmarkfile.c         \
79         gbsearcharray.h         \
80         gcache.c                \
81         gcompletion.c           \
82         gconvert.c              \
83         gdataset.c              \
84         gdatasetprivate.h       \
85         gdate.c                 \
86         gdir.c                  \
87         gerror.c                \
88         gfileutils.c            \
89         ghash.c                 \
90         ghook.c                 \
91         giochannel.c            \
92         gkeyfile.c              \
93         glibintl.h              \
94         glist.c                 \
95         gmain.c                 \
96         gmappedfile.c           \
97         gmarkup.c               \
98         gmem.c                  \
99         gmessages.c             \
100         gmirroringtable.h       \
101         gnode.c                 \
102         goption.c               \
103         gpattern.c              \
104         gprimes.c               \
105         gqsort.c                \
106         gqueue.c                \
107         grel.c                  \
108         grand.c                 \
109         gscanner.c              \
110         gscripttable.h          \
111         gsequence.c             \
112         gshell.c                \
113         gslice.c                \
114         gslist.c                \
115         gstdio.c                \
116         gstrfuncs.c             \
117         gstring.c               \
118         gthread.c               \
119         gthreadprivate.h        \
120         gthreadpool.c           \
121         gtimer.c                \
122         gtree.c                 \
123         guniprop.c              \
124         gutf8.c                 \
125         gunibreak.h             \
126         gunibreak.c             \
127         gunichartables.h        \
128         gunicollate.c           \
129         gunicomp.h              \
130         gunidecomp.h            \
131         gunidecomp.c            \
132         gunicodeprivate.h       \
133         gutils.c                \
134         gdebug.h                \
135         gprintf.c               \
136         gprintfint.h
137
138 EXTRA_libglib_2_0_la_SOURCES = \
139         giounix.c       \
140         giowin32.c      \
141         gspawn.c        \
142         gspawn-win32.c  \
143         gwin32.c
144
145 glibincludedir=$(includedir)/glib-2.0
146 glibinclude_HEADERS =   \
147         glib-object.h   \
148         glib.h
149
150 glibsubincludedir=$(includedir)/glib-2.0/glib
151 glibsubinclude_HEADERS =   \
152         galloca.h       \
153         garray.h        \
154         gasyncqueue.h   \
155         gatomic.h       \
156         gbacktrace.h    \
157         gbase64.h       \
158         gbookmarkfile.h \
159         gcache.h        \
160         gcompletion.h   \
161         gconvert.h      \
162         gdataset.h      \
163         gdate.h         \
164         gdir.h          \
165         gerror.h        \
166         gfileutils.h    \
167         ghash.h         \
168         ghook.h         \
169         gi18n.h         \
170         gi18n-lib.h     \
171         giochannel.h    \
172         gkeyfile.h      \
173         glist.h         \
174         gmacros.h       \
175         gmain.h         \
176         gmappedfile.h   \
177         gmarkup.h       \
178         gmem.h          \
179         gmessages.h     \
180         gnode.h         \
181         goption.h       \
182         gpattern.h      \
183         gprimes.h       \
184         gqsort.h        \
185         gquark.h        \
186         gqueue.h        \
187         grand.h         \
188         grel.h          \
189         gscanner.h      \
190         gsequence.h     \
191         gshell.h        \
192         gslice.h        \
193         gslist.h        \
194         gspawn.h        \
195         gstdio.h        \
196         gstrfuncs.h     \
197         gstring.h       \
198         gthread.h       \
199         gthreadpool.h   \
200         gtimer.h        \
201         gtree.h         \
202         gtypes.h        \
203         gunicode.h      \
204         gutils.h        \
205         gwin32.h        \
206         gprintf.h
207
208 install-data-local: install-ms-lib install-def-file
209         @if test -f $(glibincludedir)/glist.h ; then                                    \
210           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
211           echo "*** contents of this directory and type 'make install' again." ;        \
212           false ;                                                                       \
213         fi
214
215 uninstall-local: uninstall-ms-lib uninstall-def-file
216
217 if PLATFORM_WIN32
218 no_undefined = -no-undefined
219 endif
220
221 if OS_WIN32
222 # This requires a very new libtool
223 export_symbols = -export-symbols glib.def
224
225 install-def-file:
226         $(INSTALL) glib.def $(DESTDIR)$(libdir)/glib-2.0.def
227
228 uninstall-def-file:
229         -rm $(DESTDIR)$(libdir)/glib-2.0.def
230 else
231 install-def-file:
232 uninstall-def-file:
233
234 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
235 endif
236
237 if OS_WIN32
238 glib_win32_res = glib-win32-res.o
239 glib_win32_res_ldflag = -Wl,$(glib_win32_res)
240 endif
241
242 libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ 
243 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) @GLIB_DEF@
244
245 libglib_2_0_la_LDFLAGS = \
246          $(glib_win32_res_ldflag) \
247         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
248         -export-dynamic $(no_undefined) $(export_symbols)
249
250 if OS_WIN32
251 bin_PROGRAMS = gspawn-win32-helper gspawn-win32-helper-console
252 gspawn_win32_helper_LDADD = libglib-2.0.la
253 gspawn_win32_helper_LDFLAGS = -mwindows
254 gspawn_win32_helper_console_LDADD = libglib-2.0.la
255
256 glib-win32-res.o: glib.rc
257         $(WINDRES) glib.rc $@
258 endif
259
260 gspawn-win32-helper-console.c:
261         echo '#include "gspawn-win32-helper.c"' >$@
262
263 glib-2.0.lib: libglib-2.0.la glib.def
264         lib -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:glib.def -out:$@
265
266 dist-hook: $(BUILT_EXTRA_DIST)
267         files='$(BUILT_EXTRA_DIST)'; \
268         for f in $$files; do \
269           if test -f $$f; then d=.; else d=$(srcdir); fi; \
270           cp $$d/$$f $(distdir) || exit 1; done