1 |
39 |
lampret |
# Makefile for newlib.
|
2 |
|
|
# Copyright (c) 1994, 1995, 1997 Cygnus Support.
|
3 |
|
|
# All rights reserved.
|
4 |
|
|
#
|
5 |
|
|
# Redistribution and use in source and binary forms are permitted
|
6 |
|
|
# provided that the above copyright notice and this paragraph are
|
7 |
|
|
# duplicated in all such forms and that any documentation,
|
8 |
|
|
# advertising materials, and other materials related to such
|
9 |
|
|
# distribution and use acknowledge that the software was developed
|
10 |
|
|
# at Cygnus Support, Inc. Cygnus Support, Inc. may not be used to
|
11 |
|
|
# endorse or promote products derived from this software without
|
12 |
|
|
# specific prior written permission.
|
13 |
|
|
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
14 |
|
|
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
15 |
|
|
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
16 |
|
|
|
17 |
|
|
# This copy of $(VERSION) is used when building net newlib releases.
|
18 |
|
|
VERSION = 1.8.1
|
19 |
|
|
|
20 |
|
|
srcdir = .
|
21 |
|
|
|
22 |
|
|
prefix = /usr/local
|
23 |
|
|
|
24 |
|
|
exec_prefix = $(prefix)
|
25 |
|
|
bindir = $(exec_prefix)/bin
|
26 |
|
|
libdir = $(exec_prefix)/lib
|
27 |
|
|
tooldir = $(exec_prefix)
|
28 |
|
|
|
29 |
|
|
datadir = $(prefix)/share
|
30 |
|
|
|
31 |
|
|
mandir = $(prefix)/man
|
32 |
|
|
man1dir = $(mandir)/man1
|
33 |
|
|
man2dir = $(mandir)/man2
|
34 |
|
|
man3dir = $(mandir)/man3
|
35 |
|
|
man4dir = $(mandir)/man4
|
36 |
|
|
man5dir = $(mandir)/man5
|
37 |
|
|
man6dir = $(mandir)/man6
|
38 |
|
|
man7dir = $(mandir)/man7
|
39 |
|
|
man8dir = $(mandir)/man8
|
40 |
|
|
man9dir = $(mandir)/man9
|
41 |
|
|
infodir = $(prefix)/info
|
42 |
|
|
includedir = $(prefix)/include
|
43 |
|
|
|
44 |
|
|
SHELL = /bin/sh
|
45 |
|
|
|
46 |
|
|
# Multilib support variables.
|
47 |
|
|
# TOP is used instead of MULTI{BUILD,SRC}TOP.
|
48 |
|
|
MULTISRCTOP =
|
49 |
|
|
MULTIBUILDTOP =
|
50 |
|
|
MULTIDIRS =
|
51 |
|
|
MULTISUBDIR =
|
52 |
|
|
MULTIDO = true
|
53 |
|
|
MULTICLEAN = true
|
54 |
|
|
|
55 |
|
|
INSTALL = $$srcrootpre/../install-sh -c
|
56 |
|
|
INSTALL_PROGRAM = $(INSTALL)
|
57 |
|
|
INSTALL_DATA = $(INSTALL)
|
58 |
|
|
|
59 |
|
|
AR_FLAGS = qv
|
60 |
|
|
MAKEINFO = makeinfo
|
61 |
|
|
|
62 |
|
|
# We must compile makedoc with a program that runs on the build
|
63 |
|
|
# environment.
|
64 |
|
|
CC_FOR_BUILD = cc
|
65 |
|
|
CFLAGS_FOR_BUILD =
|
66 |
|
|
|
67 |
|
|
TOP = .
|
68 |
|
|
SRCTOP = .
|
69 |
|
|
|
70 |
|
|
machine_dir =
|
71 |
|
|
sys_dir =
|
72 |
|
|
CRT0_DIR =
|
73 |
|
|
CRT0 =
|
74 |
|
|
|
75 |
|
|
#### Host, target, and site specific Makefile fragments come in here.
|
76 |
|
|
###
|
77 |
|
|
|
78 |
|
|
SUBDIRS = libc libm doc testsuite
|
79 |
|
|
|
80 |
|
|
# These are roughly topologically sorted in order to make porting more
|
81 |
|
|
# streamlined.
|
82 |
|
|
FLAGS_TO_PASS = \
|
83 |
|
|
"prefix=$(prefix)" \
|
84 |
|
|
"exec_prefix=$(exec_prefix)" \
|
85 |
|
|
"infodir=$(infodir)" \
|
86 |
|
|
"tooldir=$(tooldir)" \
|
87 |
|
|
"CC=$(CC)" \
|
88 |
|
|
"CFLAGS=$(CFLAGS)" \
|
89 |
|
|
"AR=$(AR)" \
|
90 |
|
|
"AR_FLAGS=$(AR_FLAGS)" \
|
91 |
|
|
"DLLTOOL=$(DLLTOOL)" \
|
92 |
|
|
"RANLIB=$(RANLIB)" \
|
93 |
|
|
"MAKEINFO=$(MAKEINFO)" \
|
94 |
|
|
"INSTALL=$(INSTALL)" \
|
95 |
|
|
"INSTALL_DATA=$(INSTALL_DATA)" \
|
96 |
|
|
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
|
97 |
|
|
"AS=$(AS)" \
|
98 |
|
|
"CROSS_CFLAGS=$(CROSS_CFLAGS)" \
|
99 |
|
|
"TARGET_CFLAGS=$(TARGET_CFLAGS)" \
|
100 |
|
|
"INCLUDES=$(INCLUDES)"
|
101 |
|
|
|
102 |
|
|
# The functions ldexp, frexp and modf are traditionally supplied in
|
103 |
|
|
# both libc.a and libm.a. We build them in libm.a and copy them over,
|
104 |
|
|
# along with some required supporting routines.
|
105 |
|
|
MATHOBJS_IN_LIBC = \
|
106 |
|
|
s_isinf.o sf_isinf.o \
|
107 |
|
|
s_isnan.o sf_isnan.o \
|
108 |
|
|
s_ldexp.o sf_ldexp.o \
|
109 |
|
|
s_frexp.o sf_frexp.o s_modf.o sf_modf.o \
|
110 |
|
|
s_scalbn.o sf_scalbn.o s_finite.o sf_finite.o \
|
111 |
|
|
s_copysign.o sf_copysign.o s_infconst.o
|
112 |
|
|
|
113 |
|
|
all: stmp-targ-include libm.a libc.a $(CRT0) force
|
114 |
|
|
rootpre=`pwd`/; export rootpre; \
|
115 |
|
|
srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre ; \
|
116 |
|
|
$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
|
117 |
|
|
|
118 |
|
|
libc.a: libc/libc.a libm.a
|
119 |
|
|
rm -rf libc.a libg.a tmp
|
120 |
|
|
mkdir tmp
|
121 |
|
|
rootpre=`pwd`/; export rootpre; \
|
122 |
|
|
srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre ; \
|
123 |
|
|
cd tmp ; \
|
124 |
|
|
$(AR) x ../libm.a $(MATHOBJS_IN_LIBC) ; \
|
125 |
|
|
$(AR) x ../libc/libc.a ; \
|
126 |
|
|
$(AR) $(AR_FLAGS) ../$@ *.o
|
127 |
|
|
$(RANLIB) libc.a
|
128 |
|
|
ln libc.a libg.a
|
129 |
|
|
rm -rf tmp
|
130 |
|
|
|
131 |
|
|
libc/libc.a: stmp-targ-include force
|
132 |
|
|
@rootpre=`pwd`/; export rootpre; \
|
133 |
|
|
srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
|
134 |
|
|
cd libc; $(MAKE) $(FLAGS_TO_PASS) all
|
135 |
|
|
|
136 |
|
|
libm.a: libm/libm.a
|
137 |
|
|
rm -f $@
|
138 |
|
|
ln libm/libm.a $@ >/dev/null 2>/dev/null || cp libm/libm.a $@
|
139 |
|
|
|
140 |
|
|
libm/libm.a: stmp-targ-include force
|
141 |
|
|
@rootpre=`pwd`/; export rootpre; \
|
142 |
|
|
srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
|
143 |
|
|
cd libm; $(MAKE) $(FLAGS_TO_PASS)
|
144 |
|
|
|
145 |
|
|
crt0.o: $(CRT0_DIR)/$(CRT0)
|
146 |
|
|
rm -f $@
|
147 |
|
|
ln $(CRT0_DIR)/$(CRT0) $@ >/dev/null 2>/dev/null \
|
148 |
|
|
|| cp $(CRT0_DIR)/$(CRT0) $@
|
149 |
|
|
|
150 |
|
|
$(CRT0_DIR)/$(CRT0): force
|
151 |
|
|
@rootpre=`pwd`/; export rootpre; \
|
152 |
|
|
srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
|
153 |
|
|
(cd $(CRT0_DIR) ; \
|
154 |
|
|
$(MAKE) $(FLAGS_TO_PASS) $(CRT0)) \
|
155 |
|
|
|| exit 1
|
156 |
|
|
|
157 |
|
|
# The targ-include directory just holds the includes files for the
|
158 |
|
|
# particular system and machine we have been configured for. It is
|
159 |
|
|
# used while building.
|
160 |
|
|
stmp-targ-include: config.status
|
161 |
|
|
-rm -rf targ-include stmp-targ-include
|
162 |
|
|
mkdir targ-include targ-include/sys targ-include/machine
|
163 |
|
|
-for i in $(srcdir)/libc/machine/$(machine_dir)/machine/*.h; do \
|
164 |
|
|
if [ -f $$i ]; then \
|
165 |
|
|
cp $$i targ-include/machine/`basename $$i`; \
|
166 |
|
|
else true; fi ; \
|
167 |
|
|
done
|
168 |
|
|
-for i in $(srcdir)/libc/sys/$(sys_dir)/include/*.h; do \
|
169 |
|
|
if [ -f $$i ]; then \
|
170 |
|
|
cp $$i targ-include/`basename $$i`; \
|
171 |
|
|
else true; fi ; \
|
172 |
|
|
done
|
173 |
|
|
-for i in $(srcdir)/libc/sys/$(sys_dir)/sys/*.h; do \
|
174 |
|
|
if [ -f $$i ]; then \
|
175 |
|
|
cp $$i targ-include/sys/`basename $$i`; \
|
176 |
|
|
else true; fi ; \
|
177 |
|
|
done
|
178 |
|
|
touch $@
|
179 |
|
|
|
180 |
|
|
testsuite:
|
181 |
|
|
if [ -d testsuite ]; then \
|
182 |
|
|
(rootme=`pwd`/ ; export rootme ; \
|
183 |
|
|
rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
|
184 |
|
|
cd testsuite; $(MAKE) FLAGS_TO_PASS=$(FLAGS_TO_PASS)); \
|
185 |
|
|
else true ; fi
|
186 |
|
|
|
187 |
|
|
check: force
|
188 |
|
|
if [ -d testsuite ]; then \
|
189 |
|
|
rootme=`pwd`; export rootme; cd testsuite; \
|
190 |
|
|
$(MAKE) $(FLAGS_TO_PASS) check; \
|
191 |
|
|
else true; fi
|
192 |
|
|
|
193 |
|
|
.PHONY: clean-info
|
194 |
|
|
|
195 |
|
|
subdir_do:
|
196 |
|
|
@for i in $(DODIRS); do \
|
197 |
|
|
if [ -f ./$$i/Makefile ] ; then \
|
198 |
|
|
if (cd ./$$i; $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; \
|
199 |
|
|
then true ; \
|
200 |
|
|
else exit 1 ; \
|
201 |
|
|
fi ; \
|
202 |
|
|
else true; \
|
203 |
|
|
fi ; \
|
204 |
|
|
done
|
205 |
|
|
|
206 |
|
|
info dvi docs:
|
207 |
|
|
@rootpre=`pwd`/; export rootpre; \
|
208 |
|
|
srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
|
209 |
|
|
(cd ./doc; $(MAKE) "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
|
210 |
|
|
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
|
211 |
|
|
$(FLAGS_TO_PASS) all);
|
212 |
|
|
@rootpre=`pwd`/; export rootpre; \
|
213 |
|
|
srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
|
214 |
|
|
for i in $(SUBDIRS); do \
|
215 |
|
|
if [ -f ./$$i/Makefile ] ; then \
|
216 |
|
|
if (cd ./$$i; $(MAKE) "CHEW=$(CHEW)" \
|
217 |
|
|
$(FLAGS_TO_PASS) $@) ; \
|
218 |
|
|
then true ; \
|
219 |
|
|
else exit 1 ; \
|
220 |
|
|
fi ; \
|
221 |
|
|
else true; \
|
222 |
|
|
fi ; \
|
223 |
|
|
done
|
224 |
|
|
|
225 |
|
|
clean-here:
|
226 |
|
|
rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
|
227 |
|
|
rm -rf targ-include stmp-targ-include
|
228 |
|
|
|
229 |
|
|
clean: clean-here
|
230 |
|
|
@rootpre=`pwd`/; export rootpre; \
|
231 |
|
|
srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
|
232 |
|
|
$(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
|
233 |
|
|
@$(MULTICLEAN) multi-clean DO=$@
|
234 |
|
|
|
235 |
|
|
mostlyclean:
|
236 |
|
|
rm -f TEMP errs core *.o *~ \#* TAGS *.E
|
237 |
|
|
@rootpre=`pwd`/; export rootpre; \
|
238 |
|
|
srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
|
239 |
|
|
$(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
|
240 |
|
|
@$(MULTICLEAN) multi-clean DO=$@
|
241 |
|
|
|
242 |
|
|
distclean maintainer-clean realclean: clean-here
|
243 |
|
|
@rootpre=`pwd`/; export rootpre; \
|
244 |
|
|
srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
|
245 |
|
|
$(MAKE) DO=$@ DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
|
246 |
|
|
@$(MULTICLEAN) multi-clean DO=$@
|
247 |
|
|
rm -f Makefile config.status
|
248 |
|
|
|
249 |
|
|
install:
|
250 |
|
|
@rootpre=`pwd`/; export rootpre; \
|
251 |
|
|
srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
|
252 |
|
|
$(MAKE) DO=install DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
|
253 |
|
|
# install all the libraries we find
|
254 |
|
|
for i in *.a ; do \
|
255 |
|
|
$(INSTALL_PROGRAM) $$i $(tooldir)/lib$(MULTISUBDIR)/$$i ; \
|
256 |
|
|
done
|
257 |
|
|
# but libg.a is a copy of libc.a
|
258 |
|
|
-rm -f $(tooldir)/lib$(MULTISUBDIR)/libg.a
|
259 |
|
|
ln $(tooldir)/lib$(MULTISUBDIR)/libc.a $(tooldir)/lib$(MULTISUBDIR)/libg.a
|
260 |
|
|
# ranlibize them all
|
261 |
|
|
for i in $(tooldir)/lib$(MULTISUBDIR)/*.a ; do \
|
262 |
|
|
$(RANLIB) $$i ; \
|
263 |
|
|
done
|
264 |
|
|
# now crt0
|
265 |
|
|
-if [ -f crt0.o ] ; then \
|
266 |
|
|
$(INSTALL_PROGRAM) crt0.o $(tooldir)/lib$(MULTISUBDIR)/crt0.o; \
|
267 |
|
|
else true; fi
|
268 |
|
|
# and all the headers
|
269 |
|
|
@$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
|
270 |
|
|
-if [ -z "$(MULTISUBDIR)" ]; then \
|
271 |
|
|
for i in $(srcdir)/libc/include/*.h; do \
|
272 |
|
|
$(INSTALL_DATA) $$i $(tooldir)/include/`basename $$i`; \
|
273 |
|
|
done; \
|
274 |
|
|
for i in $(srcdir)/libc/include/machine/*.h; do \
|
275 |
|
|
$(INSTALL_DATA) $$i $(tooldir)/include/machine/`basename $$i`; \
|
276 |
|
|
done; \
|
277 |
|
|
for i in $(srcdir)/libc/machine/$(machine_dir)/machine/*.h; do \
|
278 |
|
|
if [ -f $$i ]; then \
|
279 |
|
|
$(INSTALL_DATA) $$i $(tooldir)/include/machine/`basename $$i`; \
|
280 |
|
|
else true; fi ; \
|
281 |
|
|
done; \
|
282 |
|
|
for i in $(srcdir)/libc/include/sys/*.h; do \
|
283 |
|
|
$(INSTALL_DATA) $$i $(tooldir)/include/sys/`basename $$i`; \
|
284 |
|
|
done; \
|
285 |
|
|
for i in $(srcdir)/libc/sys/$(sys_dir)/sys/*.h; do \
|
286 |
|
|
if [ -f $$i ]; then \
|
287 |
|
|
$(INSTALL_DATA) $$i $(tooldir)/include/sys/`basename $$i`; \
|
288 |
|
|
else true; fi ; \
|
289 |
|
|
done ; \
|
290 |
|
|
for i in $(srcdir)/libc/sys/$(sys_dir)/include/*.h; do \
|
291 |
|
|
if [ -f $$i ]; then \
|
292 |
|
|
$(INSTALL_DATA) $$i $(tooldir)/include/`basename $$i`; \
|
293 |
|
|
else true; fi ; \
|
294 |
|
|
done ; \
|
295 |
|
|
else true; fi
|
296 |
|
|
|
297 |
|
|
install-info:
|
298 |
|
|
@rootpre=`pwd`/; export rootpre; \
|
299 |
|
|
srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
|
300 |
|
|
$(MAKE) DO=install-info DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
|
301 |
|
|
|
302 |
|
|
clean-info:
|
303 |
|
|
@rootpre=`pwd`/; export rootpre; \
|
304 |
|
|
srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
|
305 |
|
|
$(MAKE) DO=clean-info DODIRS="$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
|
306 |
|
|
|
307 |
|
|
norecurse etags tags: TAGS
|
308 |
|
|
|
309 |
|
|
TAGS: force
|
310 |
|
|
etags `make ls`
|
311 |
|
|
|
312 |
|
|
ls:
|
313 |
|
|
@echo Makefile
|
314 |
|
|
@for i in $(SUBDIRS); \
|
315 |
|
|
do \
|
316 |
|
|
(cd $$i; \
|
317 |
|
|
pwd=`pwd`; \
|
318 |
|
|
wd=`basename $$pwd`; \
|
319 |
|
|
for j in `make ls`; \
|
320 |
|
|
do \
|
321 |
|
|
echo $$wd/$$j; \
|
322 |
|
|
done) \
|
323 |
|
|
done
|
324 |
|
|
|
325 |
|
|
.PHONY: force
|
326 |
|
|
force:
|
327 |
|
|
|
328 |
|
|
## This is ugly, but I don't want GNU make to put these variables in
|
329 |
|
|
## the environment. They are not used here, but are sometimes passed
|
330 |
|
|
## in from the top level Makefile. Older makes will see this as a set
|
331 |
|
|
## of targets with no dependencies and no actions.
|
332 |
|
|
unexport CXX CXX_FOR_TARGET BISON :
|
333 |
|
|
|
334 |
|
|
.NOEXPORT:
|
335 |
|
|
MAKEOVERRIDES=
|
336 |
|
|
|
337 |
|
|
|
338 |
|
|
# with the gnu make, this is done automatically.
|
339 |
|
|
|
340 |
|
|
Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
|
341 |
|
|
$(SHELL) config.status
|
342 |
|
|
|
343 |
|
|
# end of Makefile.in
|