766b2da096570877dbae466eb873b719d02844e9
[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) $(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         gthread.c               \
138         gthreadprivate.h        \
139         gthreadpool.c           \
140         gtimer.c                \
141         gtree.c                 \
142         guniprop.c              \
143         gutf8.c                 \
144         gunibreak.h             \
145         gunibreak.c             \
146         gunichartables.h        \
147         gunicollate.c           \
148         gunicomp.h              \
149         gunidecomp.h            \
150         gunidecomp.c            \
151         gunicodeprivate.h       \
152         gutils.c                \
153         gdebug.h                \
154         gprintf.c               \
155         gprintfint.h
156
157 EXTRA_libglib_2_0_la_SOURCES = \
158         giounix.c       \
159         giowin32.c      \
160         gspawn.c        \
161         gspawn-win32.c  \
162         gwin32.c
163
164 glibincludedir=$(includedir)/glib-2.0
165 glibinclude_HEADERS =   \
166         glib-object.h   \
167         glib.h
168
169 glibsubincludedir=$(includedir)/glib-2.0/glib
170 glibsubinclude_HEADERS =   \
171         galloca.h       \
172         garray.h        \
173         gasyncqueue.h   \
174         gatomic.h       \
175         gbacktrace.h    \
176         gbase64.h       \
177         gbookmarkfile.h \
178         gcache.h        \
179         gcompletion.h   \
180         gconvert.h      \
181         gdataset.h      \
182         gdate.h         \
183         gdir.h          \
184         gerror.h        \
185         gfileutils.h    \
186         ghash.h         \
187         ghook.h         \
188         gi18n.h         \
189         gi18n-lib.h     \
190         giochannel.h    \
191         gkeyfile.h      \
192         glist.h         \
193         gmacros.h       \
194         gmain.h         \
195         gmappedfile.h   \
196         gmarkup.h       \
197         gmem.h          \
198         gmessages.h     \
199         gnode.h         \
200         goption.h       \
201         gpattern.h      \
202         gprimes.h       \
203         gqsort.h        \
204         gquark.h        \
205         gqueue.h        \
206         grand.h         \
207         $(gregex_h)     \
208         grel.h          \
209         gscanner.h      \
210         gsequence.h     \
211         gshell.h        \
212         gslice.h        \
213         gslist.h        \
214         gspawn.h        \
215         gstdio.h        \
216         gstrfuncs.h     \
217         gstring.h       \
218         gthread.h       \
219         gthreadpool.h   \
220         gtimer.h        \
221         gtree.h         \
222         gtypes.h        \
223         gunicode.h      \
224         gutils.h        \
225         gwin32.h        \
226         gprintf.h
227
228 install-data-local: install-ms-lib install-def-file
229         @if test -f $(glibincludedir)/glist.h ; then                                    \
230           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
231           echo "*** contents of this directory and type 'make install' again." ;        \
232           false ;                                                                       \
233         fi
234
235 uninstall-local: uninstall-ms-lib uninstall-def-file
236
237 if PLATFORM_WIN32
238 no_undefined = -no-undefined
239 endif
240
241 if OS_WIN32
242 # This requires a very new libtool
243 export_symbols = -export-symbols glib.def
244
245 install-def-file:
246         $(INSTALL) glib.def $(DESTDIR)$(libdir)/glib-2.0.def
247
248 uninstall-def-file:
249         -rm $(DESTDIR)$(libdir)/glib-2.0.def
250 else
251 install-def-file:
252 uninstall-def-file:
253
254 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
255 endif
256
257 if OS_WIN32
258 glib_win32_res = glib-win32-res.o
259 glib_win32_res_ldflag = -Wl,$(glib_win32_res)
260 endif
261
262 if ENABLE_REGEX
263 if USE_SYSTEM_PCRE
264 pcre_lib = $(PCRE_LIBS)
265 pcre_inc = $(PCRE_CFLAGS)
266 else
267 pcre_lib = pcre/libpcre.la
268 pcre_inc =
269 endif
270 else
271 pcre_lib =
272 pcre_inc =
273 endif
274
275 libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib)
276 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) @GLIB_DEF@
277
278 libglib_2_0_la_LDFLAGS = \
279          $(glib_win32_res_ldflag) \
280         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
281         -export-dynamic $(no_undefined) $(export_symbols)
282
283 if OS_WIN32
284 bin_PROGRAMS = gspawn-win32-helper gspawn-win32-helper-console
285 gspawn_win32_helper_LDADD = libglib-2.0.la
286 gspawn_win32_helper_LDFLAGS = -mwindows
287 gspawn_win32_helper_console_LDADD = libglib-2.0.la
288
289 glib-win32-res.o: glib.rc
290         $(WINDRES) glib.rc $@
291 endif
292
293 gspawn-win32-helper-console.c:
294         echo '#include "gspawn-win32-helper.c"' >$@
295
296 glib-2.0.lib: libglib-2.0.la glib.def
297         lib -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:glib.def -out:$@
298
299 dist-hook: $(BUILT_EXTRA_DIST)
300         files='$(BUILT_EXTRA_DIST)'; \
301         for f in $$files; do \
302           if test -f $$f; then d=.; else d=$(srcdir); fi; \
303           cp $$d/$$f $(distdir) || exit 1; done