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