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