Makefile revision 45339
1#
2# $Id: Makefile,v 1.14 1999/04/05 08:07:40 obrien Exp $
3#
4
5EGCSDIR=	${.CURDIR}/../../../contrib/egcs
6
7.PATH: ${EGCSDIR}/libstdc++ ${EGCSDIR}/libstdc++/stl ${EGCSDIR}/libio
8
9SUBDIR=	doc
10
11LIB=		stdc++
12SHLIB_MAJOR=	3
13SHLIB_MINOR=	0
14
15CFLAGS+=	-I${EGCSDIR}/include -I${EGCSDIR}/libio -I.
16CXXFLAGS+=	-I${EGCSDIR}/libstdc++/stl -I${EGCSDIR}/libstdc++ \
17		-I${EGCSDIR}/gcc/cp/inc -I.
18CXXFLAGS+=	-nostdinc++ -fno-implicit-templates
19
20LDADD+=		-lm
21DPADD+=		${LIBM}
22
23DIR=		${EGCSDIR}/libstdc++
24
25HDRS=	cassert cctype cerrno cfloat ciso646 climits clocale cmath complex \
26	csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime \
27	cwchar cwctype fstream iomanip iosfwd iostream stdexcept string \
28	strstream complex.h stl.h
29
30SHDRS=	bastring.cc bastring.h complext.cc complext.h dcomplex.h fcomplex.h \
31	ldcomplex.h straits.h
32
33STLHDRS=algo.h algobase.h algorithm alloc.h bvector.h defalloc.h deque deque.h \
34	function.h functional hash_map hash_map.h hash_set hash_set.h \
35	hashtable.h heap.h iterator iterator.h list list.h map map.h memory \
36	multimap.h multiset.h numeric pair.h pthread_alloc pthread_alloc.h \
37	queue rope rope.h ropeimpl.h set set.h slist slist.h stack stack.h \
38	stl_algo.h stl_algobase.h stl_alloc.h stl_bvector.h stl_config.h \
39	stl_construct.h stl_deque.h stl_function.h stl_hash_fun.h \
40	stl_hash_map.h stl_hash_set.h stl_hashtable.h stl_heap.h \
41	stl_iterator.h stl_list.h stl_map.h stl_multimap.h stl_multiset.h \
42	stl_numeric.h stl_pair.h stl_queue.h stl_raw_storage_iter.h \
43	stl_relops.h stl_rope.h stl_set.h stl_slist.h stl_stack.h \
44	stl_tempbuf.h stl_tree.h stl_uninitialized.h stl_vector.h \
45	tempbuf.h tree.h type_traits.h utility vector vector.h
46
47# libstdc++ sources
48SRCS+=	cmathi.cc cstdlibi.cc cstringi.cc stdexcepti.cc stlinst.cc
49
50# Headers for iostream / libio
51IHDRS=	PlotFile.h SFile.h builtinbuf.h editbuf.h floatio.h fstream.h \
52	indstream.h iolibio.h iomanip.h iostdio.h iostream.h iostreamP.h \
53	istream.h libio.h libioP.h ostream.h parsestream.h pfstream.h \
54	procbuf.h stdiostream.h stream.h streambuf.h strfile.h strstream.h
55
56# C++ parts of iostream / libio
57SRCS+=	PlotFile.cc SFile.cc builtinbuf.cc editbuf.cc filebuf.cc fstream.cc \
58	indstream.cc ioassign.cc ioextend.cc iomanip.cc iostream.cc \
59	isgetline.cc isgetsb.cc isscan.cc osform.cc parsestream.cc \
60	pfstream.cc procbuf.cc sbform.cc sbgetline.cc sbscan.cc \
61	stdiostream.cc stdstrbufs.cc stdstreams.cc stream.cc streambuf.cc \
62	strstream.cc
63
64# C parts of iostream / libio
65SRCS+=	cleanup.c filedoalloc.c fileops.c floatconv.c genops.c iofclose.c \
66	iofdopen.c iofeof.c ioferror.c iofflush.c iofflush_u.c iofgetpos.c \
67	iofgets.c iofopen.c iofprintf.c iofputs.c iofread.c iofscanf.c \
68	iofsetpos.c ioftell.c iofwrite.c iogetc.c iogetdelim.c iogetline.c \
69	iogets.c ioignore.c iopadn.c ioperror.c iopopen.c ioprims.c ioprintf.c \
70	ioputc.c ioputs.c ioscanf.c ioseekoff.c ioseekpos.c iosetbuffer.c \
71	iosetvbuf.c iosprintf.c iosscanf.c iostrerror.c ioungetc.c \
72	iovfprintf.c iovfscanf.c iovsprintf.c iovsscanf.c outfloat.c \
73	peekc.c strops.c
74
75beforeinstall: _G_config.h
76	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
77		_G_config.h \
78		${DESTDIR}/usr/include/g++
79	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
80		${HDRS:S;^;${EGCSDIR}/libstdc++/;} \
81		${IHDRS:S;^;${EGCSDIR}/libio/;} \
82		${STLHDRS:S;^;${EGCSDIR}/libstdc++/stl/;} \
83		${DESTDIR}/usr/include/g++
84	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
85		${SHDRS:S;^;${EGCSDIR}/libstdc++/std/;} \
86		${DESTDIR}/usr/include/g++/std
87
88SRCS+=		_G_config.h
89CLEANFILES+=	_G_config.h dummy.h dummy.c dummy.C
90_G_config.h: Makefile ${EGCSDIR}/libio/gen-params
91	CC="${CC}" CXX="${CXX}" CONFIG_NM="nm" \
92		CPP="${CC} -E -nostdinc -idirafter ${DESTDIR}/usr/include" \
93		sh ${EGCSDIR}/libio/gen-params \
94		LIB_VERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.0 >${.TARGET}
95
96# Lots of special cases
97
98# ======== typeinfoi.o, stdexcepti.o ========
99.for file in typeinfoi stdexcepti
100CLEANFILES+=	${file}.o.tmp ${file}.po.tmp ${file}.so.tmp
101${file}.o: ${file}.cc
102	${CXX} -nostdinc++ ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET}
103	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
104	@mv ${.TARGET}.tmp ${.TARGET}
105
106${file}.so: ${file}.cc
107	${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET}
108	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
109	@mv ${.TARGET}.tmp ${.TARGET}
110
111${file}.po: ${file}.cc
112	${CXX} -p ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET}
113	@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
114	@mv ${.TARGET}.tmp ${.TARGET}
115.endfor
116
117# ======== exceptioni.o ========
118.for file in exceptioni
119CLEANFILES+=	${file}.o.tmp ${file}.po.tmp ${file}.so.tmp
120${file}.o: ${file}.cc
121	${CXX} ${CXXFLAGS} -O0 -c ${DIR}/${file}.cc -o ${.TARGET}
122	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
123	@mv ${.TARGET}.tmp ${.TARGET}
124
125${file}.so: ${file}.cc
126	${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -O0 -c ${DIR}/${file}.cc -o ${.TARGET}
127	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
128	@mv ${.TARGET}.tmp ${.TARGET}
129
130${file}.po: ${file}.cc
131	${CXX} -p ${CXXFLAGS} -O0 -c ${DIR}/${file}.cc -o ${.TARGET}
132	@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
133	@mv ${.TARGET}.tmp ${.TARGET}
134.endfor
135
136# ======== cstrmain.o ========
137SRCS+=	cstrmain.cc
138CLEANFILES+=	cstrmain.cc
139
140cstrmain.cc: sinst.cc
141	echo "#define C 1" > ${.TARGET}
142.for i in REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC  EQSS EQPS EQSP NESS \
143    NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP LESS LEPS LESP GESS GEPS GESP
144	echo "#define $i 1" >> ${.TARGET}
145.endfor
146	cat ${.ALLSRC} >> ${.TARGET}
147
148# ======== cstrio.o ========
149SRCS+=	cstrio.cc
150CLEANFILES+=	cstrio.cc
151
152cstrio.cc: sinst.cc
153	echo "#define C 1" > ${.TARGET}
154.for i in EXTRACT INSERT GETLINE
155	echo "#define $i 1" >> ${.TARGET}
156.endfor
157	cat ${.ALLSRC} >> ${.TARGET}
158
159# ======== fcomplex.o =======
160SRCS+=	fcomplex.cc
161CLEANFILES+=	fcomplex.cc
162
163fcomplex.cc: cinst.cc
164	echo "#define F 1" > ${.TARGET}
165.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
166    DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR CONJ \
167    NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
168	echo "#define $i 1" >> ${.TARGET}
169.endfor
170	cat ${.ALLSRC} >> ${.TARGET}
171
172# ======== fcomio.o =======
173SRCS+=	fcomio.cc
174CLEANFILES+=	fcomio.cc
175
176fcomio.cc: cinst.cc
177	echo "#define F 1" > ${.TARGET}
178.for i in EXTRACT INSERT
179	echo "#define $i 1" >> ${.TARGET}
180.endfor
181	cat ${.ALLSRC} >> ${.TARGET}
182
183# ======== dcomplex.o =======
184SRCS+=	dcomplex.cc
185CLEANFILES+=	dcomplex.cc
186
187dcomplex.cc: cinst.cc
188	echo "#define D 1" > ${.TARGET}
189.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
190    DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR CONJ \
191    NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
192	echo "#define $i 1" >> ${.TARGET}
193.endfor
194	cat ${.ALLSRC} >> ${.TARGET}
195
196# ======== dcomio.o =======
197SRCS+=	dcomio.cc
198CLEANFILES+=	dcomio.cc
199
200dcomio.cc: cinst.cc
201	echo "#define D 1" > ${.TARGET}
202.for i in EXTRACT INSERT
203	echo "#define $i 1" >> ${.TARGET}
204.endfor
205	cat ${.ALLSRC} >> ${.TARGET}
206
207# ======== ldcomplex.o =======
208SRCS+=	ldcomplex.cc
209CLEANFILES+=	ldcomplex.cc
210
211ldcomplex.cc: cinst.cc
212	echo "#define LD 1" > ${.TARGET}
213.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
214    DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR CONJ \
215    NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
216	echo "#define $i 1" >> ${.TARGET}
217.endfor
218	cat ${.ALLSRC} >> ${.TARGET}
219
220# ======== ldcomio.o =======
221SRCS+=	ldcomio.cc
222CLEANFILES+=	ldcomio.cc
223
224ldcomio.cc: cinst.cc
225	echo "#define LD 1" > ${.TARGET}
226.for i in EXTRACT INSERT
227	echo "#define $i 1" >> ${.TARGET}
228.endfor
229	cat ${.ALLSRC} >> ${.TARGET}
230
231.include <bsd.lib.mk>
232