db14db2a380f2a36b5c90746502de9604e492b77
[platform/upstream/elfutils.git] / libdwfl / Makefile.am
1 ## Makefile.am for libdwfl library subdirectory in elfutils.
2 ##
3 ## Process this file with automake to create Makefile.in
4 ##
5 ## Copyright (C) 2005, 2006, 2007, 2008 Red Hat, Inc.
6 ## This file is part of Red Hat elfutils.
7 ##
8 ## Red Hat elfutils is free software; you can redistribute it and/or modify
9 ## it under the terms of the GNU General Public License as published by the
10 ## Free Software Foundation; version 2 of the License.
11 ##
12 ## Red Hat elfutils is distributed in the hope that it will be useful, but
13 ## WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 ## General Public License for more details.
16 ##
17 ## You should have received a copy of the GNU General Public License along
18 ## with Red Hat elfutils; if not, write to the Free Software Foundation,
19 ## Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
20 ##
21 ## Red Hat elfutils is an included package of the Open Invention Network.
22 ## An included package of the Open Invention Network is a package for which
23 ## Open Invention Network licensees cross-license their patents.  No patent
24 ## license is granted, either expressly or impliedly, by designation as an
25 ## included package.  Should you wish to participate in the Open Invention
26 ## Network licensing program, please visit www.openinventionnetwork.com
27 ## <http://www.openinventionnetwork.com>.
28 ##
29 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H
30 if MUDFLAP
31 AM_CFLAGS = -fmudflap
32 else
33 AM_CFLAGS =
34 endif
35 AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99
36 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
37            -I$(srcdir)/../libdw -I.. -I$(srcdir)/../lib
38 VERSION = 1
39
40 COMPILE.os = $(filter-out -fprofile-arcs, $(filter-out -ftest-coverage, \
41                                                        $(COMPILE)))
42
43 noinst_LIBRARIES = libdwfl.a
44 if !MUDFLAP
45 noinst_LIBRARIES += libdwfl_pic.a
46 endif
47
48 pkginclude_HEADERS = libdwfl.h
49
50 libdwfl_a_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \
51                     dwfl_module.c dwfl_report_elf.c relocate.c \
52                     dwfl_module_build_id.c dwfl_module_report_build_id.c \
53                     derelocate.c offline.c segment.c \
54                     dwfl_module_info.c  dwfl_getmodules.c \
55                     dwfl_module_getdwarf.c dwfl_getdwarf.c \
56                     dwfl_validate_address.c \
57                     argp-std.c find-debuginfo.c \
58                     dwfl_build_id_find_elf.c \
59                     dwfl_build_id_find_debuginfo.c \
60                     linux-kernel-modules.c linux-proc-maps.c \
61                     dwfl_addrmodule.c dwfl_addrdwarf.c \
62                     cu.c dwfl_module_nextcu.c dwfl_nextcu.c dwfl_cumodule.c \
63                     dwfl_module_addrdie.c dwfl_addrdie.c \
64                     lines.c dwfl_lineinfo.c dwfl_line_comp_dir.c \
65                     dwfl_linemodule.c dwfl_linecu.c \
66                     dwfl_getsrclines.c dwfl_onesrcline.c \
67                     dwfl_module_getsrc.c dwfl_getsrc.c \
68                     dwfl_module_getsrc_file.c \
69                     libdwfl_crc32.c libdwfl_crc32_file.c \
70                     elf-from-memory.c \
71                     dwfl_module_getsym.c \
72                     dwfl_module_addrname.c dwfl_module_addrsym.c \
73                     dwfl_module_return_value_location.c \
74                     dwfl_module_register_names.c \
75                     dwfl_segment_report_module.c \
76                     link_map.c core-file.c
77
78
79 if MUDFLAP
80 libdwfl = libdwfl.a $(libdw) $(libebl) $(libelf) $(libeu)
81 libdw = ../libdw/libdw.a
82 libelf = ../libelf/libelf.a
83 libmudflap = -lmudflap
84 else
85 libdwfl = $(libdw)
86 libdw = ../libdw/libdw.so
87 libelf = ../libelf/libelf.so
88 endif
89 libebl = ../libebl/libebl.a
90 libeu = ../lib/libeu.a
91
92
93 if !MUDFLAP
94 libdwfl_pic_a_SOURCES =
95 am_libdwfl_pic_a_OBJECTS = $(libdwfl_a_SOURCES:.c=.os)
96
97 %.os: %.c %.o
98         if $(COMPILE.os) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \
99            -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \
100         then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
101              rm -f "$(DEPDIR)/$*.Tpo"; \
102         else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
103         fi
104 endif
105
106 noinst_HEADERS = libdwflP.h
107
108 CLEANFILES = $(am_libdwfl_pic_a_OBJECTS)