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