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