xref: /netbsd-src/external/gpl3/gcc/lib/libsupc++/Makefile.common (revision c985751b7f1455b3aae24c52a7d8549aef2eed9e)
1#	$NetBSD: Makefile.common,v 1.21 2024/02/21 09:06:56 mrg Exp $
2
3DIST=		${GCCDIST}
4GNUHOSTDIST=	${DIST}
5
6GCC_MACHINE_ARCH=${MACHINE_ARCH:S/earmv5/earm/}
7
8# Support src/compat builds
9.if defined(MLIBDIR) && exists(${.CURDIR}/../libstdc++-v3/arch/${MLIBDIR}/defs.mk)
10LIBSTDCXX_MACHINE_ARCH=${MLIBDIR}
11.else
12LIBSTDCXX_MACHINE_ARCH=${GCC_MACHINE_ARCH}
13.endif
14
15# Make sure we get G_*_SOURCES, etc.*, for the .for loops
16.include "${.CURDIR}/../libstdc++-v3/arch/${LIBSTDCXX_MACHINE_ARCH}/defs.mk"
17
18# Deal with renamed sources.  Needs to match a loop in libstdc++-v3/Makefile.
19BUILD_CPP98_SOURCES=	${G_CPP98_SOURCES:Ncodecvt.cc} \
20			c98-codecvt.cc
21BUILD_CPP11_SOURCES=	${G_CPP11_SOURCES:Ncodecvt.cc:Ncow-string-inst.cc:Nostream-inst.cc:Nstring-inst.cc:Nsstream-inst.cc} \
22			c11-codecvt.cc \
23			c11-cow-string-inst.cc \
24			c11-ostream-inst.cc \
25			c11-string-inst.cc \
26			c11-sstream-inst.cc
27BUILD_CPP17_SOURCES=	${G_CPP17_SOURCES:Ncow-string-inst.cc:Nostream-inst.cc:Nstring-inst.cc} \
28			c17-cow-string-inst.cc \
29			c17-ostream-inst.cc \
30			c17-string-inst.cc
31BUILD_CPP20_SOURCES=	${G_CPP20_SOURCES:Nsstream-inst.cc} \
32			c20-sstream-inst.cc
33
34LIBSTDCXXSRCS=	${G_SRC_SOURCES} \
35		${BUILD_CPP98_SOURCES} \
36		${BUILD_CPP11_SOURCES} \
37		${BUILD_CPP17_SOURCES} \
38		${BUILD_CPP20_SOURCES}
39# XXX XXX dir.o doesn't have <deque> stuff properly, leave it out for now
40#LIBSTDCXXSRCS+=	${G_FILESYSTEM_SOURCES}
41
42LIBSUPCXXSRCS=	${G_LIBSUPCXX_SOURCES} ${G_LIBSUPCXX_C_SOURCES}
43
44CPPFLAGS+=	-I${DIST}/gcc
45CPPFLAGS+=	-I${DIST}/include
46CPPFLAGS+=	-I${DIST}/libstdc++-v3/libsupc++
47CPPFLAGS+=	-I${DIST}/libgcc
48CPPFLAGS+=	-I${.CURDIR}/../libstdc++-v3/arch/${LIBSTDCXX_MACHINE_ARCH} -I.
49CPPFLAGS+=	-DHAVE_STDLIB_H -DHAVE_STRING_H
50
51CPPFLAGS.cp-demangle.c=-DIN_GLIBCPP_V3
52
53.for _f in ${BUILD_CPP98_SOURCES}
54COPTS.${_f}+=	-std=gnu++98
55.endfor
56
57STD_GNU11=	\
58		eh_aux_runtime.cc \
59		eh_ptr.cc \
60		eh_terminate.cc \
61		eh_throw.cc \
62		guard.cc \
63		atexit_thread.cc \
64		nested_exception.cc \
65		new_handler.cc \
66		new_op.cc \
67		new_opnt.cc
68
69.for _f in ${STD_GNU11} ${BUILD_CPP11_SOURCES:M*.cc}
70COPTS.${_f}+=	-std=gnu++11
71.endfor
72
73STD_GNU14=	\
74		del_ops.cc \
75		del_opvs.cc
76
77.for _f in ${STD_GNU14} ${G_FILESYSTEM_SOURCES:M*.cc}
78COPTS.${_f}+=	-std=gnu++17  -Wno-sized-deallocation
79.endfor
80
81STD_GNU1Z=	\
82		new_opa.cc \
83		new_opant.cc \
84		new_opva.cc \
85		new_opvant.cc \
86		del_opa.cc \
87		del_opant.cc \
88		del_opsa.cc \
89		del_opva.cc \
90		del_opvant.cc \
91		del_opvsa.cc
92
93.for _f in ${STD_GNU1Z}
94COPTS.${_f}+=	-std=gnu++1z
95.endfor
96
97.for _f in ${BUILD_CPP17_SOURCES}
98COPTS.${_f}+=	-std=gnu++17 -fimplicit-templates
99.endfor
100
101.for _f in ${BUILD_CPP20_SOURCES}
102COPTS.${_f}+=	-std=gnu++20 -fimplicit-templates
103.endfor
104
105.for _f in dir ops fs_dir fs_ops cow-fs_dir cow-fs_ops
106${_f}.o ${_f}.d ${_f}.pico ${_f}.po: bits/largefile-config.h
107.endfor
108
109bits/largefile-config.h:
110	mkdir -p bits
111	touch bits/largefile-config.h
112
113CLEANFILES+=	bits/largefile-config.h
114