build: Add --disable-compile-warnings
[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 BUILT_SOURCES =
5 DISTCLEANFILES =
6 CLEANFILES =
7
8 #
9 # Generate glibconfig.h
10 #
11 # The timestamp of the stamp file is used to indicate if glibconfig.h is
12 # up to date with respect to config.status.  In the usual case, changes
13 # to config.status will not result in changes to glibconfig.h so we
14 # avoid touching its timestamp (in order not to rebuild the whole tree).
15 #
16 DISTCLEANFILES += glibconfig-stamp glibconfig.h
17 BUILT_SOURCES += glibconfig-stamp
18 configexecincludedir = $(libdir)/glib-2.0/include
19 nodist_configexecinclude_HEADERS = glibconfig.h
20 glibconfig-stamp: ../config.status
21         $(AM_V_GEN) cd $(top_builddir) && \
22           $(SHELL) ./config.status glib/glibconfig.h
23         @touch glibconfig-stamp
24
25
26
27 if HAVE_GOOD_PRINTF
28 else
29 PRINTF_SUBDIR = gnulib
30 printf_la = gnulib/libgnulib.la
31 endif 
32
33 if USE_SYSTEM_PCRE
34 else
35 MAYBE_PCRE = pcre 
36 endif
37
38 SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre .
39 DIST_SUBDIRS = libcharset gnulib pcre update-pcre tests
40 if BUILD_MODULAR_TESTS
41 SUBDIRS += tests 
42 endif
43
44 AM_CPPFLAGS =                           \
45         $(glib_INCLUDES)                \
46         $(pcre_inc)                     \
47         -DG_LOG_DOMAIN=\"GLib\"         \
48         $(GLIB_DEBUG_FLAGS)             \
49         -DGLIB_COMPILATION              \
50         -DPCRE_STATIC
51
52 AM_CFLAGS = $(GLIB_WARN_CFLAGS)
53
54 MIRRORING_TAB_SOURCE =                          \
55         glib-mirroring-tab/Makefile             \
56         glib-mirroring-tab/gen-mirroring-tab.c  \
57         glib-mirroring-tab/packtab.h            \
58         glib-mirroring-tab/packtab.c
59
60 # The compilation of GRegex can be disabled, but the source files must
61 # be distributed.
62 EXTRA_DIST +=                   \
63         makefile.msc.in         \
64         glib.rc.in              \
65         gen-iswide-table.py     \
66         gen-unicode-tables.pl   \
67         gen-script-table.pl     \
68         glibconfig.h.win32.in   \
69         gregex.c                \
70         gregex.h                \
71         win_iconv.c             \
72         libglib-gdb.py.in       \
73         docs.c                  \
74         gconstructor.h          \
75         $(MIRRORING_TAB_SOURCE)
76
77 CLEANFILES += libglib-gdb.py
78
79 # These may be in the builddir too
80 BUILT_EXTRA_DIST =              \
81         makefile.msc            \
82         glibconfig.h.win32      \
83         glib.rc
84
85 lib_LTLIBRARIES = libglib-2.0.la
86
87 if OS_WIN32_AND_DLL_COMPILATION
88 if MS_LIB_AVAILABLE
89 noinst_DATA = glib-2.0.lib
90
91 install_ms_lib_cmd = $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
92 uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/glib-2.0.lib
93 endif
94 endif
95
96 install-ms-lib:
97         $(install_ms_lib_cmd)
98
99 uninstall-ms-lib:
100         $(uninstall_ms_lib_cmd)
101
102 deprecated_sources = \
103         deprecated/gallocator.c         \
104         deprecated/gcache.c             \
105         deprecated/gcompletion.c        \
106         deprecated/grel.c               \
107         deprecated/gthread-deprecated.c
108
109 libglib_2_0_la_SOURCES =        \
110         $(deprecated_sources)   \
111         glib_probes.d           \
112         garray.c                \
113         gasyncqueue.c           \
114         gasyncqueueprivate.h    \
115         gatomic.c               \
116         gbacktrace.c            \
117         gbase64.c               \
118         gbitlock.c              \
119         gbookmarkfile.c         \
120         gbsearcharray.h         \
121         gbytes.c                \
122         gbytes.h                \
123         gcharset.c              \
124         gcharsetprivate.h       \
125         gchecksum.c             \
126         gconvert.c              \
127         gdataset.c              \
128         gdatasetprivate.h       \
129         gdate.c                 \
130         gdatetime.c             \
131         gdir.c                  \
132         genviron.c              \
133         gerror.c                \
134         gfileutils.c            \
135         ggettext.c              \
136         ghash.c                 \
137         ghmac.c                 \
138         ghook.c                 \
139         ghostutils.c            \
140         giochannel.c            \
141         gkeyfile.c              \
142         glibintl.h              \
143         glib_trace.h            \
144         glib-init.h             \
145         glib-init.c             \
146         glib-private.h          \
147         glib-private.c          \
148         glist.c                 \
149         gmain-internal.h        \
150         gmain.c                 \
151         gmappedfile.c           \
152         gmarkup.c               \
153         gmem.c                  \
154         gmessages.c             \
155         gmirroringtable.h       \
156         gnode.c                 \
157         goption.c               \
158         gpattern.c              \
159         gpoll.c                 \
160         gprimes.c               \
161         gqsort.c                \
162         gquark.c                \
163         gqueue.c                \
164         grand.c                 \
165         gregex.c                \
166         gscanner.c              \
167         gscripttable.h          \
168         gsequence.c             \
169         gshell.c                \
170         gslice.c                \
171         gslist.c                \
172         gstdio.c                \
173         gstrfuncs.c             \
174         gstring.c               \
175         gstringchunk.c          \
176         gtestutils.c            \
177         gthread.c               \
178         gthreadprivate.h        \
179         gthreadpool.c           \
180         gtimer.c                \
181         gtimezone.c             \
182         gtrashstack.c           \
183         gtree.c                 \
184         guniprop.c              \
185         gutf8.c                 \
186         gunibreak.h             \
187         gunibreak.c             \
188         gunichartables.h        \
189         gunicollate.c           \
190         gunicomp.h              \
191         gunidecomp.h            \
192         gunidecomp.c            \
193         gunicodeprivate.h       \
194         gurifuncs.c             \
195         gutils.c                \
196         gvariant.h              \
197         gvariant.c              \
198         gvariant-core.h         \
199         gvariant-core.c         \
200         gvariant-internal.h     \
201         gvariant-parser.c       \
202         gvariant-serialiser.h   \
203         gvariant-serialiser.c   \
204         gvarianttypeinfo.h      \
205         gvarianttypeinfo.c      \
206         gvarianttype.c          \
207         gversion.c              \
208         gwakeup.h               \
209         gwakeup.c               \
210         gprintf.c               \
211         gprintfint.h
212
213 if OS_UNIX
214 libglib_2_0_la_SOURCES += glib-unix.c
215 endif
216
217 if OS_WIN32
218 libglib_2_0_la_SOURCES += gthread-win32.c
219 else
220 libglib_2_0_la_SOURCES += gthread-posix.c
221 endif
222
223 EXTRA_libglib_2_0_la_SOURCES = \
224         giounix.c       \
225         giowin32.c      \
226         gspawn.c        \
227         gspawn-win32.c  \
228         gwin32.c
229
230 glibincludedir=$(includedir)/glib-2.0
231 glibinclude_HEADERS =   \
232         glib-unix.h     \
233         glib-object.h   \
234         glib.h
235
236 deprecatedincludedir=$(includedir)/glib-2.0/glib/deprecated
237 deprecatedinclude_HEADERS = \
238         deprecated/gallocator.h         \
239         deprecated/gcache.h             \
240         deprecated/gcompletion.h        \
241         deprecated/gmain.h              \
242         deprecated/grel.h               \
243         deprecated/gthread.h
244
245 glibsubincludedir=$(includedir)/glib-2.0/glib
246 glibsubinclude_HEADERS = \
247         galloca.h       \
248         garray.h        \
249         gasyncqueue.h   \
250         gatomic.h       \
251         gbacktrace.h    \
252         gbase64.h       \
253         gbitlock.h      \
254         gbookmarkfile.h \
255         gbytes.h        \
256         gcharset.h      \
257         gchecksum.h     \
258         gconvert.h      \
259         gdataset.h      \
260         gdate.h         \
261         gdatetime.h     \
262         gdir.h          \
263         genviron.h      \
264         gerror.h        \
265         gfileutils.h    \
266         ggettext.h      \
267         ghash.h         \
268         ghmac.h         \
269         ghook.h         \
270         ghostutils.h    \
271         gi18n.h         \
272         gi18n-lib.h     \
273         giochannel.h    \
274         gkeyfile.h      \
275         glist.h         \
276         gmacros.h       \
277         gmain.h         \
278         gmappedfile.h   \
279         gmarkup.h       \
280         gmem.h          \
281         gmessages.h     \
282         gnode.h         \
283         goption.h       \
284         gpattern.h      \
285         gpoll.h         \
286         gprimes.h       \
287         gqsort.h        \
288         gquark.h        \
289         gqueue.h        \
290         grand.h         \
291         gregex.h        \
292         gscanner.h      \
293         gsequence.h     \
294         gshell.h        \
295         gslice.h        \
296         gslist.h        \
297         gspawn.h        \
298         gstdio.h        \
299         gstrfuncs.h     \
300         gtestutils.h    \
301         gstring.h       \
302         gstringchunk.h  \
303         gthread.h       \
304         gthreadpool.h   \
305         gtimer.h        \
306         gtimezone.h     \
307         gtrashstack.h   \
308         gtree.h         \
309         gtypes.h        \
310         gunicode.h      \
311         gurifuncs.h     \
312         gutils.h        \
313         gvarianttype.h  \
314         gvariant.h      \
315         gversion.h      \
316         gversionmacros.h \
317         gwin32.h        \
318         gprintf.h
319
320 # This is read by gobject-introspection/misc/ and gtk-doc
321 glib-public-headers.txt: Makefile
322         echo $(glibinclude_HEADERS) $(glibsubinclude_HEADERS) > $@.tmp && mv $@.tmp $@
323
324 CLEANFILES += glib-public-headers.txt
325
326 all-local: glib-public-headers.txt
327
328 install-data-local: install-ms-lib
329         @if test -f $(glibincludedir)/glist.h ; then                                    \
330           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
331           echo "*** contents of this directory and type 'make install' again." ;        \
332           false ;                                                                       \
333         fi
334
335 uninstall-local: uninstall-ms-lib uninstall-gdb
336
337 if PLATFORM_WIN32
338 no_undefined = -no-undefined
339 endif
340
341 if OS_WIN32_AND_DLL_COMPILATION
342 glib_win32_res = glib-win32-res.o
343 glib_win32_res_ldflag = -Wl,$(glib_win32_res)
344 endif
345
346 if USE_SYSTEM_PCRE
347 pcre_lib = $(PCRE_LIBS)
348 pcre_inc = $(PCRE_CFLAGS)
349 else
350 pcre_lib = pcre/libpcre.la
351 pcre_inc =
352 endif
353
354 libglib_2_0_la_CFLAGS = $(AM_CFLAGS) $(GLIB_HIDDEN_VISIBILITY_CFLAGS)
355 libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib) $(G_THREAD_LIBS_EXTRA) $(G_THREAD_LIBS_FOR_GTHREAD)
356 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def)
357
358 libglib_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
359          $(glib_win32_res_ldflag) \
360         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
361         -export-dynamic $(no_undefined)
362
363 INSTALL_PROGS=
364
365 if ENABLE_DTRACE
366 glib_probes.h: glib_probes.d Makefile
367         $(AM_V_GEN) $(DTRACE) -C -h -s $< -o $@.tmp
368         @$(SED) -e "s,define STAP_HAS_SEMAPHORES 1,undef STAP_HAS_SEMAPHORES," < $@.tmp > $@ && rm -f $@.tmp
369 glib_probes.o: glib_probes.d Makefile
370         $(AM_V_GEN) $(DTRACE) -G -s $< -o $@
371 BUILT_SOURCES += glib_probes.h glib_probes.o
372 CLEANFILES += glib_probes.h glib_probes.h.tmp
373 libglib_2_0_la_LIBADD += glib_probes.o
374 endif
375
376 if ENABLE_SYSTEMTAP
377 tapset_in_files = glib.stp.in
378 tapsetdir   = @ABS_TAPSET_DIR@
379 tapset_DATA = $(tapset_in_files:.stp.in=.stp)
380 EXTRA_DIST += $(tapset_in_files)
381 endif
382
383 gspawn-win32-helper-console.c:
384         echo '#define HELPER_CONSOLE' >$@
385         echo '#include "gspawn-win32-helper.c"' >>$@
386
387 gspawn-win64-helper.c:
388         echo '#include "gspawn-win32-helper.c"' >$@
389
390 gspawn-win64-helper-console.c:
391         echo '#define HELPER_CONSOLE' >$@
392         echo '#include "gspawn-win32-helper.c"' >>$@
393
394
395 if OS_WIN32
396 if OS_WIN32_X64
397 INSTALL_PROGS += gspawn-win64-helper gspawn-win64-helper-console
398 gspawn_win64_helper_LDADD = libglib-2.0.la
399 gspawn_win64_helper_LDFLAGS = -mwindows
400 gspawn_win64_helper_console_LDADD = libglib-2.0.la
401 else
402 INSTALL_PROGS += gspawn-win32-helper gspawn-win32-helper-console
403 gspawn_win32_helper_LDADD = libglib-2.0.la
404 gspawn_win32_helper_LDFLAGS = -mwindows
405 gspawn_win32_helper_console_LDADD = libglib-2.0.la
406 endif
407 endif
408
409 glib-win32-res.o: glib.rc
410         $(WINDRES) glib.rc $@
411
412 bin_PROGRAMS     = ${INSTALL_PROGS}
413
414 if OS_UNIX
415
416 INSTALL_PROGS   += gtester
417 gtester_SOURCES  = gtester.c
418 gtester_LDADD    = libglib-2.0.la 
419
420 auto_config_binscripts = gtester-report
421 bin_SCRIPTS = ${auto_config_binscripts}
422 EXTRA_DIST += ${auto_config_binscripts}
423
424 CONFIGVARS = \
425         "bindir"        : "${bindir}",          \
426         "glib-version"  : "${GLIB_VERSION}"
427
428 install-exec-hook:
429         for sf in ${auto_config_binscripts} ; do \
430           mv -f "$(DESTDIR)$(bindir)/$$sf" "$(DESTDIR)$(bindir)/$$sf".tmp \
431           && sed < "$(DESTDIR)$(bindir)/$$sf".tmp > "$(DESTDIR)$(bindir)/$$sf" \
432             -e '1,24s|^ *#@PKGINSTALL_CONFIGVARS_IN24LINES@|  ${CONFIGVARS}|' \
433             -e '1,1s|#! /usr/bin/env python\([0-9]\+\(\.[0-9]\+\)\?\)\?|#!${PYTHON}|' \
434           || exit $$? ; \
435           chmod a+x $(DESTDIR)$(bindir)/$$sf ; \
436           rm -f "$(DESTDIR)$(bindir)/$$sf".tmp ; \
437         done
438
439 endif
440
441 glib-2.0.lib: libglib-2.0.la glib.def
442         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(builddir)/glib.def -out:$@
443
444 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/glib.vcproj ../build/win32/vs10/glib.vcxproj ../build/win32/vs10/glib.vcxproj.filters
445         files='$(BUILT_EXTRA_DIST)'; \
446         for f in $$files; do \
447           if test -f $$f; then d=.; else d=$(srcdir); fi; \
448           cp $$d/$$f $(distdir) || exit 1; done
449
450 ../build/win32/vs9/glib.vcproj: $(top_srcdir)/build/win32/vs9/glib.vcprojin
451         for F in `echo $(libglib_2_0_la_SOURCES) | tr '/' '\\'`; do \
452                 case $$F in \
453                 *-unix.c|gthread-*.c) \
454                         ;; \
455                 *.c)    echo '   <File RelativePath="..\..\..\glib\'$$F'" />' \
456                         ;; \
457                 esac; \
458         done >libglib.sourcefiles
459         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/glib.vcprojin >$@
460         rm libglib.sourcefiles
461
462 ../build/win32/vs10/glib.vcxproj: $(top_srcdir)/build/win32/vs10/glib.vcxprojin
463         for F in `echo $(libglib_2_0_la_SOURCES) | tr '/' '\\'`; do \
464                 case $$F in \
465                 *-unix.c|gthread-*.c) \
466                         ;; \
467                 *.c) echo '    <ClCompile Include="..\..\..\glib\'$$F'" />' \
468                      ;; \
469                 esac; \
470         done >libglib.vs10.sourcefiles
471         $(CPP) -P - <$(top_srcdir)/build/win32/vs10/glib.vcxprojin >$@
472         rm libglib.vs10.sourcefiles
473
474 ../build/win32/vs10/glib.vcxproj.filters: $(top_srcdir)/build/win32/vs10/glib.vcxproj.filtersin
475         for F in `echo $(libglib_2_0_la_SOURCES) | tr '/' '\\'`; do \
476                 case $$F in \
477                 *-unix.c|gthread-*.c) \
478                         ;; \
479                 *.c) echo '    <ClCompile Include="..\..\..\glib\'$$F'"><Filter>Source Files</Filter></ClCompile>' \
480                      ;; \
481                 esac; \
482         done >libglib.vs10.sourcefiles.filters
483         $(CPP) -P - <$(top_srcdir)/build/win32/vs10/glib.vcxproj.filtersin >$@  
484         rm libglib.vs10.sourcefiles.filters
485
486 # install gdb scripts
487 gdbdir = $(datadir)/glib-2.0/gdb
488 dist_gdb_SCRIPTS = glib.py
489
490 libglib-gdb.py: libglib-gdb.py.in
491         $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libglib-gdb.py.in > $(builddir)/libglib-gdb.py
492
493
494 install-data-hook: libglib-gdb.py
495         mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)
496         $(INSTALL) $(builddir)/libglib-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py
497 if HAVE_GLIB_RUNTIME_LIBDIR
498         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
499         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
500         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
501         rm -f $(DESTDIR)$(libdir)/libglib-2.0.so
502         ln -s $(GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libglib-2.0.so
503 endif
504
505 uninstall-gdb:
506         -rm -r $(DESTDIR)$(datadir)/gdb