summaryrefslogtreecommitdiff
path: root/gnu/egcs/libstdc++/Makefile.in
blob: f13eddcf29453378b331bdf93275f5b3763af0a0 (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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
# Copyright (C) 1994, 1995 Free Software Foundation

# This file is part of the GNU ANSI C++ Library.  This library is free
# software; you can redistribute it and/or modify it under the terms of
# the GNU General Public License as published by the Free Software
# Foundation; either version 2, or (at your option) any later version.

# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this library; see the file COPYING.  If not, write to the Free
# Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

VERSION = 2.10.0
INTERFACE = 3

gxx_include_dir=${includedir}/g++

OBJS  = cstringi.o stdexcepti.o cstdlibi.o cmathi.o stlinst.o valarray.o
SUBLIBS = $(STAMP)-string $(STAMP)-complx

# C++ headers with no extension
HEADERS= cassert cctype cerrno cfloat ciso646 climits clocale cmath complex \
	 csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime \
	 cwchar cwctype string stdexcept \
	 algorithm deque functional hash_map hash_set iterator list map \
	 memory numeric pthread_alloc queue rope set slist stack utility \
	 vector fstream iomanip iostream strstream iosfwd bitset valarray \
	 sstream

ARLIB   = libstdc++.a.$(VERSION)
ARLINK  = libstdc++.a
MARLINK = libstdc++.a.`echo $(VERSION) | sed 's/\([0-9]*[.][0-9]*\).*/\1/'`
SHLIB   = libstdc++.so.$(VERSION)
SHARLIB = libstdc++-sh.a
SHLINK  = libstdc++.so
MSHLINK = libstdc++.so.`echo $(VERSION) | sed 's/\([0-9]*[.][0-9]*\).*/\1/'`
SHFLAGS =
SHDEPS  =

STAMP   = bigstmp

LIBS    = $(ARLIB) $(ARLINK)

#### package, host, target, and site dependent Makefile fragments come in here.
##

IO_DIR    = ../libio
LIBIBERTY_DIR = ../libiberty

LIBIBERTY_OBJS = `cat $(LIBIBERTY_DIR)/needed-list` strerror.o

tooldir = $(exec_prefix)/$(target)
# This is where the libraries will be installed; note, it will be set
# at make runtime now. See below at target install.
INSTALLDIR = $(libdir)

MOSTLYCLEAN_JUNK = *stmp-* tlib*.a *.s *.ii stdlist piclist
CLEAN_JUNK = $(LIBS)

.PHONY: libs
libs: $(LIBS)

stdlist: $(IO_DIR)/iostream.list $(OBJS) $(SUBLIBS) $(LIBIBERTY_DIR)/libiberty.a
	-rm -f tlist
	touch tlist
	echo *.o >> tlist
	for f in `cat $(IO_DIR)/iostream.list` ; do \
	  echo "$(IO_DIR)/$$f" >> tlist ; \
	done
	for f in $(LIBIBERTY_OBJS) ; do \
	  echo "$(LIBIBERTY_DIR)/$$f" >> tlist ; \
	done
	mv tlist stdlist

piclist: stdlist
	-rm -f tlist
	cp stdlist tlist
	if [ x"$(enable_shared)" = xyes ]; then \
	  sed 's,\([A-Za-z_]*\.o\),pic/\1,g' tlist > tlist2 ; \
	  mv tlist2 tlist ; \
	else true ; fi
	mv tlist piclist

$(ARLIB): stdlist
	-rm -f t$(ARLIB)
	$(AR) $(AR_FLAGS) t$(ARLIB) `cat stdlist`
	mv t$(ARLIB) $(ARLIB)
	$(RANLIB) $(ARLIB)

$(ARLINK):
	-rm -f $(ARLINK)
	$(LN_S) $(ARLIB) $(ARLINK) || cp $(ARLIB) $(ARLINK)

marlink:
	@$(MAKE) $(MARLINK) "ARLINK=$(MARLINK)"

$(SHLIB): piclist
	$(CC) $(LIBCXXFLAGS) $(SHFLAGS) -shared -o $(SHLIB) `cat piclist` $(SHDEPS)

$(SHARLIB): $(SHLIB)
	-rm -f t$(SHARLIB)
	$(AR) $(AR_FLAGS) t$(SHARLIB) $(SHLIB)
	mv t$(SHARLIB) $(SHARLIB)
	$(RANLIB) $(SHARLIB)

$(SHLINK):
	-rm -f $(SHLINK)
	$(LN_S) $(SHLIB) $(SHLINK) || cp $(ARLIB) $(ARLINK)

mshlink:
	@$(MAKE) $(MSHLINK) "SHLINK=$(MSHLINK)"

$(IO_DIR)/iostream.list: force
	cd $(IO_DIR) ; $(MAKE) $(FLAGS_TO_PASS) iostream.list

$(LIBIBERTY_DIR)/libiberty.a:
	cd $(LIBIBERTY_DIR) ; $(MAKE) $(FLAGS_TO_PASS)

STRFUNCS = 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
STRIO	 = EXTRACT INSERT GETLINE

# These are here for SunOS VPATH.
cstringi.o: cstringi.cc
cstdlibi.o: cstdlibi.cc
cmathi.o: cmathi.cc
stdexcepti.o: stdexcepti.cc
stlinst.o: stlinst.cc
valarray.o: valarray.cc

# Later do wide strings, too.
stmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
	     ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
	for name in $(STRFUNCS) $(STRIO); do \
	  echo c$${name}; \
	  if [ x"$(enable_shared)" = xyes ]; then \
	    $(COMPILE.cc) $(PICFLAG) -DC -D$${name} ${srcdir}/sinst.cc \
	      -o pic/c$${name}.o; \
	  else true ; fi; \
	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
	  $(COMPILE.cc) -DC -D$${name} ${srcdir}/sinst.cc -o c$${name}.o; \
	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
	done
	touch stmp-string

bigstmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
	        ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
	echo cstring
	if [ x"$(enable_shared)" = xyes ]; then \
	  $(COMPILE.cc) $(PICFLAG) -DC \
	    `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
	    $(srcdir)/sinst.cc -o pic/cstrmain.o; \
	else true ; fi
	$(COMPILE.cc) -DC `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
	  $(srcdir)/sinst.cc -o cstrmain.o
	echo cstrio
	if [ x"$(enable_shared)" = xyes ]; then \
	  $(COMPILE.cc) $(PICFLAG) -DC \
	    `for N in $(STRIO); do echo " -D$${N}"; done` \
	    $(srcdir)/sinst.cc -o pic/cstrio.o; \
	else true ; fi
	$(COMPILE.cc) -DC `for N in $(STRIO); do echo " -D$${N}"; done` \
	  $(srcdir)/sinst.cc -o cstrio.o
	touch bigstmp-string

COMFUNCS = 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
COMIO    = EXTRACT INSERT

stmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
	      ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
	      ${srcdir}/std/ldcomplex.h
	for N in $(COMFUNCS) $(COMIO); do \
	  echo f$${N}; \
	  if [ x"$(enable_shared)" = xyes ]; then \
	    $(COMPILE.cc) $(PICFLAG) -DF -D$${N} $(srcdir)/cinst.cc \
	      -o pic/f$${N}.o; \
	  else true ; fi; \
	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
	  $(COMPILE.cc) -DF -D$${N} ${srcdir}/cinst.cc -o f$${N}.o; \
	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
	  echo d$${N}; \
	  if [ x"$(enable_shared)" = xyes ]; then \
	    $(COMPILE.cc) $(PICFLAG) -DD -D$${N} $(srcdir)/cinst.cc \
	      -o pic/d$${N}.o; \
	  else true ; fi; \
	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
	  $(COMPILE.cc) -DD -D$${N} ${srcdir}/cinst.cc -o d$${N}.o; \
	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
	  echo ld$${N}; \
	  if [ x"$(enable_shared)" = xyes ]; then \
	    $(COMPILE.cc) $(PICFLAG) -DLD -D$${N} $(srcdir)/cinst.cc \
	      -o pic/ld$${N}.o; \
	  else true ; fi; \
	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
	  $(COMPILE.cc) -DLD -D$${N} ${srcdir}/cinst.cc -o ld$${N}.o; \
	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
	done
	touch stmp-complx

bigstmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
	         ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
	         ${srcdir}/std/ldcomplex.h
	echo fcomplex
	if [ x"$(enable_shared)" = xyes ]; then \
	  $(COMPILE.cc) $(PICFLAG) -DF \
	    `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
	    $(srcdir)/cinst.cc -o pic/fcomplex.o; \
	else true ; fi
	$(COMPILE.cc) -DF `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
	  $(srcdir)/cinst.cc -o fcomplex.o
	echo fcomio
	if [ x"$(enable_shared)" = xyes ]; then \
	  $(COMPILE.cc) $(PICFLAG) -DF \
	    `for N in $(COMIO); do echo " -D$${N}"; done` \
	    $(srcdir)/cinst.cc -o pic/fcomio.o; \
	else true ; fi
	$(COMPILE.cc) -DF `for N in $(COMIO); do echo " -D$${N}"; done` \
	  $(srcdir)/cinst.cc -o fcomio.o
	echo dcomplex
	if [ x"$(enable_shared)" = xyes ]; then \
	  $(COMPILE.cc) $(PICFLAG) -DD \
	    `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
	    $(srcdir)/cinst.cc -o pic/dcomplex.o; \
	else true ; fi
	$(COMPILE.cc) -DD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
	  $(srcdir)/cinst.cc -o dcomplex.o
	echo dcomio
	if [ x"$(enable_shared)" = xyes ]; then \
	  $(COMPILE.cc) $(PICFLAG) -DD \
	    `for N in $(COMIO); do echo " -D$${N}"; done` \
	    $(srcdir)/cinst.cc -o pic/dcomio.o; \
	else true ; fi
	$(COMPILE.cc) -DD `for N in $(COMIO); do echo " -D$${N}"; done` \
	  $(srcdir)/cinst.cc -o dcomio.o
	echo ldcomplex
	if [ x"$(enable_shared)" = xyes ]; then \
	  $(COMPILE.cc) $(PICFLAG) -DLD \
	    `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
	    $(srcdir)/cinst.cc -o pic/ldcomplex.o; \
	else true ; fi
	$(COMPILE.cc) -DLD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
	  $(srcdir)/cinst.cc -o ldcomplex.o
	echo ldcomio
	if [ x"$(enable_shared)" = xyes ]; then \
	  $(COMPILE.cc) $(PICFLAG) -DLD \
	    `for N in $(COMIO); do echo " -D$${N}"; done` \
	    $(srcdir)/cinst.cc -o pic/ldcomio.o; \
	else true ; fi
	$(COMPILE.cc) -DLD `for N in $(COMIO); do echo " -D$${N}"; done` \
	  $(srcdir)/cinst.cc -o ldcomio.o
	touch bigstmp-complx

.PHONY: install
install:
	rootme=`pwd`/ ; export rootme ; \
	if [ -z "$(MULTISUBDIR)" ]; then \
	  cd $(srcdir); \
	  for FILE in $(HEADERS); do \
	    rm -f $(gxx_include_dir)/$$FILE ; \
	    if [ -f stl/$$FILE ]; then \
	      $(INSTALL_DATA) stl/$$FILE $(gxx_include_dir)/$$FILE ; \
	    else \
	      $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
	    fi ; \
	    chmod a-x $(gxx_include_dir)/$$FILE ; \
	  done ; \
	  for FILE in *.h std/*.h std/*.cc std/*.tcc; do \
	    rm -f $(gxx_include_dir)/$$FILE ; \
	    $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
	    chmod a-x $(gxx_include_dir)/$$FILE ; \
	  done ; \
	  cd stl; \
	  for FILE in *.h; do \
	    rm -f $(gxx_include_dir)/$$FILE ; \
	    $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
	    chmod a-x $(gxx_include_dir)/$$FILE ; \
	  done ; \
	else true ; \
	fi
	rootme=`pwd`/ ; export rootme ; \
	if [ x$(enable_version_specific_runtime_libs) != xyes ]; then \
	  INSTALLDIR=$(libdir); \
	else \
	  INSTALLDIR=$(libsubdir); \
	fi; \
	INSTALLLINKDIR=$(libsubdir); \
	if [ $${INSTALLLINKDIR}$(MULTISUBDIR) = $${INSTALLDIR}$(MULTISUBDIR) ]; then \
	  RELINSTALLDIR=; \
	elif [ x$(MULTISUBDIR) = x ]; then \
	  if [ $(build_alias) = $(target_alias) ]; then \
	    RELINSTALLDIR=../../../; \
	  else \
	    RELINSTALLDIR=../../../../$(target_alias)/lib/; \
	  fi; \
	else \
	  if [ $(build_alias) = $(target_alias) ]; then \
	    RELINSTALLDIR=../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`$(MULTISUBDIR)/; \
	  else \
	    RELINSTALLDIR=../../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`/$(target_alias)/lib$(MULTISUBDIR)/; \
	  fi; \
	fi; \
	if [ $(build_alias) != $(target_alias) ]; then \
	  case $$RELINSTALLDIR in \
	  ../../../|../../../../) \
	    RELINSTALLDIR=../$${RELINSTALLDIR}$(target_alias)/lib/;; \
	  esac; \
	fi; \
	rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(SHLINK) ; \
	rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(ARLINK) ; \
	for FILE in $(LIBS) ; do \
	  rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
	  if [ $$FILE = $(SHLINK) ] ; then \
	    if [ -f $${INSTALLDIR}/$(MSHLINK) ]; then \
	      rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
	      $(LN_S) $${RELINSTALLDIR}$(MSHLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
		|| cp $${RELINSTALLDIR}$(MSHLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
	    else \
	      rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
	      $(LN_S) $${RELINSTALLDIR}$(SHLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
		|| cp $${RELINSTALLDIR}$(SHLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
	    fi; \
	  elif [ $$FILE = $(ARLINK) ] ; then \
	    if [ -f $${INSTALLDIR}/$(MARLINK) ]; then \
	      rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
	      $(LN_S) $${RELINSTALLDIR}$(MARLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
		|| cp $${RELINSTALLDIR}$(MARLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
	    else \
	      rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
	      $(LN_S) $${RELINSTALLDIR}$(ARLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
		|| cp $${RELINSTALLDIR}$(ARLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
	    fi; \
	  elif [ $$FILE = mshlink ]; then \
	    for FILE in $(MSHLINK) ; do \
	      rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
	      $(LN_S) $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE \
		|| cp $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
	    done; \
	  elif [ $$FILE = marlink ]; then \
	    for FILE in $(MARLINK) ; do \
	      rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
	      $(LN_S) $(ARLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE \
		|| cp $(ARLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
	    done; \
	  elif [ $$FILE = $(SHLIB) ]; then \
	    $(INSTALL_PROGRAM) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
	    : On the HP, shared libraries must be mode 555. ;\
	    chmod 555 $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
	  else \
	    $(INSTALL_DATA) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
	    $(RANLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
	    chmod a-x $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
	  fi ; \
	done
	@rootme=`pwd`/ ; export rootme ; \
	$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install

.PHONY: force
force:

MYCXXFLAGS = -g -O2 -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings -pedantic -Wno-long-long
MYCFLAGS = -g -O2 -Wpointer-arith -Wnested-externs

.PHONY: stuff
stuff:
	$(MAKE) stuff1
	$(MAKE) stuff2

stuff1:
	$(MAKE) clean
	$(MAKE) -C ../libio c++clean
	touch ../../gcc/libgcc2.ready

stuff2:
	$(MAKE) -C ../../gcc/ libgcc.a
	$(MAKE) CXXFLAGS="$(MYCXXFLAGS)" CFLAGS="$(MYCFLAGS)"
	-$(MAKE) check
	-$(MAKE) -C ../libio check
	-$(MAKE) -C ../../gcc check-g++