xref: /freebsd-12.1/gnu/lib/libstdc++/Makefile (revision 52ff03bd)
1#
2# $Id: Makefile,v 1.10 1998/10/11 04:56:03 peter 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
96CLEANFILES+=	${file}.o.tmp ${file}.po.tmp ${file}.so.tmp
97${file}.o: ${file}.cc
98	${CXX} ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET}
99	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
100	@mv ${.TARGET}.tmp ${.TARGET}
101
102${file}.so: ${file}.cc
103	${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET}
104	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
105	@mv ${.TARGET}.tmp ${.TARGET}
106
107${file}.po: ${file}.cc
108	${CXX} -p ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET}
109	@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
110	@mv ${.TARGET}.tmp ${.TARGET}
111.endfor
112
113# ======== exceptioni.o ========
114.for file in exceptioni
115CLEANFILES+=	${file}.o.tmp ${file}.po.tmp ${file}.so.tmp
116${file}.o: ${file}.cc
117	${CXX} ${CXXFLAGS} -O0 -frtti -fhandle-exceptions -c ${DIR}/${file}.cc -o ${.TARGET}
118	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
119	@mv ${.TARGET}.tmp ${.TARGET}
120
121${file}.so: ${file}.cc
122	${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -O0 -frtti -fhandle-exceptions -c ${DIR}/${file}.cc -o ${.TARGET}
123	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
124	@mv ${.TARGET}.tmp ${.TARGET}
125
126${file}.po: ${file}.cc
127	${CXX} -p ${CXXFLAGS} -O0 -frtti -fhandle-exceptions -c ${DIR}/${file}.cc -o ${.TARGET}
128	@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
129	@mv ${.TARGET}.tmp ${.TARGET}
130.endfor
131
132# ======== cstrmain.o ========
133SRCS+=	cstrmain.cc
134CLEANFILES+=	cstrmain.cc
135
136cstrmain.cc: sinst.cc
137	echo "#define C 1" > ${.TARGET}
138.for i in REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC  EQSS EQPS EQSP NESS \
139    NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP  LESS LEPS LESP GESS GEPS GESP
140	echo "#define $i 1" >> ${.TARGET}
141.endfor
142	cat ${.ALLSRC} >> ${.TARGET}
143
144# ======== cstrio.o ========
145SRCS+=	cstrio.cc
146CLEANFILES+=	cstrio.cc
147
148cstrio.cc: sinst.cc
149	echo "#define C 1" > ${.TARGET}
150.for i in EXTRACT INSERT GETLINE
151	echo "#define $i 1" >> ${.TARGET}
152.endfor
153	cat ${.ALLSRC} >> ${.TARGET}
154
155# ======== fcomplex.o =======
156SRCS+=	fcomplex.cc
157CLEANFILES+=	fcomplex.cc
158
159fcomplex.cc: cinst.cc
160	echo "#define F 1" > ${.TARGET}
161.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
162    DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
163    CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
164	echo "#define $i 1" >> ${.TARGET}
165.endfor
166	cat ${.ALLSRC} >> ${.TARGET}
167
168# ======== fcomio.o =======
169SRCS+=	fcomio.cc
170CLEANFILES+=	fcomio.cc
171
172fcomio.cc: cinst.cc
173	echo "#define F 1" > ${.TARGET}
174.for i in EXTRACT INSERT
175	echo "#define $i 1" >> ${.TARGET}
176.endfor
177	cat ${.ALLSRC} >> ${.TARGET}
178
179# ======== dcomplex.o =======
180SRCS+=	dcomplex.cc
181CLEANFILES+=	dcomplex.cc
182
183dcomplex.cc: cinst.cc
184	echo "#define D 1" > ${.TARGET}
185.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
186    DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
187    CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
188	echo "#define $i 1" >> ${.TARGET}
189.endfor
190	cat ${.ALLSRC} >> ${.TARGET}
191
192# ======== dcomio.o =======
193SRCS+=	dcomio.cc
194CLEANFILES+=	dcomio.cc
195
196dcomio.cc: cinst.cc
197	echo "#define D 1" > ${.TARGET}
198.for i in EXTRACT INSERT
199	echo "#define $i 1" >> ${.TARGET}
200.endfor
201	cat ${.ALLSRC} >> ${.TARGET}
202
203# ======== ldcomplex.o =======
204SRCS+=	ldcomplex.cc
205CLEANFILES+=	ldcomplex.cc
206
207ldcomplex.cc: cinst.cc
208	echo "#define LD 1" > ${.TARGET}
209.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
210    DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
211    CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
212	echo "#define $i 1" >> ${.TARGET}
213.endfor
214	cat ${.ALLSRC} >> ${.TARGET}
215
216# ======== ldcomio.o =======
217SRCS+=	ldcomio.cc
218CLEANFILES+=	ldcomio.cc
219
220ldcomio.cc: cinst.cc
221	echo "#define LD 1" > ${.TARGET}
222.for i in EXTRACT INSERT
223	echo "#define $i 1" >> ${.TARGET}
224.endfor
225	cat ${.ALLSRC} >> ${.TARGET}
226
227.include <bsd.lib.mk>
228