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