1# 2# $Id: Makefile,v 1.9 1998/03/20 15:10:59 bde Exp $ 3# 4 5GPPDIR= ${.CURDIR}/../../../contrib/libg++ 6 7.PATH: ${GPPDIR}/libstdc++ ${GPPDIR}/libstdc++/stl ${GPPDIR}/libio \ 8 ${GPPDIR}/libiberty 9 10LIB= stdc++ 11SHLIB_MAJOR= 2 12SHLIB_MINOR= 0 13 14CFLAGS+= -I${GPPDIR}/include -I${DESTDIR}/usr/include/g++ -I. 15CXXFLAGS+= -I${GPPDIR}/include -I${GPPDIR}/libio -I${GPPDIR}/libstdc++ 16CXXFLAGS+= -fno-implicit-templates 17 18LDADD+= -lm 19DPADD+= ${LIBM} 20 21DIR= ${GPPDIR}/libstdc++ 22 23HDRS= cassert cctype cerrno cfloat ciso646 climits clocale cmath complex \ 24 csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime \ 25 cwchar cwctype new stddef string exception stdexcept typeinfo \ 26 algorithm deque list map queue set stack vector utility functional \ 27 iterator memory numeric \ 28 complex.h new.h stl.h 29 30SHDRS= bastring.cc bastring.h cassert.h cctype.h cerrno.h cfloat.h cinst.h \ 31 ciso646.h climits.h clocale.h cmath.h complex.h complext.cc \ 32 complext.h csetjmp.h csignal.h cstdarg.h cstddef.h cstdio.h \ 33 cstdlib.h cstring.h ctime.h cwchar.h cwctype.h dcomplex.h exception.h \ 34 fcomplex.h ldcomplex.h new.h sinst.h stddef.h stdexcept.h straits.h \ 35 string.h typeinfo.h 36 37STLHDRS=algo.h algobase.h bool.h bvector.h defalloc.h deque.h faralloc.h \ 38 fdeque.h flist.h fmap.h fmultmap.h fmultset.h fset.h function.h \ 39 hdeque.h heap.h hlist.h hmap.h hmultmap.h hmultset.h hset.h \ 40 hugalloc.h hvector.h iterator.h lbvector.h ldeque.h list.h llist.h \ 41 lmap.h lmultmap.h lmultset.h lngalloc.h lset.h map.h multimap.h \ 42 multiset.h neralloc.h nmap.h nmultmap.h nmultset.h nset.h pair.h \ 43 projectn.h set.h stack.h tempbuf.h tree.h vector.h 44 45SRCS+= newi.cc cstringi.cc stddefi.cc typeinfoi.cc exceptioni.cc \ 46 stdexcepti.cc cstdlibi.cc cmathi.cc 47 48# stl sources. 49SRCS+= tempbuf.cc tree.cc random.cc 50 51# "standard" C parts of libiberty (strerror is a superset of the libc version) 52SRCS+= insque.c strerror.c 53 54# Headers for iostream 55IHDRS= PlotFile.h SFile.h builtinbuf.h editbuf.h floatio.h fstream.h \ 56 indstream.h iolibio.h iomanip.h iostdio.h iostream.h iostreamP.h \ 57 istream.h libio.h libioP.h ostream.h parsestream.h pfstream.h \ 58 procbuf.h stdiostream.h stream.h streambuf.h strfile.h strstream.h 59 60# C++ parts of iostream 61SRCS+= PlotFile.cc SFile.cc builtinbuf.cc editbuf.cc filebuf.cc fstream.cc \ 62 indstream.cc ioassign.cc ioextend.cc iomanip.cc iostream.cc \ 63 isgetline.cc isgetsb.cc isscan.cc osform.cc parsestream.cc \ 64 pfstream.cc procbuf.cc sbform.cc sbgetline.cc sbscan.cc \ 65 stdiostream.cc stdstrbufs.cc stdstreams.cc stream.cc streambuf.cc \ 66 strstream.cc 67 68# C parts of iostream 69SRCS+= cleanup.c filedoalloc.c fileops.c floatconv.c genops.c iofclose.c \ 70 iofgetpos.c iofread.c iofscanf.c iofsetpos.c iogetdelim.c iogetline.c \ 71 ioignore.c iopadn.c iopopen.c ioprims.c ioprintf.c ioseekoff.c \ 72 ioseekpos.c iostrerror.c ioungetc.c iovfprintf.c iovfscanf.c \ 73 outfloat.c strops.c 74 75SRCS+= config.h 76CLEANFILES+= config.h 77 78config.h: 79 touch config.h 80 81beforeinstall: 82 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 83 ${.CURDIR}/_G_config.h \ 84 ${HDRS:S;^;${GPPDIR}/libstdc++/;} \ 85 ${IHDRS:S;^;${GPPDIR}/libio/;} \ 86 ${STLHDRS:S;^;${GPPDIR}/libstdc++/stl/;} \ 87 ${DESTDIR}/usr/include/g++ 88 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ 89 ${SHDRS:S;^;${GPPDIR}/libstdc++/std/;} \ 90 ${DESTDIR}/usr/include/g++/std 91 92# Lots of special cases 93 94# ======== typeinfoi.o, stdexcepti.o ======== 95.for file in typeinfoi stdexcepti 96${file}.o: ${file}.cc 97 ${CXX} ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET} 98 @${LD} -O ${.TARGET} -x -r ${.TARGET} 99 100${file}.so: ${file}.cc 101 ${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET} 102 @${LD} -O ${.TARGET} -x -r ${.TARGET} 103 104${file}.po: ${file}.cc 105 ${CXX} -p ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET} 106 @${LD} -O ${.TARGET} -X -r ${.TARGET} 107.endfor 108 109# ======== exceptioni.o ======== 110.for file in exceptioni 111${file}.o: ${file}.cc 112 ${CXX} ${CXXFLAGS} -O0 -frtti -fhandle-exceptions -c ${DIR}/${file}.cc -o ${.TARGET} 113 @${LD} -O ${.TARGET} -x -r ${.TARGET} 114 115${file}.so: ${file}.cc 116 ${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -O0 -frtti -fhandle-exceptions -c ${DIR}/${file}.cc -o ${.TARGET} 117 @${LD} -O ${.TARGET} -x -r ${.TARGET} 118 119${file}.po: ${file}.cc 120 ${CXX} -p ${CXXFLAGS} -O0 -frtti -fhandle-exceptions -c ${DIR}/${file}.cc -o ${.TARGET} 121 @${LD} -O ${.TARGET} -X -r ${.TARGET} 122.endfor 123 124# ======== cstrmain.o ======== 125SRCS+= cstrmain.cc 126CLEANFILES+= cstrmain.cc 127 128cstrmain.cc: sinst.cc 129 echo "#define C 1" > ${.TARGET} 130.for i in REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC EQSS EQPS EQSP NESS \ 131 NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP LESS LEPS LESP GESS GEPS GESP 132 echo "#define $i 1" >> ${.TARGET} 133.endfor 134 cat ${.ALLSRC} >> ${.TARGET} 135 136# ======== cstrio.o ======== 137SRCS+= cstrio.cc 138CLEANFILES+= cstrio.cc 139 140cstrio.cc: sinst.cc 141 echo "#define C 1" > ${.TARGET} 142.for i in EXTRACT INSERT GETLINE 143 echo "#define $i 1" >> ${.TARGET} 144.endfor 145 cat ${.ALLSRC} >> ${.TARGET} 146 147# ======== fcomplex.o ======= 148SRCS+= fcomplex.cc 149CLEANFILES+= fcomplex.cc 150 151fcomplex.cc: cinst.cc 152 echo "#define F 1" > ${.TARGET} 153.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \ 154 DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \ 155 CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT 156 echo "#define $i 1" >> ${.TARGET} 157.endfor 158 cat ${.ALLSRC} >> ${.TARGET} 159 160# ======== fcomio.o ======= 161SRCS+= fcomio.cc 162CLEANFILES+= fcomio.cc 163 164fcomio.cc: cinst.cc 165 echo "#define F 1" > ${.TARGET} 166.for i in EXTRACT INSERT 167 echo "#define $i 1" >> ${.TARGET} 168.endfor 169 cat ${.ALLSRC} >> ${.TARGET} 170 171# ======== dcomplex.o ======= 172SRCS+= dcomplex.cc 173CLEANFILES+= dcomplex.cc 174 175dcomplex.cc: cinst.cc 176 echo "#define D 1" > ${.TARGET} 177.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \ 178 DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \ 179 CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT 180 echo "#define $i 1" >> ${.TARGET} 181.endfor 182 cat ${.ALLSRC} >> ${.TARGET} 183 184# ======== dcomio.o ======= 185SRCS+= dcomio.cc 186CLEANFILES+= dcomio.cc 187 188dcomio.cc: cinst.cc 189 echo "#define D 1" > ${.TARGET} 190.for i in EXTRACT INSERT 191 echo "#define $i 1" >> ${.TARGET} 192.endfor 193 cat ${.ALLSRC} >> ${.TARGET} 194 195# ======== ldcomplex.o ======= 196SRCS+= ldcomplex.cc 197CLEANFILES+= ldcomplex.cc 198 199ldcomplex.cc: cinst.cc 200 echo "#define LD 1" > ${.TARGET} 201.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \ 202 DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \ 203 CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT 204 echo "#define $i 1" >> ${.TARGET} 205.endfor 206 cat ${.ALLSRC} >> ${.TARGET} 207 208# ======== ldcomio.o ======= 209SRCS+= ldcomio.cc 210CLEANFILES+= ldcomio.cc 211 212ldcomio.cc: cinst.cc 213 echo "#define LD 1" > ${.TARGET} 214.for i in EXTRACT INSERT 215 echo "#define $i 1" >> ${.TARGET} 216.endfor 217 cat ${.ALLSRC} >> ${.TARGET} 218 219.include <bsd.lib.mk> 220