1 # $NetBSD: Makefile,v 1.19.4.1 2019/06/10 21:55:37 christos Exp $ 2 3 .include <bsd.init.mk> 4 5 .include "${.CURDIR}/../../arch/${GCC_MACHINE_ARCH}/defs.mk" 6 7 .cc: # disable .cc->NULL transform 8 9 GNUHOSTDIST= ${DIST} 10 11 GTHRINCS= gthr.h gthr-single.h gthr-posix.h 12 13 BUILDINCS= basic_file.h c++allocator.h c++io.h c++locale.h 14 BUILDINCS+= messages_members.h time_members.h opt_random.h 15 BUILDINCS+= ${GTHRINCS} 16 17 INCS= ${G_bits_headers} ${G_c_base_headers_extra} ${G_host_headers} 18 INCS+= ${BUILDINCS} 19 20 # libsupc++ 21 # XXX use bits_sup_headers from libstdc++/include/Makefile.am 22 INCS+= atomic_lockfree_defines.h \ 23 cxxabi_forced.h \ 24 cxxabi_init_exception.h \ 25 exception.h \ 26 exception_defines.h \ 27 exception_ptr.h \ 28 hash_bytes.h \ 29 nested_exception.h 30 31 # Build the gthr*.h files 32 gthr.h: ${DIST}/libgcc/gthr.h Makefile 33 ${TOOL_SED} \ 34 -e '/^#pragma/b' \ 35 -e '/^#/s/\([A-Z_][A-Z_]*\)/_GLIBCXX_\1/g' \ 36 -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \ 37 -e 's/_GLIBCXX___MINGW32_GLIBCXX___/__MINGW32__/g' \ 38 -e 's,^#include "\(.*\)",#include <bits/\1>,g' \ 39 < ${DIST}/libgcc/gthr.h > ${.TARGET}.tmp && mv ${.TARGET}.tmp ${.TARGET} 40 41 gthr-single.h: ${DIST}/libgcc/gthr-single.h Makefile 42 ${TOOL_SED} \ 43 -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \ 44 -e 's/\(GCC[A-Z_]*_H\)/_GLIBCXX_\1/g' \ 45 < ${DIST}/libgcc/gthr-single.h > ${.TARGET}.tmp && mv ${.TARGET}.tmp ${.TARGET} 46 47 gthr-posix.h: ${DIST}/libgcc/gthr-posix.h Makefile 48 ${TOOL_SED} \ 49 -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \ 50 -e 's/\(GCC[A-Z_]*_H\)/_GLIBCXX_\1/g' \ 51 -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \ 52 -e 's/\([A-Z_]*USE_WEAK\)/_GLIBCXX_\1/g' \ 53 < ${DIST}/libgcc/gthr-posix.h > ${.TARGET}.tmp && mv ${.TARGET}.tmp ${.TARGET} 54 55 .for _f in ${GTHRINCS} 56 CLEANFILES+= ${.TARGET} ${.TARGET}.tmp 57 .endfor 58 59 .if ${MKCOMPAT} != no && !empty(MACHINE_ARCH:M*64*) 60 SUBDIR+= arch 61 .else 62 INCS+= c++config.h 63 .endif 64 65 INCSDIR= /usr/include/g++/bits 66 67 INCSYMLINKS+= gthr-posix.h ${INCSDIR}/gthr-default.h 68 69 .include "${.CURDIR}/../Makefile.includes" 70 71 CLEANFILES+= ${BUILDINCS} 72 73 CXXDIST= ${DIST}/libstdc++-v3 74 COPYHEADERS= \ 75 opt_random.h ${CXXDIST}/${G_CPU_OPT_BITS_RANDOM} \ 76 basic_file.h ${CXXDIST}/${G_BASIC_FILE_H} \ 77 c++allocator.h ${CXXDIST}/${G_ALLOCATOR_H} \ 78 c++locale.h ${CXXDIST}/${G_CLOCALE_H} \ 79 c++io.h ${CXXDIST}/${G_CSTDIO_H} \ 80 messages_members.h ${CXXDIST}/${G_CMESSAGES_H} \ 81 time_members.h ${CXXDIST}/${G_CTIME_H} 82 83 .for _h _s in ${COPYHEADERS} 84 ${_h}: ${_s} 85 cp -pf ${.ALLSRC} ${.TARGET} 86 .endfor 87 88 # Get default targets including <bsd.inc.mk>. 89 .include <bsd.prog.mk> 90 91 .PATH: ${.CURDIR}/../../arch/${GCC_MACHINE_ARCH} \ 92 ${DIST}/libstdc++-v3/include \ 93 ${DIST}/libstdc++-v3/config \ 94 ${DIST}/libstdc++-v3/ \ 95 ${DIST}/libstdc++-v3/libsupc++ 96 97 .include <bsd.subdir.mk> 98