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