Minor cleanup.
[deliverable/binutils-gdb.git] / Makefile.in
CommitLineData
eb02fd64 1#
131a3881 2# Makefile for directory with subdirs to build.
79337c85 3# Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation
eb02fd64 4#
4dfe09da
RP
5# This file is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
18#
f149eb99 19
eb02fd64 20srcdir = .
28f3b094 21
4d714963 22prefix = /usr/local
eb02fd64 23
7fcfdcf7
SC
24exec_prefix = $(prefix)
25bindir = $(exec_prefix)/bin
26libdir = $(exec_prefix)/lib
2198e4ba 27tooldir = $(libdir)
7fcfdcf7 28
51489233
ILT
29program_transform_name =
30
4d714963 31datadir = $(prefix)/lib
7fcfdcf7 32mandir = $(prefix)/man
4d714963
RP
33man1dir = $(mandir)/man1
34man2dir = $(mandir)/man2
35man3dir = $(mandir)/man3
36man4dir = $(mandir)/man4
37man5dir = $(mandir)/man5
38man6dir = $(mandir)/man6
39man7dir = $(mandir)/man7
40man8dir = $(mandir)/man8
41man9dir = $(mandir)/man9
7fcfdcf7 42infodir = $(prefix)/info
4d714963
RP
43includedir = $(prefix)/include
44docdir = $(datadir)/doc
45
46SHELL = /bin/sh
47
378fd382 48INSTALL = cp
4d714963
RP
49INSTALL_PROGRAM = $(INSTALL)
50INSTALL_DATA = $(INSTALL)
3c8735af 51
440868a0 52AS = as
ec342d7d 53AR = ar
b5329d84 54AR_FLAGS = rc
e85e07cb 55CC = cc
f8a6ad66 56CFLAGS = -g
a4e879a1 57# start-sanitize-chill
7d9f0c54
MW
58CHILLFLAGS = $(CFLAGS)
59CHILL_LIB = -lchill
a4e879a1 60# end-sanitize-chill
e85e07cb 61CXX = gcc
d1bea4c7 62CXXFLAGS = -g -O
4d714963 63RANLIB = ranlib
51489233 64NM = nm
81246025 65GZIP = gzip
85216403 66COMPRESS = compress
eb02fd64 67
40e16078 68# BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
98a33b6d 69BISON = `if [ -f $${rootme}/byacc/byacc ] ; \
06a07944 70 then echo $${rootme}/byacc/byacc ; \
378fd382 71 else echo byacc ; \
06a07944 72 fi`
2645fb0c 73
98a33b6d 74LEX = `if [ -f $${rootme}/flex/flex ] ; \
8b361a95 75 then echo $${rootme}/flex/flex ; \
2198e4ba
MT
76 else echo flex ; fi`
77
6d681784
JG
78MAKEINFO = `if [ -f $${rootme}/texinfo/makeinfo/makeinfo ] ; \
79 then echo $${rootme}/texinfo/makeinfo/makeinfo ; \
77806c3e 80 else echo makeinfo ; fi`
b772d75e 81
6a42d184
DZ
82RUNTEST = `if [ -f $${rootme}/dejagnu/runtest ] ; \
83 then echo EXPECT=$${rootme}/expect/expect $${rootme}/dejagnu/runtest ; \
84 else echo runtest ; fi`
85
f980fcfb
JG
86
87# libraries that may need to be augmented on a system-by-system basis
88X11_LIB = -lX11
89
e85e07cb 90# compilers to use to create programs which must be run in the build
440868a0
ILT
91# environment.
92CC_FOR_BUILD = $(CC)
e85e07cb 93CXX_FOR_BUILD = $(CXX)
440868a0 94
9f73dd6a 95SUBDIRS = "this is set via configure, don't edit this"
6a3958b2
RP
96OTHERS =
97
a0f47eb7 98ALL = all.normal
b26ff9d8 99INSTALL_TARGET = install.all
fb660409 100
51489233
ILT
101CC_FOR_TARGET = ` \
102 if [ -f $${rootme}/gcc/Makefile ] ; then \
31883f01 103 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
51489233 104 else \
378fd382 105 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
106 echo $(CC); \
107 else \
108 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
109 fi; \
110 fi`
111
a4e879a1 112# start-sanitize-chill
7d9f0c54
MW
113CHILL_FOR_TARGET = ` \
114 if [ -f $${rootme}/gcc/Makefile ] ; then \
115 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/ -L$${rootme}/chillrt/; \
116 else \
117 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
118 echo $(CC); \
119 else \
120 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
121 fi; \
122 fi`
34b3298b 123
a4e879a1 124# end-sanitize-chill
7d9f0c54 125
d1bea4c7 126CXX_FOR_TARGET = ` \
fca4f908 127 if [ -f $${rootme}/gcc/Makefile ] ; then \
31883f01 128 echo $${rootme}/gcc/xgcc -B$${rootme}/gcc/; \
fca4f908 129 else \
e85e07cb
ILT
130 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
131 echo $(CXX); \
fca4f908
MW
132 else \
133 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
134 fi; \
135 fi`
136
440868a0
ILT
137AS_FOR_TARGET = ` \
138 if [ -f $${rootme}/gas/Makefile ] ; then \
139 echo $${rootme}/gas/as.new ; \
140 else \
e85e07cb 141 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
440868a0
ILT
142 echo $(AS); \
143 else \
144 t='$(program_transform_name)'; echo as | sed -e '' $$t ; \
81246025 145 fi; \
440868a0
ILT
146 fi`
147
51489233
ILT
148AR_FOR_TARGET = ` \
149 if [ -f $${rootme}/binutils/Makefile ] ; then \
150 echo $${rootme}/binutils/ar ; \
151 else \
378fd382 152 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
153 echo $(AR); \
154 else \
155 t='$(program_transform_name)'; echo ar | sed -e '' $$t ; \
81246025 156 fi; \
51489233
ILT
157 fi`
158
159RANLIB_FOR_TARGET = ` \
160 if [ -f $${rootme}/binutils/Makefile ] ; then \
161 echo $${rootme}/binutils/ranlib ; \
162 else \
378fd382 163 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
164 echo $(RANLIB); \
165 else \
166 t='$(program_transform_name)'; echo ranlib | sed -e '' $$t ; \
81246025 167 fi; \
51489233
ILT
168 fi`
169
170NM_FOR_TARGET = ` \
171 if [ -f $${rootme}/binutils/Makefile ] ; then \
172 echo $${rootme}/binutils/nm ; \
173 else \
378fd382 174 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
51489233
ILT
175 echo $(NM); \
176 else \
177 t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
81246025 178 fi; \
51489233
ILT
179 fi`
180
0ef4728f 181# FIXME: This is badly named.
51489233
ILT
182XTRAFLAGS = ` \
183 if [ -f $${rootme}/gcc/Makefile ] ; then \
9d401625
ILT
184 if [ -f $${rootme}/newlib/Makefile ] ; then \
185 echo -I$${rootme}/newlib/targ-include -I$${srcroot}/newlib/libc/include -I$${rootme}/gcc/include -nostdinc ; \
51489233 186 else \
9d401625 187 echo -I$${rootme}/gcc/include ; \
51489233
ILT
188 fi ; \
189 else \
190 echo ; \
191 fi`
23e3e7f9 192
1a14993c 193PRMS = install-prms
b1cceba2 194
eb02fd64 195#### host and target specific makefile fragments come in here.
ec342d7d 196###
eb02fd64 197
0ef4728f
ILT
198# Flags to pass down to all sub-makes.
199# Please keep these in alphabetical order.
200BASE_FLAGS_TO_PASS = \
2198e4ba 201 "AR_FLAGS=$(AR_FLAGS)" \
d09de70e 202 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
0ef4728f 203 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
378fd382 204 "BISON=$(BISON)" \
378fd382 205 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
0ef4728f 206 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
2198e4ba 207 "CFLAGS=$(CFLAGS)" \
a4e879a1 208 $(start-sanitize-chill)\
7d9f0c54
MW
209 "CHILLFLAGS=$(CHILLFLAGS)" \
210 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
211 "CHILL_LIB=$(CHILL_LIB)" \
a4e879a1 212 $(end-sanitize-chill)\
0ef4728f
ILT
213 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
214 "CXXFLAGS=$(CXXFLAGS)" \
215 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
53222cbd 216 'GCC_FOR_TARGET=$$(CC_FOR_TARGET)' \
2198e4ba
MT
217 "INSTALL=$(INSTALL)" \
218 "INSTALL_DATA=$(INSTALL_DATA)" \
440868a0 219 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
378fd382
DZ
220 "LDFLAGS=$(LDFLAGS)" \
221 "LEX=$(LEX)" \
222 "LOADLIBES=$(LOADLIBES)" \
223 "MAKEINFO=$(MAKEINFO)" \
0ef4728f 224 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
72c09fbc 225 "PRMS=$(PRMS)" \
d09de70e 226 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
6a42d184 227 "RUNTEST=$(RUNTEST)" \
0ef4728f 228 "XTRAFLAGS_FOR_TARGET=$(XTRAFLAGS)" \
378fd382
DZ
229 "exec_prefix=$(exec_prefix)" \
230 "prefix=$(prefix)" \
231 "tooldir=$(tooldir)"
2198e4ba 232
0ef4728f
ILT
233# Flags to pass down to most sub-makes, in which we're building with
234# the host environment.
6d681784 235# If any variables are added here, they must be added to do-*, below.
0ef4728f 236EXTRA_HOST_FLAGS = \
6d681784
JG
237 'AR=$(AR)' \
238 'AS=$(AS)' \
239 'CC=$(CC)' \
240 'CXX=$(CXX)' \
241 'NM=$(NM)' \
242 'RANLIB=$(RANLIB)' \
243 'XTRAFLAGS='
0ef4728f
ILT
244
245FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
246
d1bea4c7
DZ
247# Flags that are concerned with the location of the X11 include files
248# and library files
249X11_FLAGS_TO_PASS = \
250 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
f980fcfb
JG
251 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
252 "X11_LIB=$(X11_LIB)"
d1bea4c7 253
0ef4728f
ILT
254# Flags to pass down to makes which are built with the target environment.
255# The double $ decreases the length of the command line; the variables
256# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
6d681784 257# If any variables are added here, they must be added to do-*, below.
0ef4728f
ILT
258EXTRA_TARGET_FLAGS = \
259 'AR=$$(AR_FOR_TARGET)' \
260 'AS=$$(AS_FOR_TARGET)' \
261 'CC=$$(CC_FOR_TARGET)' \
262 'CXX=$$(CXX_FOR_TARGET)' \
263 'NM=$$(NM_FOR_TARGET)' \
264 'RANLIB=$$(RANLIB_FOR_TARGET)' \
265 'XTRAFLAGS=$$(XTRAFLAGS_FOR_TARGET)'
266
267TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
51489233 268
f4e414f1
ILT
269# Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
270# unfortunately needs the native compiler and the target ar and
0ef4728f 271# ranlib.
6d681784 272# If any variables are added here, they must be added to do-*, below.
0ef4728f
ILT
273EXTRA_GCC_FLAGS = \
274 'AR=$$(AR_FOR_TARGET)' \
6d681784
JG
275 'AS=$(AS)' \
276 'CC=$(CC)' \
277 'CXX=$(CXX)' \
278 'NM=$(NM)' \
0ef4728f 279 'RANLIB=$$(RANLIB_FOR_TARGET)' \
6d681784 280 'XTRAFLAGS='
0ef4728f 281
34b3298b 282GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
f4e414f1 283
6a42d184 284# This is a list of the targets for all of the modules which are compiled
79337c85
ILT
285# using $(FLAGS_TO_PASS).
286ALL_MODULES = \
287 all-autoconf \
288 all-bfd \
289 all-binutils \
290 all-byacc \
291 all-cvs \
292 all-dejagnu \
293 all-diff \
294 all-etc \
295 all-fileutils \
296 all-find \
297 all-flex \
298 all-gas \
299 all-gawk \
300 all-gdb \
301 all-gprof \
302 all-grep \
303 all-gzip \
304 all-hello \
305 all-indent \
306 all-ispell \
307 all-ld \
308 all-libiberty \
309 all-m4 \
310 all-make \
311 all-mmalloc \
312 all-opcodes \
313 all-patch \
314 all-prms \
315 all-rcs \
316 all-readline \
317 all-recode \
318 all-sed \
319 all-send-pr \
320 all-shellutils \
321 all-sim \
322 all-tar \
323 all-tcl \
324 all-texinfo \
325 all-textutils \
326 all-tgas \
327 all-time \
328 all-uudecode \
329 all-wdiff
330
6a42d184
DZ
331# This is a list of the check targets for all of the modules which are
332# compiled using $(FLAGS_TO_PASS).
333CHECK_MODULES = \
334 check-autoconf \
335 check-bfd \
336 check-binutils \
337 check-byacc \
338 check-cvs \
339 check-dejagnu \
340 check-diff \
341 check-etc \
342 check-fileutils \
343 check-find \
344 check-flex \
345 check-gas \
346 check-gawk \
347 check-gdb \
348 check-gprof \
349 check-grep \
350 check-gzip \
351 check-hello \
352 check-indent \
353 check-ispell \
354 check-ld \
355 check-libiberty \
356 check-m4 \
357 check-make \
358 check-mmcheckoc \
359 check-opcodes \
360 check-patch \
361 check-prms \
362 check-rcs \
363 check-readline \
364 check-recode \
365 check-sed \
366 check-send-pr \
367 check-shellutils \
368 check-sim \
369 check-tar \
370 check-tcl \
371 check-texinfo \
372 check-textutils \
373 check-tgas \
374 check-time \
375 check-uudecode \
376 check-wdiff
377
378# This is a list of the install targets for all of the modules which are
79337c85
ILT
379# compiled using $(FLAGS_TO_PASS).
380INSTALL_MODULES = \
381 install-autoconf \
382 install-bfd \
383 install-binutils \
384 install-byacc \
385 install-cvs \
386 install-dejagnu \
387 install-diff \
388 install-etc \
389 install-fileutils \
390 install-find \
391 install-flex \
392 install-gas \
393 install-gawk \
394 install-gdb \
395 install-glob \
396 install-gprof \
397 install-grep \
398 install-gzip \
399 install-hello \
400 install-indent \
401 install-ispell \
402 install-ld \
403 install-libiberty \
404 install-m4 \
405 install-make \
406 install-mmalloc \
407 install-opcodes \
408 install-patch \
409 install-prms \
410 install-rcs \
411 install-readline \
412 install-recode \
413 install-sed \
414 install-send-pr \
415 install-shellutils \
416 install-sim \
417 install-tar \
418 install-tcl \
419 install-texinfo \
420 install-textutils \
421 install-tgas \
422 install-time \
423 install-uudecode \
424 install-wdiff
425
6a42d184 426# This is a list of the targets for all of the modules which are compiled
79337c85
ILT
427# using $(X11_FLAGS_TO_PASS).
428ALL_X11_MODULES = \
429 all-emacs \
430 all-expect \
431 all-tclX \
432 all-tk
433
6a42d184
DZ
434# This is a list of the check targets for all of the modules which are
435# compiled using $(X11_FLAGS_TO_PASS).
436CHECK_X11_MODULES = \
437 check-emacs \
438 check-expect \
439 check-tclX \
440 check-tk
441
79337c85
ILT
442# This is a list of the install targets for all the modules which are
443# compiled using $(X11_FLAGS_TO_PASS).
444INSTALL_X11_MODULES = \
445 install-emacs \
446 install-expect \
447 install-tclX \
448 install-tk
fca4f908 449
6a42d184 450# This is a list of the targets for all of the modules which are compiled
79337c85
ILT
451# using $(TARGET_FLAGS_TO_PASS).
452ALL_TARGET_MODULES = \
453 $(start-sanitize-chill) \
454 all-chillrt \
455 $(end-sanitize-chill) \
456 all-libg++ \
457 all-newlib \
458 all-xiberty
459
6a42d184
DZ
460# This is a list of the check targets for all of the modules which are
461# compiled using $(TARGET_FLAGS_TO_PASS).
462CHECK_TARGET_MODULES = \
463 $(start-sanitize-chill) \
464 check-chillrt \
465 $(end-sanitize-chill) \
466 check-libg++ \
467 check-newlib \
468 check-xiberty
469
470# This is a list of the install targets for all of the modules which are
79337c85
ILT
471# compiled using $(TARGET_FLAGS_TO_PASS).
472INSTALL_TARGET_MODULES = \
473 $(start-sanitize-chill) \
474 install-chillrt \
475 $(end-sanitize-chill) \
476 install-libg++ \
477 install-newlib \
478 install-xiberty
4d714963 479
79337c85
ILT
480# This is a shell case of all modules which are compiled using
481# $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
482TARGET_LIBS = libg++ | newlib | xiberty
a4e879a1 483# start-sanitize-chill
79337c85 484TARGET_LIBS = chillrt | libg++ | newlib | xiberty
a4e879a1 485# end-sanitize-chill
7481617f 486
79337c85
ILT
487# The first rule in the file had better be this one. Don't put any above it.
488all: $(ALL)
489.PHONY: all
490
491# The target built for a native build.
492.PHONY: all.normal
493all.normal: \
494 $(ALL_MODULES) \
495 $(ALL_TARGET_MODULES) \
46d0ca81 496 $(ALL_X11_MODULES) \
79337c85
ILT
497 all-gcc
498
499# The target built for a cross build.
500.PHONY: all.cross
501all.cross: \
502 all-bfd \
503 all-binutils \
504 all-byacc \
505 all-dejagnu \
506 all-flex \
507 all-gas \
508 all-gcc \
509 all-gdb \
510 all-ld \
511 all-libiberty \
512 all-mmalloc \
513 all-opcodes \
514 all-readline \
515 all-sim \
516 $(ALL_TARGET_MODULES)
517
0ef4728f 518# Do a target for all the subdirectories. A ``make do-X'' will do a
53222cbd
RP
519# ``make X'' in all subdirectories (because, in general, there is a
520# dependency (below) of X upon do-X, a ``make X'' will also do this,
521# but it may do additional work as well).
0ef4728f
ILT
522# This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
523# because it is so large that it can easily overflow the command line
524# length limit on some systems.
79337c85
ILT
525DO_X = \
526 do-check \
527 do-clean \
528 do-distclean \
529 do-dvi \
530 do-info \
531 do-install-info \
532 do-installcheck \
533 do-mostlyclean \
534 do-realclean
535.PHONY: $(DO_X)
536$(DO_X):
0ef4728f
ILT
537 @target=`echo $@ | sed -e 's/^do-//'`; \
538 rootme=`pwd`; export rootme; \
539 srcroot=`cd $(srcdir); pwd`; export srcroot; \
540 for i in $(SUBDIRS); do \
36286a3e 541 if [ -f ./$$i/Makefile ]; then \
0ef4728f
ILT
542 case $$i in \
543 $(TARGET_LIBS) ) \
6d681784
JG
544 for flag in $(EXTRA_TARGET_FLAGS); do \
545 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
546 done; \
0ef4728f
ILT
547 ;; \
548 gcc) \
6d681784
JG
549 for flag in $(EXTRA_GCC_FLAGS); do \
550 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
551 done; \
0ef4728f
ILT
552 ;; \
553 *) \
6d681784
JG
554 for flag in $(EXTRA_HOST_FLAGS); do \
555 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
556 done; \
0ef4728f
ILT
557 ;; \
558 esac ; \
6d681784 559 export AR AS CC CXX NM RANLIB XTRAFLAGS; \
0ef4728f 560 if (cd ./$$i; \
6d681784
JG
561 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
562 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
563 "RANLIB=$${RANLIB}" "XTRAFLAGS=$${XTRAFLAGS}" \
564 $${target}); \
0ef4728f
ILT
565 then true; else exit 1; fi; \
566 else true; fi; \
567 done
fb90daeb 568
79337c85
ILT
569# Here are the targets which correspond to the do-X targets.
570
571.PHONY: info check installcheck dvi install-info
572.PHONY: clean distclean mostlyclean realclean local-clean local-distclean
0ef4728f
ILT
573info: do-info
574check: do-check
1a14993c 575installcheck: do-installcheck
0ef4728f 576dvi: do-dvi
9a9e8e7f 577
0ef4728f 578install-info: install-info-dirs do-install-info dir.info
72c09fbc
SC
579 if [ -f dir.info ] ; then \
580 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
50fbe976 581 else true ; fi
4d714963 582
0ef4728f
ILT
583do-install-info: install-info-dirs
584
0ef4728f 585local-clean:
7fed4078 586 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
3b30df82 587
0ef4728f 588local-distclean:
7fed4078 589 -rm -f Makefile config.status
7fcfdcf7 590
0ef4728f
ILT
591clean: do-clean local-clean
592mostlyclean: do-mostlyclean local-clean
593distclean: do-distclean local-clean local-distclean
594realclean: do-realclean local-clean local-distclean
595
79337c85 596# Installation targets.
4d714963 597
79337c85 598.PHONY: install uninstall
98a33b6d 599install: $(INSTALL_TARGET)
b26ff9d8 600
79337c85
ILT
601uninstall:
602 @echo "the uninstall target is not supported in this tree"
603
604.PHONY: install.all
06a07944
RP
605install.all: install-no-fixedincludes
606 @if [ -f ./gcc/Makefile ] ; then \
607 rootme=`pwd` ; export rootme ; \
608 (cd ./gcc; \
609 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
610 else \
611 true ; \
612 fi
5a63b336 613
79337c85
ILT
614# install-no-fixedincludes is used because Cygnus can not distributed
615# the fixed header files.
616.PHONY: install-no-fixedincludes
617install-no-fixedincludes: \
618 install-dirs \
619 gcc-no-fixedincludes \
620 $(INSTALL_MODULES) \
621 $(INSTALL_TARGET_MODULES) \
622 $(INSTALL_X11_MODULES)
d1bea4c7 623
5cc24596 624# Install the gcc headers files, but not the fixed include files,
79337c85
ILT
625# which Cygnus is not allowed to distribute. This rule is very
626# dependent on the workings of the gcc Makefile.in.
627.PHONY: gcc-no-fixedincludes
06a07944 628gcc-no-fixedincludes:
5cc24596
PB
629 @if [ -f ./gcc/Makefile ]; then \
630 rm -rf gcc/tmp-include; \
631 mv gcc/include gcc/tmp-include 2>/dev/null; \
632 mkdir gcc/include; \
633 touch gcc/stmp-fixincludes; \
634 rm -f gcc/stmp-headers; \
635 rootme=`pwd`; export rootme; \
636 srcroot=`cd $(srcdir); pwd` ; export srcroot; \
637 (cd ./gcc; \
638 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
639 rm -rf gcc/include; \
640 mv gcc/tmp-include gcc/include 2>/dev/null; \
641 else true; fi
dcbfc14d 642
79337c85
ILT
643.PHONY: install.cross
644install.cross: \
645 install-dirs \
646 install-binutils \
647 install-byacc \
648 install-dejagnu \
649 install-etc \
650 install-flex \
651 install-gas \
652 install-gcc \
653 install-gdb \
654 install-glob \
655 install-ld \
656 install-libiberty \
657 install-mmalloc \
658 install-opcodes \
659 install-readline \
660 $(INSTALL_TARGET_MODULES)
661
662# This rule is used to build the modules which use FLAGS_TO_PASS. To
663# build a target all-X means to cd to X and make all.
664# all-glob is handled specially because it doesn't actually build.
665.PHONY: $(ALL_MODULES) all-glob
666$(ALL_MODULES) all-glob:
667 @dir=`echo $@ | sed -e 's/all-//'`; \
668 if [ -f ./$${dir}/Makefile ] ; then \
669 rootme=`pwd`; export rootme; \
670 srcroot=`cd $(srcdir); pwd`; export srcroot; \
671 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
07362bd9 672 else \
79337c85 673 true; \
07362bd9
DZ
674 fi
675
6a42d184
DZ
676# This rule is used to check the modules which use FLAGS_TO_PASS. To
677# build a target check-X means to cd to X and make all.
678.PHONY: $(CHECK_MODULES)
679$(CHECK_MODULES):
680 @dir=`echo $@ | sed -e 's/check-//'`; \
681 if [ -f ./$${dir}/Makefile ] ; then \
682 rootme=`pwd`; export rootme; \
683 srcroot=`cd $(srcdir); pwd`; export srcroot; \
684 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
685 else \
686 true; \
687 fi
688
79337c85
ILT
689# This rule is used to install the modules which use FLAGS_TO_PASS.
690# To build a target install-X means to cd to X and make install.
691.PHONY: $(INSTALL_MODULES)
692$(INSTALL_MODULES): install-dirs
693 @dir=`echo $@ | sed -e 's/install-//'`; \
694 if [ -f ./$${dir}/Makefile ] ; then \
695 rootme=`pwd`; export rootme; \
696 srcroot=`cd $(srcdir); pwd`; export srcroot; \
697 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
07362bd9 698 else \
79337c85 699 true; \
07362bd9
DZ
700 fi
701
6a42d184
DZ
702# This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
703# To build a target all-X means to cd to X and make all.
79337c85
ILT
704.PHONY: $(ALL_TARGET_MODULES)
705$(ALL_TARGET_MODULES):
706 @dir=`echo $@ | sed -e 's/all-//'`; \
707 if [ -f ./$${dir}/Makefile ] ; then \
708 rootme=`pwd`; export rootme; \
709 srcroot=`cd $(srcdir); pwd`; export srcroot; \
710 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
07362bd9 711 else \
79337c85 712 true; \
07362bd9
DZ
713 fi
714
6a42d184
DZ
715# This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
716# To build a target install-X means to cd to X and make install.
717.PHONY: $(CHECK_TARGET_MODULES)
718$(CHECK_TARGET_MODULES):
719 @dir=`echo $@ | sed -e 's/check-//'`; \
720 if [ -f ./$${dir}/Makefile ] ; then \
721 rootme=`pwd`; export rootme; \
722 srcroot=`cd $(srcdir); pwd`; export srcroot; \
723 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
724 else \
725 true; \
726 fi
727
79337c85
ILT
728# This rule is used to install the modules which use
729# TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
730# and make install.
731.PHONY: $(INSTALL_TARGET_MODULES)
732$(INSTALL_TARGET_MODULES): install-dirs
733 @dir=`echo $@ | sed -e 's/install-//'`; \
734 if [ -f ./$${dir}/Makefile ] ; then \
735 rootme=`pwd`; export rootme; \
736 srcroot=`cd $(srcdir); pwd`; export srcroot; \
737 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
07362bd9 738 else \
79337c85 739 true; \
07362bd9
DZ
740 fi
741
6a42d184 742# This rule is used to build the modules which use X11_FLAGS_TO_PASS.
79337c85
ILT
743# To build a target all-X means to cd to X and make all.
744.PHONY: $(ALL_X11_MODULES)
745$(ALL_X11_MODULES):
746 @dir=`echo $@ | sed -e 's/all-//'`; \
747 if [ -f ./$${dir}/Makefile ] ; then \
748 rootme=`pwd`; export rootme; \
749 srcroot=`cd $(srcdir); pwd`; export srcroot; \
750 (cd $${dir}; \
751 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
07362bd9 752 else \
79337c85 753 true; \
07362bd9
DZ
754 fi
755
6a42d184
DZ
756# This rule is used to check the modules which use X11_FLAGS_TO_PASS.
757# To build a target check-X means to cd to X and make all.
758.PHONY: $(CHECK_X11_MODULES)
759$(CHECK_X11_MODULES):
760 @dir=`echo $@ | sed -e 's/check-//'`; \
761 if [ -f ./$${dir}/Makefile ] ; then \
762 rootme=`pwd`; export rootme; \
763 srcroot=`cd $(srcdir); pwd`; export srcroot; \
764 (cd $${dir}; \
765 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
766 else \
767 true; \
768 fi
769
770# This rule is used to install the modules which use X11_FLAGS_TO_PASS.
79337c85
ILT
771# To build a target install-X means to cd to X and make install.
772.PHONY: $(INSTALL_X11_MODULES)
773$(INSTALL_X11_MODULES):
6a42d184 774 @dir=`echo $@ | sed -e 's/install-//'`; \
79337c85
ILT
775 if [ -f ./$${dir}/Makefile ] ; then \
776 rootme=`pwd`; export rootme; \
777 srcroot=`cd $(srcdir); pwd`; export srcroot; \
778 (cd $${dir}; \
779 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
07362bd9 780 else \
79337c85 781 true; \
07362bd9
DZ
782 fi
783
79337c85
ILT
784# gcc is the only module which uses GCC_FLAGS_TO_PASS.
785.PHONY: all-gcc
786all-gcc:
787 @if [ -f ./gcc/Makefile ] ; then \
788 rootme=`pwd`; export rootme; \
789 srcroot=`cd $(srcdir); pwd`; export srcroot; \
790 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
07362bd9 791 else \
79337c85 792 true; \
07362bd9
DZ
793 fi
794
79337c85
ILT
795.PHONY: install-gcc
796install-gcc:
797 @if [ -f ./gcc/Makefile ] ; then \
798 rootme=`pwd`; export rootme; \
799 srcroot=`cd $(srcdir); pwd`; export srcroot; \
800 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
07362bd9 801 else \
79337c85 802 true; \
07362bd9
DZ
803 fi
804
79337c85
ILT
805# This is a list of inter-dependencies among modules.
806all-autoconf:
807all-bfd:
808all-binutils: all-libiberty all-opcodes all-bfd all-flex
809all-byacc:
810# start-sanitize-chill
811all-chillrt: all-binutils all-gas all-gcc all-newlib
812# end-sanitize-chill
813all-cvs:
814all-dejagnu:
815all-diff: all-libiberty
816all-emacs:
817all-etc:
818all-expect: all-tcl
819all-fileutils:
820all-find:
7dcc0664 821all-flex: all-libiberty all-byacc
79337c85
ILT
822all-gas: all-libiberty all-opcodes all-bfd
823all-gawk:
824all-gcc: all-libiberty all-byacc all-binutils all-gas
825all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc
826all-glob:
827all-gprof: all-libiberty all-bfd
828all-grep:
829all-gzip: all-libiberty
830all-hello: all-libiberty
831all-indent:
832all-ispell: all-emacs
833all-ld: all-libiberty all-bfd all-byacc all-flex
834all-libg++: all-gas all-ld all-gcc all-xiberty all-newlib
835all-libiberty:
836all-m4: all-libiberty
837all-make: all-libiberty
838all-mmalloc:
839all-newlib: all-binutils all-gas all-gcc
840all-opcodes:
841all-patch:
842all-prms:
843all-rcs:
844all-readline:
845all-recode: all-libiberty
846all-sed:
847all-send-pr:
848all-shellutils:
849all-sim: all-libiberty all-bfd
07362bd9 850all-tar: all-libiberty
79337c85
ILT
851all-tcl:
852all-tclX: all-tcl all-tk
853all-tk: all-tcl
854all-texinfo: all-libiberty
855all-textutils:
856all-tgas: all-libiberty all-bfd
857all-time:
858all-wdiff:
859all-uudecode: all-libiberty
860all-xiberty: all-gcc all-newlib
07362bd9 861
79337c85 862### other supporting targets
07362bd9 863
79337c85
ILT
864MAKEDIRS= \
865 $(prefix) \
866 $(exec_prefix) \
867 $(tooldir)
fca4f908 868
79337c85
ILT
869.PHONY: install-dirs
870install-dirs:
871 @for i in $(MAKEDIRS) ; do \
872 echo Making $$i... ; \
873 parent=`echo $$i|sed -e 's@/[^/]*$$@@'`; \
874 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
875 if [ ! -d $$i ] ; then \
876 if mkdir $$i ; then \
877 true ; \
878 else \
879 exit 1 ; \
880 fi ; \
881 else \
882 true ; \
883 fi ; \
884 done
23e3e7f9 885
79337c85
ILT
886.PHONY: install-info-dirs
887install-info-dirs:
888 if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; fi
889 -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
890 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
891 -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
618f57a9 892
79337c85
ILT
893dir.info: do-install-info
894 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
895 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
896 mv -f dir.info.new dir.info ; \
897 else true ; \
72c09fbc 898 fi
6b7e5998 899
b1cceba2
DZ
900dist:
901 @echo "Building a full distribution of this tree isn't done"
902 @echo "via 'make dist'. Check out the etc/ subdirectory"
903
eb02fd64
RP
904etags tags: TAGS
905
02a7ba9a 906TAGS:
eb02fd64
RP
907 etags `$(MAKE) ls`
908
909ls:
910 @echo Makefile
911 @for i in $(SUBDIRS); \
912 do \
913 (cd $$i; \
914 pwd=`pwd`; \
915 wd=`basename $$pwd`; \
916 for j in `$(MAKE) ls`; \
917 do \
918 echo $$wd/$$j; \
919 done) \
920 done
921
eb02fd64
RP
922# with the gnu make, this is done automatically.
923
f1eb48b6 924Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 925 $(SHELL) ./config.status
eb02fd64 926
11954bf1
JG
927#
928# Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
929
d94d255d 930DEVO_SUPPORT= README Makefile.in configure configure.in \
6d681784
JG
931 config.guess config.sub config move-if-change
932ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
933 configure.texi
72c09fbc 934GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob sim
d94d255d 935GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS)
11954bf1 936
79337c85
ILT
937.PHONY: setup-dirs-gdb gdb.tar.Z make-gdb.tar.Z
938setup-dirs-gdb:
11954bf1 939 ./configure sun4
53222cbd 940 $(MAKE) clean
11954bf1 941 ./configure -rm sun4
42187387 942 chmod og=u `find etc $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
abc52b80 943
40e16078 944gdb.tar.Z: setup-dirs-gdb
42187387 945 (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir BISON="byacc")
abc52b80
JG
946 $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z
947
f980fcfb 948make-gdb.tar.Z: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/texinfo.tex
abc52b80
JG
949 rm -rf proto-toplev; mkdir proto-toplev
950 ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
951 (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
952 ln -s ../$$i . ; \
953 done)
6d681784
JG
954 mkdir proto-toplev/etc
955 (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
956 ln -s ../../etc/$$i . ; \
957 done)
7c9feeb7
RP
958 # Put only one copy (four hard links) of COPYING in the tar file.
959 rm proto-toplev/bfd/COPYING
960 ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
961 rm proto-toplev/include/COPYING
962 ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
963 rm proto-toplev/readline/COPYING
964 ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
a50b5d9d
JG
965
966 # Take out texinfo and glob from configurable dirs
a3a063a9 967 rm proto-toplev/configure.in
a50b5d9d
JG
968 sed -e '/^host_tools=/s/texinfo //' \
969 -e '/^host_libs=/s/glob //' \
970 <configure.in >proto-toplev/configure.in
6995fe83 971
a50b5d9d
JG
972 # Take out texinfo from a few places; make simple BISON=bison line.
973 rm proto-toplev/Makefile.in
974 sed -e '/^all\.normal: /s/\all-texinfo //' \
975 -e '/^ install-texinfo /d' \
40e16078
KR
976 -e '/^BISON = /,/^$$/d' \
977 -e '/^# BISON:/s/.*/BISON = bison -y/' \
6995fe83
SG
978 <Makefile.in >proto-toplev/Makefile.in
979
abc52b80 980 mkdir proto-toplev/texinfo
a50b5d9d 981 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
81246025 982 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
905bb120 983 chmod og=u `find proto-toplev -print`
abc52b80 984 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
abc52b80 985 ln -s proto-toplev gdb-$$VER; \
85216403
FF
986 echo "==> Making gdb-$$VER.tar.Z"; \
987 tar cfh - gdb-$$VER | $(COMPRESS) -v >gdb-$$VER.tar.Z; \
988 echo "==> Making gdb-$$VER.tar.z"; \
989 tar cfh - gdb-$$VER | $(GZIP) -v -9 >gdb-$$VER.tar.z)
0ec776a5 990
40e16078
KR
991# When you use `make setup-dirs' or `make taz' you should always redefine
992# this macro.
993SUPPORT_FILES = list-of-support-files-for-tool-in-question
994# Directories that might want `make proto-dir' run.
995PROTODIRS= gdb
996
79337c85
ILT
997.PHONY: setup-dirs taz
998setup-dirs:
40e16078
KR
999 ./configure sun4
1000 $(MAKE) clean
1001 ./configure -rm sun4
1002 chmod og=u `find etc $(DEVO_SUPPORT) $(SUPPORT_FILES) -print`
1003 for d in .. $(PROTODIRS) ; do \
1004 if [ $$d != ".." ] && [ -d $$d ]; then \
1005 (cd $$d ; $(MAKE) -f Makefile.in proto-dir) ; \
1006 else true ; fi ; \
1007 done
1008
1009taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1010 rm -rf proto-toplev; mkdir proto-toplev
1011 for d in .. $(PROTODIRS) ; do \
1012 if [ $$d != .. ]; then \
1013 if [ -d $$d ]; then \
1014 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1015 else true ; fi ; \
1016 else true ; fi ; \
1017 done
79337c85 1018 (cd proto-toplev; for i in $(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES); do \
40e16078
KR
1019 if [ ! -d $$i ]; then ln -s ../$$i . ; else true ; fi ; \
1020 done)
1021 mkdir proto-toplev/etc
1022 (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
1023 ln -s ../../etc/$$i . ; \
1024 done)
1025 # Put only one copy (four hard links) of COPYING in the tar file.
1026 ## FIX ME LATER
1027
1028 # Take out texinfo and glob from configurable dirs
1029 rm proto-toplev/configure.in
1030 sed -e '/^host_tools=/s/texinfo //' \
1031 -e '/^host_libs=/s/glob //' \
1032 <configure.in >proto-toplev/configure.in
1033
1034 # Take out texinfo from a few places; make simple BISON=bison line.
1035 rm proto-toplev/Makefile.in
1036 sed -e '/^all\.normal: /s/\all-texinfo //' \
1037 -e '/^ install-texinfo /d' \
1038 -e '/^BISON = /,/^$$/d' \
1039 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1040 <Makefile.in >proto-toplev/Makefile.in
1041
1042 mkdir proto-toplev/texinfo
1043 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1044 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1045 chmod og=u `find proto-toplev -print`
1046 (VER=`sed <$(TOOL)/Makefile.in -n 's/VERSION *= *//p'`; \
1047 echo "==> Making $(TOOL)-$$VER.tar.z"; \
1048 ln -s proto-toplev $(TOOL)-$$VER; \
1049 tar cfh - $(TOOL)-$$VER \
1050 | $(GZIP) -v >$(TOOL)-$$VER.tar.z)
1051
1052GAS_SUPPORT_DIRS= bfd include libiberty opcodes
1053
79337c85 1054.PHONY: gas.tar.z
40e16078
KR
1055gas.tar.z: $(DEVO_SUPPORT) $(GAS_SUPPORT_DIRS) gas texinfo/texinfo.tex
1056 $(MAKE) -f Makefile.in setup-dirs SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1057 $(MAKE) -f Makefile.in taz SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" TOOL=gas
1058
79337c85
ILT
1059
1060.NOEXPORT:
1061MAKEOVERRIDES=
1062
1063# start-sanitize-chill
1064## This is ugly, but I don't want GNU make to put these variables in
1065## the environment. Older makes will see this as a set of targets
1066## with no dependencies and no actions.
1067unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1068# end-sanitize-chill
1069
eb02fd64 1070# end of Makefile.in
This page took 0.143177 seconds and 4 git commands to generate.