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