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