xref: /netbsd-src/external/gpl3/gcc.old/lib/libsupc++/Makefile.common (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
1#	$NetBSD: Makefile.common,v 1.11 2023/02/20 02:12:28 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} \
22			c11-codecvt.cc \
23			c11-cow-string-inst.cc \
24			c11-ostream-inst.cc \
25			c11-string-inst.cc
26BUILD_CPP17_SOURCES=	${G_CPP17_SOURCES:Ncow-string-inst.cc:Nostream-inst.cc:Nstring-inst.cc} \
27			c17-cow-string-inst.cc \
28			c17-ostream-inst.cc \
29			c17-string-inst.cc
30
31LIBSTDCXXSRCS=	${G_SRC_SOURCES} \
32		${BUILD_CPP98_SOURCES} \
33		${BUILD_CPP11_SOURCES} \
34		${BUILD_CPP17_SOURCES}
35# XXX XXX dir.o doesn't have <deque> stuff properly, leave it out for now
36#LIBSTDCXXSRCS+=	${G_FILESYSTEM_SOURCES}
37
38LIBSUPCXXSRCS=	${G_LIBSUPCXX_SOURCES} ${G_LIBSUPCXX_C_SOURCES}
39
40CPPFLAGS+=	-I${DIST}/gcc
41CPPFLAGS+=	-I${DIST}/include
42CPPFLAGS+=	-I${DIST}/libstdc++-v3/libsupc++
43CPPFLAGS+=	-I${DIST}/libgcc
44CPPFLAGS+=	-I${.CURDIR}/../libstdc++-v3/arch/${LIBSTDCXX_MACHINE_ARCH} -I.
45CPPFLAGS+=	-DHAVE_STDLIB_H -DHAVE_STRING_H
46
47CPPFLAGS.cp-demangle.c=-DIN_GLIBCPP_V3
48
49.for _f in ${BUILD_CPP98_SOURCES}
50COPTS.${_f}+=	-std=gnu++98
51.endfor
52
53STD_GNU11=	\
54		eh_aux_runtime.cc \
55		eh_ptr.cc \
56		eh_terminate.cc \
57		eh_throw.cc \
58		guard.cc \
59		atexit_thread.cc \
60		nested_exception.cc \
61		new_handler.cc \
62		new_op.cc \
63		new_opnt.cc
64
65.for _f in ${STD_GNU11} ${BUILD_CPP11_SOURCES:M*.cc}
66COPTS.${_f}+=	-std=gnu++11
67.endfor
68
69STD_GNU14=	\
70		del_ops.cc \
71		del_opvs.cc
72
73.for _f in ${STD_GNU14} ${G_FILESYSTEM_SOURCES:M*.cc}
74COPTS.${_f}+=	-std=gnu++17  -Wno-sized-deallocation
75.endfor
76
77STD_GNU1Z=	\
78		new_opa.cc \
79		new_opant.cc \
80		new_opva.cc \
81		new_opvant.cc \
82		del_opa.cc \
83		del_opant.cc \
84		del_opsa.cc \
85		del_opva.cc \
86		del_opvant.cc \
87		del_opvsa.cc
88
89.for _f in ${STD_GNU1Z}
90COPTS.${_f}+=	-std=gnu++1z
91.endfor
92
93.for _f in ${BUILD_CPP17_SOURCES}
94COPTS.${_f}+=	-std=gnu++17 -fimplicit-templates
95.endfor
96
97.for _f in dir ops fs_dir fs_ops cow-fs_dir cow-fs_ops
98${_f}.o ${_f}.d ${_f}.pico ${_f}.po: bits/largefile-config.h
99.endfor
100
101bits/largefile-config.h:
102	mkdir -p bits
103	touch bits/largefile-config.h
104
105CLEANFILES+=	bits/largefile-config.h
106