Makefile revision 145413
150472Speter# $FreeBSD: head/gnu/lib/libstdc++/Makefile 145413 2005-04-22 18:57:32Z trhodes $ 218666Speter 397433SpeterGCCDIR= ${.CURDIR}/../../../contrib/gcc 497433SpeterSRCDIR= ${.CURDIR}/../../../contrib/libstdc++ 597433SpeterSUPDIR= ${SRCDIR}/libsupc++ 697433Speter 796340Sobrien.PATH: ${SRCDIR}/src ${SRCDIR}/libmath ${SRCDIR}/config/io \ 8132751Skan ${SRCDIR}/config/locale/generic ${SRCDIR}/include \ 997523Sobrien ${SUPDIR} ${GCCDIR} 1018666Speter 1118666SpeterLIB= stdc++ 1296340SobrienSHLIB_MAJOR= 4 1318666Speter 1497433SpeterCFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H 15132751SkanCFLAGS+= -I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include 16140372ScpercivaCFLAGS+= -frandom-seed=RepeatabilityConsideredGood 17132751SkanCXXFLAGS+= -fno-implicit-templates -ffunction-sections -fdata-sections \ 18132751Skan -Wno-deprecated 1918666Speter 20145413StrhodesDPADD= ${LIBM} 21125503SruLDADD= -lm 2240204Speter 23132751Skan# libstdc++ sources 24140860SkanSRCS+= allocator.cc codecvt.cc complex_io.cc ctype.cc debug.cc debug_list.cc \ 25140860Skan functexcept.cc globals_locale.cc globals_io.cc ios.cc ios_failure.cc \ 26140860Skan ios_init.cc ios_locale.cc limits.cc debug_list.cc list.cc locale.cc \ 27140860Skan locale_init.cc locale_facets.cc localename.cc stdexcept.cc \ 28140860Skan strstream.cc tree.cc allocator-inst.cc concept-inst.cc fstream-inst.cc \ 29140860Skan ext-inst.cc io-inst.cc istream-inst.cc locale-inst.cc \ 30140860Skan locale-misc-inst.cc misc-inst.cc ostream-inst.cc sstream-inst.cc \ 31140860Skan streambuf-inst.cc string-inst.cc valarray-inst.cc wlocale-inst.cc \ 32140860Skan wstring-inst.cc 3318666Speter 34117429Skan# target sources 35132751SkanSRCS+= atomicity.cc codecvt_members.cc collate_members.cc ctype_members.cc \ 36117429Skan messages_members.cc monetary_members.cc numeric_members.cc \ 37117429Skan time_members.cc 38117429Skan 39117429Skan# target sources extra 40117429SkanSRCS+= basic_file_stdio.cc c_locale.cc 41117429Skan 4296340Sobrien# C parts of math 43132751SkanSRCS+= signbitf.c signbitl.c stubs.c 4496340Sobrien 4597433Speter# Embedded copy of libsupc++ 46132751SkanSRCS+= del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc eh_alloc.cc \ 47132751Skan eh_aux_runtime.cc eh_catch.cc eh_exception.cc eh_globals.cc \ 48132751Skan eh_personality.cc eh_term_handler.cc eh_terminate.cc eh_throw.cc \ 49132751Skan eh_type.cc eh_unex_handler.cc guard.cc new_handler.cc new_op.cc \ 50132751Skan new_opnt.cc new_opv.cc new_opvnt.cc pure.cc tinfo.cc tinfo2.cc \ 51132751Skan vec.cc vterminate.cc 5296340Sobrien 5397433Speter# from libiberty: 54132751SkanSRCS+= cp-demangle.c 5518666Speter 56132751Skan# MD headers location 57132751Skan.if ${MACHINE_ARCH} == "sparc64" 58132751SkanMARCHDIR= sparc 59132751Skan.elif ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU} != 'i386' 60132751SkanMARCHDIR= i486 61132751Skan.elif ${MACHINE_ARCH} == "amd64" 62132751SkanMARCHDIR= i486 63132751Skan.else 64132751SkanMARCHDIR= ${MACHINE_ARCH} 65132751Skan.endif 6618666Speter 67132751SkanATOMICITY_H= atomicity.h 68132751Skan.if exists(${SRCDIR}/config/cpu/${MARCHDIR}/atomicity.h) 69132751SkanATOMICITY_H= ${SRCDIR}/config/cpu/${MARCHDIR}/atomicity.h 70132751Skan.else 71132751SkanATOMICITY_H= ${SRCDIR}/config/cpu/generic/atomicity.h 72132751Skan.endif 7318666Speter 74132751Skanatomicity.cc: ${ATOMICITY_H} 75132751Skan ln -sf ${.ALLSRC} ${.TARGET} 76134596SruCLEANFILES+= atomicity.cc 77132751Skan 7897657SruINCSGROUPS= BITSHDRS BKWHDRS EXTHDRS BASEHDRS BASEXHDRS STDHDRS \ 79132751Skan TARGETHDRS THRHDRS DEBUGHDRS 80132751SkanCXXINCLUDEDIR= ${INCLUDEDIR}/c++/3.4 8118666Speter 82132751SkanSTDHDRS= std_algorithm.h std_bitset.h std_complex.h std_deque.h \ 83132751Skan std_fstream.h std_functional.h std_iomanip.h std_ios.h \ 84132751Skan std_iosfwd.h std_iostream.h std_istream.h std_iterator.h \ 85132751Skan std_limits.h std_list.h std_locale.h std_map.h std_memory.h \ 86132751Skan std_numeric.h std_ostream.h std_queue.h std_set.h \ 87132751Skan std_sstream.h std_stack.h std_stdexcept.h std_streambuf.h \ 88132751Skan std_string.h std_utility.h std_valarray.h std_vector.h 89132751Skan.for h in ${STDHDRS} 90132751SkanSTDHDRSNAME_$h=${h:R:S;^std_;;} 91132751Skan.endfor 92132751SkanSTDHDRS:= ${STDHDRS:S;^;${SRCDIR}/include/std/;} 93132751SkanSTDHDRSDIR= ${CXXINCLUDEDIR} 94132751Skan 95132751SkanBITSHDRS= allocator.h atomicity.h basic_ios.h basic_ios.tcc \ 96132751Skan basic_string.h basic_string.tcc boost_concept_check.h \ 97132751Skan char_traits.h codecvt.h concept_check.h concurrence.h \ 98132751Skan cpp_type_traits.h deque.tcc fstream.tcc functexcept.h \ 99132751Skan gslice.h gslice_array.h indirect_array.h ios_base.h \ 100132751Skan istream.tcc list.tcc locale_classes.h locale_facets.h \ 101132751Skan locale_facets.tcc localefwd.h mask_array.h ostream.tcc \ 102132751Skan postypes.h stream_iterator.h streambuf_iterator.h \ 103124153Skan slice_array.h sstream.tcc stl_algo.h stl_algobase.h \ 104132751Skan stl_bvector.h stl_construct.h stl_deque.h stl_function.h \ 105132751Skan stl_heap.h stl_iterator.h stl_iterator_base_funcs.h \ 106132751Skan stl_iterator_base_types.h stl_list.h stl_map.h stl_multimap.h \ 107132751Skan stl_multiset.h stl_numeric.h stl_pair.h stl_queue.h \ 10897657Sru stl_raw_storage_iter.h stl_relops.h stl_set.h stl_stack.h \ 10997657Sru stl_tempbuf.h stl_threads.h stl_tree.h stl_uninitialized.h \ 110132751Skan stl_vector.h streambuf.tcc stringfwd.h type_traits.h \ 111132751Skan valarray_array.h valarray_array.tcc valarray_before.h \ 112132751Skan valarray_after.h vector.tcc 11397657SruBITSHDRS:= ${BITSHDRS:S;^;${SRCDIR}/include/bits/;} 114132751SkanBITSHDRSDIR= ${CXXINCLUDEDIR}/bits 11518666Speter 116132751SkanBKWHDRS= complex.h iomanip.h istream.h ostream.h stream.h streambuf.h \ 117132751Skan algo.h algobase.h alloc.h bvector.h defalloc.h deque.h \ 118132751Skan function.h hash_map.h hash_set.h hashtable.h heap.h iostream.h \ 119132751Skan iterator.h list.h map.h multimap.h new.h multiset.h pair.h \ 120132751Skan queue.h rope.h set.h slist.h stack.h tempbuf.h tree.h \ 121132751Skan vector.h fstream.h strstream backward_warning.h 12297657SruBKWHDRS:= ${BKWHDRS:S;^;${SRCDIR}/include/backward/;} 123132751SkanBKWHDRSDIR= ${CXXINCLUDEDIR}/backward 12497657Sru 125132751SkanEXTHDRS= algorithm bitmap_allocator.h debug_allocator.h demangle.h \ 126132751Skan enc_filebuf.h stdio_filebuf.h stdio_sync_filebuf.h functional \ 127132751Skan hash_map hash_set iterator malloc_allocator.h memory \ 128132751Skan mt_allocator.h new_allocator.h numeric pod_char_traits.h \ 129132751Skan pool_allocator.h rb_tree rope ropeimpl.h slist hash_fun.h \ 130132751Skan hashtable.h 13197657SruEXTHDRS:= ${EXTHDRS:S;^;${SRCDIR}/include/ext/;} 132132751SkanEXTHDRSDIR= ${CXXINCLUDEDIR}/ext 13397657Sru 13497657Sru# This is the common subset of files that all three "C" header models use. 13597657SruBASEHDRS= std_cassert.h std_cctype.h std_cerrno.h std_cfloat.h \ 13697657Sru std_ciso646.h std_climits.h std_clocale.h std_cmath.h \ 13797657Sru std_csetjmp.h std_csignal.h std_cstdarg.h std_cstddef.h \ 13897657Sru std_cstdio.h std_cstdlib.h std_cstring.h std_ctime.h \ 13997657Sru std_cwchar.h std_cwctype.h 14097657Sru.for h in ${BASEHDRS} 14197657SruBASEHDRSNAME_$h=${h:R:S;^std_;;} 14297657Sru.endfor 14397657SruBASEHDRS:= ${BASEHDRS:S;^;${SRCDIR}/include/c_std/;} 144132751SkanBASEHDRSDIR= ${CXXINCLUDEDIR} 14597657Sru 14697657Sru# Some of the different "C" header models need extra files. 14797657SruBASEXHDRS= ${SRCDIR}/include/c_std/cmath.tcc 148132751SkanBASEXHDRSDIR= ${CXXINCLUDEDIR}/bits 14997657Sru 150132751SkanDEBUGHDRS= bitset debug.h deque formatter.h hash_map hash_map.h \ 151132751Skan hash_multimap.h hash_multiset.h hash_set hash_set.h list \ 152132751Skan map map.h multimap.h multiset.h safe_base.h safe_iterator.h \ 153132751Skan safe_iterator.tcc safe_sequence.h set set.h string vector 154132751SkanDEBUGHDRS:= ${DEBUGHDRS:S;^;${SRCDIR}/include/debug/;} 155132751SkanDEBUGHDRSDIR= ${CXXINCLUDEDIR}/debug 15697657Sru 157132751SkanTARGETHDRS= allocator/new_allocator_base.h \ 158132751Skan io/basic_file_stdio.h \ 159132751Skan io/c_io_stdio.h \ 16097657Sru locale/generic/c_locale.h \ 161103456Skan locale/generic/c++locale_internal.h \ 16297657Sru locale/generic/messages_members.h \ 163110632Skan locale/generic/time_members.h \ 164132751Skan locale/generic/codecvt_specializations.h \ 165117429Skan os/bsd/freebsd/ctype_base.h \ 166117429Skan os/bsd/freebsd/ctype_inline.h \ 167117429Skan os/bsd/freebsd/ctype_noninline.h \ 168117429Skan os/bsd/freebsd/os_defines.h 16997657SruTARGETHDRS:= ${TARGETHDRS:S;^;${SRCDIR}/config/;} 170132751SkanTARGETHDRS+= c++config.h 17197657SruTARGETHDRSNAME_basic_file_stdio.h= basic_file.h 17297657SruTARGETHDRSNAME_c_io_stdio.h= c++io.h 17397657SruTARGETHDRSNAME_c_locale.h= c++locale.h 174132751SkanTARGETHDRSNAME_new_allocator_base.h= c++allocator.h 175132751SkanTARGETHDRSDIR= ${CXXINCLUDEDIR}/bits 17697657Sru 177132751SkanMARCHHDRS= atomic_word.h 17897657Sru.for h in ${MARCHHDRS} 179117429Skan.if exists(${SRCDIR}/config/cpu/${MARCHDIR}/${h}) 180117429SkanTARGETHDRS+= ${SRCDIR}/config/cpu/${MARCHDIR}/${h} 18197657Sru.else 182124189SkanTARGETHDRS+= ${SRCDIR}/config/cpu/generic/${h} 18397657Sru.endif 18497657Sru.endfor 18597657Sru 18697657SruTHRHDRS= gthr.h gthr-single.h gthr-posix.h gthr-default.h 187132751SkanTHRHDRSDIR= ${CXXINCLUDEDIR}/bits 188132751Skanuppercase = [ABCDEFGHIJKLMNOPQRSTUVWXYZ_] 18997657Sru 19097433Spetergthr.h: ${GCCDIR}/gthr.h 191132751Skan sed -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \ 192132751Skan -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \ 19397433Speter -e 's,^#include "\(.*\)",#include <bits/\1>,g' \ 194132751Skan < ${.ALLSRC} > ${.TARGET} 19518666Speter 19697433Spetergthr-single.h: ${GCCDIR}/gthr-single.h 197132751Skan sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \ 198132751Skan -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \ 199132751Skan < ${.ALLSRC} > ${.TARGET} 20096340Sobrien 20197433Spetergthr-posix.h: ${GCCDIR}/gthr-posix.h 202132751Skan sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \ 203132751Skan -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \ 204132751Skan -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \ 205132751Skan -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \ 206132751Skan < ${.ALLSRC} > ${.TARGET} 20796340Sobrien 20897433Spetergthr-default.h: ${GCCDIR}/gthr-posix.h 209132751Skan sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \ 210132751Skan -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \ 211132751Skan -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \ 212132751Skan -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \ 21397433Speter -e 's,^#include "\(.*\)",#include <bits/\1>,g' \ 214132751Skan < ${.ALLSRC} > ${.TARGET} 21596340Sobrien 21697657SruCLEANFILES+= ${THRHDRS} 21796340Sobrien 218132751Skanc++config.h: ${.CURDIR}/config.h ${SRCDIR}/include/bits/c++config 219132751Skan cat ${SRCDIR}/include/bits/c++config > ${.TARGET} && \ 220132751Skan sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \ 221132751Skan -e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \ 222132751Skan -e 's/VERSION/_GLIBCXX_VERSION/g' \ 223132751Skan -e 's/WORDS_/_GLIBCXX_WORDS_/g' \ 224132751Skan < ${.CURDIR}/config.h >> ${.TARGET} && \ 225132751Skan echo "#endif // _CXXCONFIG_" >> ${.TARGET} 226132751SkanCLEANFILES+= c++config.h 227132751Skan 22818666Speter.include <bsd.lib.mk> 229