summaryrefslogtreecommitdiffstats
path: root/gnu/lib/libstdc++/Makefile
blob: 449929257b430451db4a6d86ac706a241271fd16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
#
# $Id: Makefile,v 1.17 1999/04/08 07:20:33 obrien Exp $
#

EGCSDIR=	${.CURDIR}/../../../contrib/egcs

.PATH: ${EGCSDIR}/libstdc++ ${EGCSDIR}/libstdc++/stl ${EGCSDIR}/libio

SUBDIR=	doc

LIB=		stdc++
SHLIB_MAJOR=	3
SHLIB_MINOR=	0

CFLAGS+=	-I${.CURDIR} -I${EGCSDIR}/include -I${EGCSDIR}/libio -I.
CXXFLAGS+=	-I${EGCSDIR}/libstdc++/stl -I${EGCSDIR}/libstdc++ \
		-I${EGCSDIR}/gcc/cp/inc -I.
CXXFLAGS+=	-nostdinc++ -fno-implicit-templates

LDADD+=		-lm
DPADD+=		${LIBM}

DIR=		${EGCSDIR}/libstdc++

HDRS=	cassert cctype cerrno cfloat ciso646 climits clocale cmath complex \
	csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime \
	cwchar cwctype fstream iomanip iosfwd iostream stdexcept string \
	strstream complex.h stl.h

SHDRS=	bastring.cc bastring.h complext.cc complext.h dcomplex.h fcomplex.h \
	ldcomplex.h straits.h

STLHDRS=algo.h algobase.h algorithm alloc.h bvector.h defalloc.h deque deque.h \
	function.h functional hash_map hash_map.h hash_set hash_set.h \
	hashtable.h heap.h iterator iterator.h list list.h map map.h memory \
	multimap.h multiset.h numeric pair.h pthread_alloc pthread_alloc.h \
	queue rope rope.h ropeimpl.h set set.h slist slist.h stack stack.h \
	stl_algo.h stl_algobase.h stl_alloc.h stl_bvector.h stl_config.h \
	stl_construct.h stl_deque.h stl_function.h stl_hash_fun.h \
	stl_hash_map.h stl_hash_set.h stl_hashtable.h stl_heap.h \
	stl_iterator.h stl_list.h stl_map.h stl_multimap.h stl_multiset.h \
	stl_numeric.h stl_pair.h stl_queue.h stl_raw_storage_iter.h \
	stl_relops.h stl_rope.h stl_set.h stl_slist.h stl_stack.h \
	stl_tempbuf.h stl_tree.h stl_uninitialized.h stl_vector.h \
	tempbuf.h tree.h type_traits.h utility vector vector.h

# libstdc++ sources
SRCS+=	cmathi.cc cstdlibi.cc cstringi.cc stdexcepti.cc stlinst.cc

# Headers for iostream / libio
IHDRS=	PlotFile.h SFile.h builtinbuf.h editbuf.h floatio.h fstream.h \
	indstream.h iolibio.h iomanip.h iostdio.h iostream.h iostreamP.h \
	istream.h libio.h libioP.h ostream.h parsestream.h pfstream.h \
	procbuf.h stdiostream.h stream.h streambuf.h strfile.h strstream.h

# C++ parts of iostream / libio
SRCS+=	PlotFile.cc SFile.cc builtinbuf.cc editbuf.cc filebuf.cc fstream.cc \
	indstream.cc ioassign.cc ioextend.cc iomanip.cc iostream.cc \
	isgetline.cc isgetsb.cc isscan.cc osform.cc parsestream.cc \
	pfstream.cc procbuf.cc sbform.cc sbgetline.cc sbscan.cc \
	stdiostream.cc stdstrbufs.cc stdstreams.cc stream.cc streambuf.cc \
	strstream.cc

# C parts of iostream / libio
SRCS+=	cleanup.c filedoalloc.c fileops.c floatconv.c genops.c iofclose.c \
	iofdopen.c iofeof.c ioferror.c iofflush.c iofflush_u.c iofgetpos.c \
	iofgets.c iofopen.c iofprintf.c iofputs.c iofread.c iofscanf.c \
	iofsetpos.c ioftell.c iofwrite.c iogetc.c iogetdelim.c iogetline.c \
	iogets.c ioignore.c iopadn.c ioperror.c iopopen.c ioprims.c ioprintf.c \
	ioputc.c ioputs.c ioscanf.c ioseekoff.c ioseekpos.c iosetbuffer.c \
	iosetvbuf.c iosprintf.c iosscanf.c iostrerror.c ioungetc.c \
	iovfprintf.c iovfscanf.c iovsprintf.c iovsscanf.c outfloat.c \
	peekc.c strops.c

beforeinstall:
	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
	    ${.CURDIR}/_G_config.h \
	    ${HDRS:S;^;${EGCSDIR}/libstdc++/;} \
	    ${IHDRS:S;^;${EGCSDIR}/libio/;} \
	    ${STLHDRS:S;^;${EGCSDIR}/libstdc++/stl/;} \
	    ${DESTDIR}/usr/include/g++
	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
	    ${SHDRS:S;^;${EGCSDIR}/libstdc++/std/;} \
	    ${DESTDIR}/usr/include/g++/std

CLEANFILES+=	dummy.h dummy.c dummy.C

# Lots of special cases

# ======== typeinfoi.o, stdexcepti.o ========
.for file in typeinfoi stdexcepti
CLEANFILES+=	${file}.o.tmp ${file}.po.tmp ${file}.so.tmp
${file}.o: ${file}.cc
	${CXX} -nostdinc++ ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET}
	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@mv ${.TARGET}.tmp ${.TARGET}

${file}.so: ${file}.cc
	${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc \
	    -o ${.TARGET}
	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@mv ${.TARGET}.tmp ${.TARGET}

${file}.po: ${file}.cc
	${CXX} -p ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET}
	@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
	@mv ${.TARGET}.tmp ${.TARGET}
.endfor

# ======== exceptioni.o ========
.for file in exceptioni
CLEANFILES+=	${file}.o.tmp ${file}.po.tmp ${file}.so.tmp
${file}.o: ${file}.cc
	${CXX} ${CXXFLAGS} -O0 -c ${DIR}/${file}.cc -o ${.TARGET}
	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@mv ${.TARGET}.tmp ${.TARGET}

${file}.so: ${file}.cc
	${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -O0 -c ${DIR}/${file}.cc \
	    -o ${.TARGET}
	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
	@mv ${.TARGET}.tmp ${.TARGET}

${file}.po: ${file}.cc
	${CXX} -p ${CXXFLAGS} -O0 -c ${DIR}/${file}.cc -o ${.TARGET}
	@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
	@mv ${.TARGET}.tmp ${.TARGET}
.endfor

# ======== cstrmain.o ========
SRCS+=	cstrmain.cc
CLEANFILES+=	cstrmain.cc

cstrmain.cc: sinst.cc
	echo "#define C 1" > ${.TARGET}
.for i in REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC  EQSS EQPS EQSP NESS \
    NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP LESS LEPS LESP GESS GEPS GESP
	echo "#define $i 1" >> ${.TARGET}
.endfor
	cat ${.ALLSRC} >> ${.TARGET}

# ======== cstrio.o ========
SRCS+=	cstrio.cc
CLEANFILES+=	cstrio.cc

cstrio.cc: sinst.cc
	echo "#define C 1" > ${.TARGET}
.for i in EXTRACT INSERT GETLINE
	echo "#define $i 1" >> ${.TARGET}
.endfor
	cat ${.ALLSRC} >> ${.TARGET}

# ======== fcomplex.o =======
SRCS+=	fcomplex.cc
CLEANFILES+=	fcomplex.cc

fcomplex.cc: cinst.cc
	echo "#define F 1" > ${.TARGET}
.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
    DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR CONJ \
    NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
	echo "#define $i 1" >> ${.TARGET}
.endfor
	cat ${.ALLSRC} >> ${.TARGET}

# ======== fcomio.o =======
SRCS+=	fcomio.cc
CLEANFILES+=	fcomio.cc

fcomio.cc: cinst.cc
	echo "#define F 1" > ${.TARGET}
.for i in EXTRACT INSERT
	echo "#define $i 1" >> ${.TARGET}
.endfor
	cat ${.ALLSRC} >> ${.TARGET}

# ======== dcomplex.o =======
SRCS+=	dcomplex.cc
CLEANFILES+=	dcomplex.cc

dcomplex.cc: cinst.cc
	echo "#define D 1" > ${.TARGET}
.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
    DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR CONJ \
    NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
	echo "#define $i 1" >> ${.TARGET}
.endfor
	cat ${.ALLSRC} >> ${.TARGET}

# ======== dcomio.o =======
SRCS+=	dcomio.cc
CLEANFILES+=	dcomio.cc

dcomio.cc: cinst.cc
	echo "#define D 1" > ${.TARGET}
.for i in EXTRACT INSERT
	echo "#define $i 1" >> ${.TARGET}
.endfor
	cat ${.ALLSRC} >> ${.TARGET}

# ======== ldcomplex.o =======
SRCS+=	ldcomplex.cc
CLEANFILES+=	ldcomplex.cc

ldcomplex.cc: cinst.cc
	echo "#define LD 1" > ${.TARGET}
.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
    DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR CONJ \
    NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
	echo "#define $i 1" >> ${.TARGET}
.endfor
	cat ${.ALLSRC} >> ${.TARGET}

# ======== ldcomio.o =======
SRCS+=	ldcomio.cc
CLEANFILES+=	ldcomio.cc

ldcomio.cc: cinst.cc
	echo "#define LD 1" > ${.TARGET}
.for i in EXTRACT INSERT
	echo "#define $i 1" >> ${.TARGET}
.endfor
	cat ${.ALLSRC} >> ${.TARGET}

# ======== _G_config.h generation =======
# In case you want or need to generate a _G_config.h file.
make_G_config_h:
	CC="${CC}" CXX="${CXX}" CONFIG_NM="nm" \
	    CPP="${CC} -E -nostdinc -idirafter ${DESTDIR}/usr/include" \
	    sh ${EGCSDIR}/libio/gen-params \
	    LIB_VERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.0 >${.TARGET}

.include <bsd.lib.mk>
OpenPOWER on IntegriCloud