Makefile revision 45698
1#
2# $Id: Makefile,v 1.18 1999/04/08 09:13:39 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${.CURDIR} -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:
76	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
77	    ${.CURDIR}/_G_config.h \
78	    ${HDRS:S;^;${EGCSDIR}/libstdc++/;} \
79	    ${IHDRS:S;^;${EGCSDIR}/libio/;} \
80	    ${STLHDRS:S;^;${EGCSDIR}/libstdc++/stl/;} \
81	    ${DESTDIR}/usr/include/g++
82	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
83	    ${SHDRS:S;^;${EGCSDIR}/libstdc++/std/;} \
84	    ${DESTDIR}/usr/include/g++/std
85
86CLEANFILES+=	dummy.h dummy.c dummy.C
87
88# Lots of special cases
89
90# ======== typeinfoi.o, stdexcepti.o ========
91.for file in typeinfoi stdexcepti
92CLEANFILES+=	${file}.o.tmp ${file}.po.tmp ${file}.so.tmp
93${file}.o: ${file}.cc
94	${CXX} -nostdinc++ ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET}
95	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
96	@mv ${.TARGET}.tmp ${.TARGET}
97
98${file}.So: ${file}.cc
99	${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc \
100	    -o ${.TARGET}
101	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
102	@mv ${.TARGET}.tmp ${.TARGET}
103
104${file}.po: ${file}.cc
105	${CXX} -p ${CXXFLAGS} -frtti -c ${DIR}/${file}.cc -o ${.TARGET}
106	@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
107	@mv ${.TARGET}.tmp ${.TARGET}
108.endfor
109
110# ======== exceptioni.o ========
111.for file in exceptioni
112CLEANFILES+=	${file}.o.tmp ${file}.po.tmp ${file}.so.tmp
113${file}.o: ${file}.cc
114	${CXX} ${CXXFLAGS} -O0 -c ${DIR}/${file}.cc -o ${.TARGET}
115	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
116	@mv ${.TARGET}.tmp ${.TARGET}
117
118${file}.So: ${file}.cc
119	${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -O0 -c ${DIR}/${file}.cc \
120	    -o ${.TARGET}
121	@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
122	@mv ${.TARGET}.tmp ${.TARGET}
123
124${file}.po: ${file}.cc
125	${CXX} -p ${CXXFLAGS} -O0 -c ${DIR}/${file}.cc -o ${.TARGET}
126	@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
127	@mv ${.TARGET}.tmp ${.TARGET}
128.endfor
129
130# ======== cstrmain.o ========
131SRCS+=	cstrmain.cc
132CLEANFILES+=	cstrmain.cc
133
134cstrmain.cc: sinst.cc
135	echo "#define C 1" > ${.TARGET}
136.for i in REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC  EQSS EQPS EQSP NESS \
137    NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP LESS LEPS LESP GESS GEPS GESP
138	echo "#define $i 1" >> ${.TARGET}
139.endfor
140	cat ${.ALLSRC} >> ${.TARGET}
141
142# ======== cstrio.o ========
143SRCS+=	cstrio.cc
144CLEANFILES+=	cstrio.cc
145
146cstrio.cc: sinst.cc
147	echo "#define C 1" > ${.TARGET}
148.for i in EXTRACT INSERT GETLINE
149	echo "#define $i 1" >> ${.TARGET}
150.endfor
151	cat ${.ALLSRC} >> ${.TARGET}
152
153# ======== fcomplex.o =======
154SRCS+=	fcomplex.cc
155CLEANFILES+=	fcomplex.cc
156
157fcomplex.cc: cinst.cc
158	echo "#define F 1" > ${.TARGET}
159.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
160    DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR CONJ \
161    NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
162	echo "#define $i 1" >> ${.TARGET}
163.endfor
164	cat ${.ALLSRC} >> ${.TARGET}
165
166# ======== fcomio.o =======
167SRCS+=	fcomio.cc
168CLEANFILES+=	fcomio.cc
169
170fcomio.cc: cinst.cc
171	echo "#define F 1" > ${.TARGET}
172.for i in EXTRACT INSERT
173	echo "#define $i 1" >> ${.TARGET}
174.endfor
175	cat ${.ALLSRC} >> ${.TARGET}
176
177# ======== dcomplex.o =======
178SRCS+=	dcomplex.cc
179CLEANFILES+=	dcomplex.cc
180
181dcomplex.cc: cinst.cc
182	echo "#define D 1" > ${.TARGET}
183.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
184    DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR CONJ \
185    NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
186	echo "#define $i 1" >> ${.TARGET}
187.endfor
188	cat ${.ALLSRC} >> ${.TARGET}
189
190# ======== dcomio.o =======
191SRCS+=	dcomio.cc
192CLEANFILES+=	dcomio.cc
193
194dcomio.cc: cinst.cc
195	echo "#define D 1" > ${.TARGET}
196.for i in EXTRACT INSERT
197	echo "#define $i 1" >> ${.TARGET}
198.endfor
199	cat ${.ALLSRC} >> ${.TARGET}
200
201# ======== ldcomplex.o =======
202SRCS+=	ldcomplex.cc
203CLEANFILES+=	ldcomplex.cc
204
205ldcomplex.cc: cinst.cc
206	echo "#define LD 1" > ${.TARGET}
207.for i in MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
208    DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR CONJ \
209    NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
210	echo "#define $i 1" >> ${.TARGET}
211.endfor
212	cat ${.ALLSRC} >> ${.TARGET}
213
214# ======== ldcomio.o =======
215SRCS+=	ldcomio.cc
216CLEANFILES+=	ldcomio.cc
217
218ldcomio.cc: cinst.cc
219	echo "#define LD 1" > ${.TARGET}
220.for i in EXTRACT INSERT
221	echo "#define $i 1" >> ${.TARGET}
222.endfor
223	cat ${.ALLSRC} >> ${.TARGET}
224
225# ======== _G_config.h generation =======
226# In case you want or need to generate a _G_config.h file.
227make_G_config_h:
228	CC="${CC}" CXX="${CXX}" CONFIG_NM="nm" \
229	    CPP="${CC} -E -nostdinc -idirafter ${DESTDIR}/usr/include" \
230	    sh ${EGCSDIR}/libio/gen-params \
231	    LIB_VERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.0 >${.TARGET}
232
233.include <bsd.lib.mk>
234