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