]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/src/experimental/Makefile.am
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / src / experimental / Makefile.am
1 ## Makefile for experimental additions to the GNU C++ Standard library.
2 ##
3 ## Copyright (C) 2014-2023 Free Software Foundation, Inc.
4 ##
5 ## Process this file with automake to produce Makefile.in.
6 ##
7 ## This file is part of GCC.
8 ##
9 ## GCC is free software; you can redistribute it and/or modify
10 ## it under the terms of the GNU General Public License as published by
11 ## the Free Software Foundation; either version 3, or (at your option)
12 ## any later version.
13 ##
14 ## GCC is distributed in the hope that it will be useful,
15 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ## GNU General Public License for more details.
18 ##
19 ## You should have received a copy of the GNU General Public License
20 ## along with GCC; see the file COPYING3. If not see
21 ## <http://www.gnu.org/licenses/>.
22
23 include $(top_srcdir)/fragment.am
24
25 toolexeclib_LTLIBRARIES = libstdc++exp.la
26
27 headers =
28
29 sources = \
30 contract.cc
31
32 # vpath % $(top_srcdir)/src/experimental
33
34 libstdc__exp_la_SOURCES = $(sources)
35
36 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
37 # modified in a per-library or per-sub-library way. Need to manually
38 # set this option because CONFIG_CXXFLAGS has to be after
39 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
40 # as the occasion calls for it.
41 AM_CXXFLAGS = \
42 -std=gnu++17 -nostdinc++ \
43 $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
44 $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
45 $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) \
46 -fimplicit-templates
47
48 AM_MAKEFLAGS = \
49 "gxx_include_dir=$(gxx_include_dir)"
50
51 # Libtool notes
52
53 # 1) In general, libtool expects an argument such as `--tag=CXX' when
54 # using the C++ compiler, because that will enable the settings
55 # detected when C++ support was being configured. However, when no
56 # such flag is given in the command line, libtool attempts to figure
57 # it out by matching the compiler name in each configuration section
58 # against a prefix of the command line. The problem is that, if the
59 # compiler name and its initial flags stored in the libtool
60 # configuration file don't match those in the command line, libtool
61 # can't decide which configuration to use, and it gives up. The
62 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
63 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
64 # attempt to infer which configuration to use.
65 #
66 # The second tag argument, `--tag disable-shared` means that libtool
67 # only compiles each source once, for static objects. In actuality,
68 # glibcxx_lt_pic_flag and glibcxx_compiler_shared_flag are added to
69 # the libtool command that is used create the object, which is
70 # suitable for shared libraries. The `--tag disable-shared` must be
71 # placed after --tag CXX lest things CXX undo the affect of
72 # disable-shared.
73
74 # 2) Need to explicitly set LTCXXCOMPILE so that EXTRA_CXX_FLAGS is
75 # last. (That way, things like -O2 passed down from the toplevel can
76 # be overridden by --enable-debug.)
77 LTCXXCOMPILE = \
78 $(LIBTOOL) --tag CXX --tag disable-shared \
79 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
80 --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \
81 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(EXTRA_CXX_FLAGS)
82
83 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
84
85 # 3) We'd have a problem when building the shared libstdc++ object if
86 # the rules automake generates would be used. We cannot allow g++ to
87 # be used since this would add -lstdc++ to the link line which of
88 # course is problematic at this point. So, we get the top-level
89 # directory to configure libstdc++-v3 to use gcc as the C++
90 # compilation driver.
91 CXXLINK = \
92 $(LIBTOOL) --tag CXX --tag disable-shared \
93 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
94 --mode=link $(CXX) \
95 $(VTV_CXXLINKFLAGS) \
96 $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@