]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/src/libbacktrace/Makefile.am
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / src / libbacktrace / Makefile.am
1 # Makefile.am -- Backtrace in libstdc++ Makefile.
2 # Copyright (C) 2012-2024 Free Software Foundation, Inc.
3
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
6 # met:
7
8 # (1) Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10
11 # (2) Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in
13 # the documentation and/or other materials provided with the
14 # distribution.
15
16 # (3) The name of the author may not be used to
17 # endorse or promote products derived from this software without
18 # specific prior written permission.
19
20 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 # DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
24 # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28 # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29 # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 # POSSIBILITY OF SUCH DAMAGE.
31
32 include $(top_srcdir)/fragment.am
33
34 # Convenience library for C++23 runtime.
35 noinst_LTLIBRARIES = libstdc++_libbacktrace.la
36
37 ACLOCAL_AMFLAGS = -I ../.. -I ../../config
38
39 # This will be used instead of the common AM_CPPFLAGS from fragment.am
40 libstdc___libbacktrace_la_CPPFLAGS = \
41 -I $(top_srcdir)/../include -I $(top_srcdir)/../libgcc \
42 -I ../../../libgcc -I .. -I $(top_srcdir) \
43 -I $(top_srcdir)/../libbacktrace \
44 -I $(top_srcdir)/../libiberty \
45 -include $(top_srcdir)/src/libbacktrace/backtrace-rename.h \
46 $(BACKTRACE_CPPFLAGS)
47
48 WARN_FLAGS = -W -Wall -Wwrite-strings -Wmissing-format-attribute \
49 -Wcast-qual
50 C_WARN_FLAGS = $(WARN_FLAGS) -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wno-unused-but-set-variable
51 CXX_WARN_FLAGS = $(WARN_FLAGS) -Wno-unused-parameter
52 AM_CFLAGS = \
53 $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
54 $(C_WARN_FLAGS)
55 AM_CFLAGS += $(EXTRA_CFLAGS)
56 AM_CXXFLAGS = \
57 $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
58 $(CXX_WARN_FLAGS) -fno-rtti -fno-exceptions
59 AM_CXXFLAGS += $(EXTRA_CXXFLAGS)
60
61 obj_prefix = std_stacktrace
62
63 # Each FILE.c in SOURCES will be compiled to SHORTNAME-FILE.o
64 libstdc___libbacktrace_la_SHORTNAME = $(obj_prefix)
65
66 libstdc___libbacktrace_la_SOURCES = \
67 atomic.c \
68 backtrace.c \
69 dwarf.c \
70 fileline.c \
71 posix.c \
72 sort.c \
73 simple.c \
74 state.c \
75 cp-demangle.c
76
77 FORMAT_FILES = \
78 elf.c \
79 pecoff.c \
80 unknown.c
81
82 VIEW_FILES = \
83 read.c \
84 mmapio.c
85
86 ALLOC_FILES = \
87 alloc.c \
88 mmap.c
89
90 EXTRA_libstdc___libbacktrace_la_SOURCES = \
91 $(FORMAT_FILES) \
92 $(VIEW_FILES) \
93 $(ALLOC_FILES)
94
95 # These three files are chosen by configure and added to the link.
96 # We need the SHORTNAME- prefix so that they use the custom CPPFLAGS above.
97 libstdc___libbacktrace_la_LIBADD = \
98 $(obj_prefix)-$(FORMAT_FILE) \
99 $(obj_prefix)-$(VIEW_FILE) \
100 $(obj_prefix)-$(ALLOC_FILE)
101
102 libstdc___libbacktrace_la_DEPENDENCIES = $(libstdc___libbacktrace_la_LIBADD)
103
104 # Use symlinks for the sources
105
106 %.c: ../../../libbacktrace/%.c
107 $(LN_S) $< $@
108
109 cp-demangle.c: ../../../libiberty/cp-demangle.c
110 $(LN_S) $< $@
111
112 LTCOMPILE = \
113 $(LIBTOOL) --tag CC --tag disable-shared \
114 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
115 --mode=compile $(CC) $(TOPLEVEL_INCLUDES) \
116 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
117
118 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
119
120 LINK = \
121 $(LIBTOOL) --tag CC --tag disable-shared \
122 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
123 --mode=link $(CC) \
124 $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CFLAGS) $(LTLDFLAGS) -o $@