Update.
[platform/upstream/glibc.git] / debug / Makefile
1 # Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
3
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, write to the Free
16 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 # 02111-1307 USA.
18
19 #
20 #       Sub-makefile for debug portion of the library.
21 #
22 subdir  := debug
23
24 headers := execinfo.h
25 distribute = sigcontextinfo.h register-dump.h frame.h
26
27 routines := backtrace backtracesyms backtracesymsfd noophooks
28
29 CFLAGS-backtrace.c = -fno-omit-frame-pointer
30
31 tests = backtrace-tst
32
33 extra-libs = libSegFault libpcprofile
34 extra-libs-others = $(extra-libs)
35
36 libSegFault-routines = segfault
37 libSegFault-inhibit-o = $(filter-out .os,$(object-suffixes))
38
39 libpcprofile-routines = pcprofile
40 libpcprofile-inhibit-o = $(filter-out .os,$(object-suffixes))
41
42 others = pcprofiledump
43 install-bin = pcprofiledump
44 install-bin-script = xtrace
45
46 include ../Makeconfig
47
48 distribute += catchsegv.sh xtrace.sh
49 ifeq ($(elf),yes)
50 ifeq ($(build-shared),yes)
51 install-bin-script += catchsegv
52 endif
53 endif
54 generated = catchsegv xtrace
55
56 include ../Rules
57
58 $(objpfx)catchsegv: catchsegv.sh $(common-objpfx)soversions.mk \
59                     $(common-objpfx)config.make
60         sed -e 's|@VERSION@|$(version)|' -e 's|@SLIB@|$(slibdir)|' $< > $@.new
61         chmod 555 $@.new
62         mv -f $@.new $@
63
64 $(objpfx)pcprofiledump: $(objpfx)pcprofiledump.o
65
66 $(objpfx)xtrace: xtrace.sh
67         rm -f $@.new
68         sed -e 's|@BASH@|$(BASH)|' -e 's|@VERSION@|$(version)|' \
69             -e 's|@SLIBDIR@|$(slibdir)|' -e 's|@BINDIR@|$(bindir)|' $^ > $@.new \
70         && rm -f $@ && mv $@.new $@ && chmod +x $@
71
72 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
73 # This ensures they will load libc.so for needed symbols if loaded by
74 # a statically-linked program that hasn't already loaded it.
75 $(objpfx)libSegFault.so: $(common-objpfx)libc.so \
76                          $(common-objpfx)libc_nonshared.a \
77                          $(elf-objpfx)$(rtld-installed-name)
78 $(objpfx)libpcprofile.so: $(common-objpfx)libc.so \
79                           $(common-objpfx)libc_nonshared.a \
80                           $(elf-objpfx)$(rtld-installed-name)