Home | History | Annotate | Line # | Download | only in libsupc++
      1 #	$NetBSD: Makefile.common,v 1.13 2025/10/20 14:31:38 nat Exp $
      2 
      3 DIST=		${GCCDIST}
      4 GNUHOSTDIST=	${DIST}
      5 
      6 GCC_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)
     10 LIBSTDCXX_MACHINE_ARCH=${MLIBDIR}
     11 .else
     12 LIBSTDCXX_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.
     19 BUILD_CPP98_SOURCES=	${G_CPP98_SOURCES:Ncodecvt.cc} \
     20 			c98-codecvt.cc
     21 BUILD_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
     27 BUILD_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
     31 BUILD_CPP20_SOURCES=	${G_CPP20_SOURCES:Nsstream-inst.cc} \
     32 			c20-sstream-inst.cc
     33 
     34 LIBSTDCXXSRCS=	${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 
     42 LIBSUPCXXSRCS=	${G_LIBSUPCXX_SOURCES} ${G_LIBSUPCXX_C_SOURCES}
     43 
     44 CPPFLAGS+=	-I${DIST}/gcc
     45 CPPFLAGS+=	-I${DIST}/include
     46 CPPFLAGS+=	-I${DIST}/libstdc++-v3/libsupc++
     47 CPPFLAGS+=	-I${DIST}/libgcc
     48 CPPFLAGS+=	-I${.CURDIR}/../libstdc++-v3/arch/${LIBSTDCXX_MACHINE_ARCH} -I.
     49 CPPFLAGS+=	-DHAVE_STDLIB_H -DHAVE_STRING_H
     50 
     51 CPPFLAGS.cp-demangle.c=-DIN_GLIBCPP_V3
     52 
     53 .for _f in ${BUILD_CPP98_SOURCES}
     54 COPTS.${_f}+=	-std=gnu++98
     55 .endfor
     56 
     57 STD_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} 
     70 COPTS.${_f}+=	-std=gnu++11
     71 .endfor
     72 
     73 STD_GNU14=	\
     74 		del_ops.cc \
     75 		del_opvs.cc
     76 
     77 .for _f in ${STD_GNU14} ${G_FILESYSTEM_SOURCES:M*.cc}
     78 COPTS.${_f}+=	-std=gnu++17  -Wno-sized-deallocation
     79 .endfor
     80 
     81 STD_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}
     94 COPTS.${_f}+=	-std=gnu++1z
     95 .endfor
     96 
     97 .for _f in ${BUILD_CPP17_SOURCES}
     98 COPTS.${_f}+=	-std=gnu++17 -fimplicit-templates
     99 .endfor
    100 
    101 .for _f in ${BUILD_CPP20_SOURCES}
    102 COPTS.${_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 
    109 bits/largefile-config.h:
    110 	mkdir -p bits
    111 	touch bits/largefile-config.h
    112 
    113 CLEANFILES+=	bits/largefile-config.h
    114