]>
Commit | Line | Data |
---|---|---|
dfaa3c47 JW |
1 | ## Makefile for the C++17 sources of the GNU C++ Standard library. |
2 | ## | |
83ffe9cd | 3 | ## Copyright (C) 1997-2023 Free Software Foundation, Inc. |
dfaa3c47 JW |
4 | ## |
5 | ## This file is part of the libstdc++ version 3 distribution. | |
6 | ## Process this file with automake to produce Makefile.in. | |
7 | ||
8 | ## This file is part of the GNU ISO C++ Library. This library is free | |
9 | ## software; you can redistribute it and/or modify it under the | |
10 | ## terms of the GNU General Public License as published by the | |
11 | ## Free Software Foundation; either version 3, or (at your option) | |
12 | ## any later version. | |
13 | ||
14 | ## This library 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 along | |
20 | ## with this library; see the file COPYING3. If not see | |
21 | ## <http://www.gnu.org/licenses/>. | |
22 | ||
23 | include $(top_srcdir)/fragment.am | |
24 | ||
25 | # Convenience library for C++17 runtime. | |
26 | noinst_LTLIBRARIES = libc++17convenience.la | |
27 | ||
28 | headers = | |
29 | ||
dfaa3c47 | 30 | if ENABLE_DUAL_ABI |
1a289fa3 | 31 | extra_string_inst_sources = cow-string-inst.cc |
de4db54f JW |
32 | extra_fs_sources = \ |
33 | cow-fs_dir.cc \ | |
34 | cow-fs_ops.cc \ | |
35 | cow-fs_path.cc | |
dfaa3c47 JW |
36 | else |
37 | extra_string_inst_sources = | |
2b522535 | 38 | extra_fs_sources = |
dfaa3c47 JW |
39 | endif |
40 | ||
41 | if ENABLE_EXTERN_TEMPLATE | |
42 | # XTEMPLATE_FLAGS = -fno-implicit-templates | |
43 | inst_sources = \ | |
c3799b16 VV |
44 | ostream-inst.cc \ |
45 | string-inst.cc \ | |
dfaa3c47 JW |
46 | $(extra_string_inst_sources) |
47 | else | |
48 | # XTEMPLATE_FLAGS = | |
49 | inst_sources = | |
50 | endif | |
51 | ||
2b522535 | 52 | sources = \ |
932fbc86 | 53 | floating_from_chars.cc \ |
3c57e692 | 54 | floating_to_chars.cc \ |
de4db54f JW |
55 | fs_dir.cc \ |
56 | fs_ops.cc \ | |
2b522535 JW |
57 | fs_path.cc \ |
58 | memory_resource.cc \ | |
2b522535 JW |
59 | $(extra_fs_sources) |
60 | ||
dfaa3c47 JW |
61 | vpath % $(top_srcdir)/src/c++17 |
62 | ||
63 | libc__17convenience_la_SOURCES = $(sources) $(inst_sources) | |
64 | ||
7c1e7eed JW |
65 | if GLIBCXX_LDBL_ALT128_COMPAT |
66 | floating_from_chars.lo: floating_from_chars.cc | |
67 | $(LTCXXCOMPILE) -mabi=ibmlongdouble $(LONG_DOUBLE_128_FLAGS) -c $< | |
68 | floating_from_chars.o: floating_from_chars.cc | |
69 | $(CXXCOMPILE) -mabi=ibmlongdouble $(LONG_DOUBLE_128_FLAGS) -c $< | |
f90027d1 JW |
70 | floating_to_chars.lo: floating_to_chars.cc |
71 | $(LTCXXCOMPILE) -mabi=ibmlongdouble $(LONG_DOUBLE_128_FLAGS) -c $< | |
72 | floating_to_chars.o: floating_to_chars.cc | |
73 | $(CXXCOMPILE) -mabi=ibmlongdouble $(LONG_DOUBLE_128_FLAGS) -c $< | |
7c1e7eed JW |
74 | endif |
75 | ||
dfaa3c47 JW |
76 | # AM_CXXFLAGS needs to be in each subdirectory so that it can be |
77 | # modified in a per-library or per-sub-library way. Need to manually | |
78 | # set this option because CONFIG_CXXFLAGS has to be after | |
79 | # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden | |
80 | # as the occasion calls for it. | |
81 | AM_CXXFLAGS = \ | |
4fde88e5 | 82 | -std=gnu++17 -nostdinc++ \ |
dfaa3c47 JW |
83 | $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \ |
84 | $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \ | |
2b522535 JW |
85 | $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) \ |
86 | -fimplicit-templates | |
dfaa3c47 JW |
87 | |
88 | AM_MAKEFLAGS = \ | |
89 | "gxx_include_dir=$(gxx_include_dir)" | |
90 | ||
91 | # Libtool notes | |
92 | ||
93 | # 1) In general, libtool expects an argument such as `--tag=CXX' when | |
94 | # using the C++ compiler, because that will enable the settings | |
95 | # detected when C++ support was being configured. However, when no | |
96 | # such flag is given in the command line, libtool attempts to figure | |
97 | # it out by matching the compiler name in each configuration section | |
98 | # against a prefix of the command line. The problem is that, if the | |
99 | # compiler name and its initial flags stored in the libtool | |
100 | # configuration file don't match those in the command line, libtool | |
101 | # can't decide which configuration to use, and it gives up. The | |
102 | # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe | |
103 | # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to | |
104 | # attempt to infer which configuration to use. | |
105 | # | |
106 | # The second tag argument, `--tag disable-shared` means that libtool | |
107 | # only compiles each source once, for static objects. In actuality, | |
108 | # glibcxx_lt_pic_flag and glibcxx_compiler_shared_flag are added to | |
109 | # the libtool command that is used create the object, which is | |
110 | # suitable for shared libraries. The `--tag disable-shared` must be | |
111 | # placed after --tag CXX lest things CXX undo the affect of | |
112 | # disable-shared. | |
113 | ||
114 | # 2) Need to explicitly set LTCXXCOMPILE so that EXTRA_CXX_FLAGS is | |
115 | # last. (That way, things like -O2 passed down from the toplevel can | |
116 | # be overridden by --enable-debug.) | |
117 | LTCXXCOMPILE = \ | |
118 | $(LIBTOOL) --tag CXX --tag disable-shared \ | |
119 | $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | |
120 | --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ | |
121 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(EXTRA_CXX_FLAGS) | |
122 | ||
123 | LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) | |
124 | ||
125 | # 3) We'd have a problem when building the shared libstdc++ object if | |
126 | # the rules automake generates would be used. We cannot allow g++ to | |
127 | # be used since this would add -lstdc++ to the link line which of | |
128 | # course is problematic at this point. So, we get the top-level | |
129 | # directory to configure libstdc++-v3 to use gcc as the C++ | |
130 | # compilation driver. | |
131 | CXXLINK = \ | |
132 | $(LIBTOOL) --tag CXX --tag disable-shared \ | |
133 | $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | |
134 | --mode=link $(CXX) \ | |
135 | $(VTV_CXXLINKFLAGS) \ | |
136 | $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ |