* libhppa.h (hppa_field_adjust): Avoid adding constant_value into
[binutils-gdb.git] / Makefile.in
1 #
2 # Makefile for directory with subdirs to build.
3 # Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation
4 #
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 #
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)/$(target)
28
29 program_transform_name =
30
31 datadir = $(prefix)/lib
32 mandir = $(prefix)/man
33 man1dir = $(mandir)/man1
34 man2dir = $(mandir)/man2
35 man3dir = $(mandir)/man3
36 man4dir = $(mandir)/man4
37 man5dir = $(mandir)/man5
38 man6dir = $(mandir)/man6
39 man7dir = $(mandir)/man7
40 man8dir = $(mandir)/man8
41 man9dir = $(mandir)/man9
42 infodir = $(prefix)/info
43 includedir = $(prefix)/include
44 docdir = $(datadir)/doc
45
46 SHELL = /bin/sh
47
48 INSTALL = $${srcroot}/install.sh -c
49 INSTALL_PROGRAM = $(INSTALL)
50 INSTALL_DATA = $(INSTALL) -m 644
51 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
52
53 AS = as
54 AR = ar
55 AR_FLAGS = rc
56 CC = cc
57
58 # If any variables are added here, they must be added to do-*, below.
59 # The HOST_* variables are a special case, which are used for the gcc
60 # cross-building scheme.
61 HOST_CC = $(CC_FOR_BUILD)
62 HOST_PREFIX =
63 HOST_PREFIX_1 = loser-
64
65 # We don't specify -g -O because many compilers don't support -g -O,
66 # and/or -O is broken in and of itself.
67 CFLAGS = -g
68
69 # start-sanitize-chill
70 CHILLFLAGS = $(CFLAGS)
71 CHILL_LIB = -lchill
72 # end-sanitize-chill
73 CXX = gcc
74
75 # Use -O to stress test the compiler.
76 CXXFLAGS = -g -O -fexternal-templates
77
78 RANLIB = ranlib
79 NM = nm
80 # Not plain GZIP, since gzip looks there for extra command-line options.
81 GZIPPROG = gzip
82
83 # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
84 BISON = `if [ -f $$r/byacc/byacc ] ; \
85 then echo $$r/byacc/byacc ; \
86 else echo byacc ; \
87 fi`
88
89 LEX = `if [ -f $$r/flex/flex ] ; \
90 then echo $$r/flex/flex ; \
91 else echo flex ; fi`
92
93 M4 = `if [ -f $$r/m4/m4 ] ; \
94 then echo $$r/m4/m4 ; \
95 else echo m4 ; fi`
96
97 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
98 then echo $$r/texinfo/makeinfo/makeinfo ; \
99 else echo makeinfo ; fi`
100
101 # This just becomes part of the MAKEINFO definition passed down to
102 # sub-makes. It lets flags be given on the command line while still
103 # using the makeinfo from the object tree.
104 MAKEINFOFLAGS =
105
106 EXPECT = `if [ -f $$r/expect/expect ] ; \
107 then echo $$r/expect/expect ; \
108 else echo expect ; fi`
109
110 RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
111 then echo $${srcroot}/dejagnu/runtest ; \
112 else echo runtest ; fi`
113
114
115 # libraries that may need to be augmented on a system-by-system basis
116 X11_LIB = -lX11
117
118 # compilers to use to create programs which must be run in the build
119 # environment.
120 CC_FOR_BUILD = $(CC)
121 CXX_FOR_BUILD = $(CXX)
122
123 SUBDIRS = "this is set via configure, don't edit this"
124 OTHERS =
125
126 ALL = all.normal
127 INSTALL_TARGET = install-dirs \
128 $(INSTALL_MODULES) \
129 $(INSTALL_TARGET_MODULES) \
130 $(INSTALL_X11_MODULES) \
131 install-gcc \
132 $(INSTALL_LAST)
133
134
135 CC_FOR_TARGET = ` \
136 if [ -f $$r/gcc/Makefile ] ; then \
137 if [ -f $$r/newlib/Makefile ] ; then \
138 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
139 else \
140 echo $$r/gcc/xgcc -B$$r/gcc/; \
141 fi; \
142 else \
143 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
144 echo $(CC); \
145 else \
146 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
147 fi; \
148 fi`
149
150 # start-sanitize-chill
151 CHILL_FOR_TARGET = ` \
152 if [ -f $$r/gcc/Makefile ] ; then \
153 echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/chillrt/; \
154 else \
155 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
156 echo $(CC); \
157 else \
158 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
159 fi; \
160 fi`
161
162 # end-sanitize-chill
163
164 CXX_FOR_TARGET = ` \
165 if [ -f $$r/gcc/Makefile ] ; then \
166 if [ -f $$r/newlib/Makefile ] ; then \
167 echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
168 else \
169 echo $$r/gcc/xgcc -B$$r/gcc/; \
170 fi; \
171 else \
172 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
173 echo $(CXX); \
174 else \
175 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
176 fi; \
177 fi`
178
179 AS_FOR_TARGET = ` \
180 if [ -f $$r/gas/Makefile ] ; then \
181 echo $$r/gas/as.new ; \
182 else \
183 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
184 echo $(AS); \
185 else \
186 t='$(program_transform_name)'; echo as | sed -e 's/brokensed/brokensed/' $$t ; \
187 fi; \
188 fi`
189
190 AR_FOR_TARGET = ` \
191 if [ -f $$r/binutils/ar ] ; then \
192 echo $$r/binutils/ar ; \
193 else \
194 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
195 echo $(AR); \
196 else \
197 t='$(program_transform_name)'; echo ar | sed -e 's/brokensed/brokensed/' $$t ; \
198 fi; \
199 fi`
200
201 RANLIB_FOR_TARGET = ` \
202 if [ -f $$r/binutils/ranlib ] ; then \
203 echo $$r/binutils/ranlib ; \
204 else \
205 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
206 echo $(RANLIB); \
207 else \
208 t='$(program_transform_name)'; echo ranlib | sed -e 's/brokensed/brokensed/' $$t ; \
209 fi; \
210 fi`
211
212 NM_FOR_TARGET = ` \
213 if [ -f $$r/binutils/Makefile ] ; then \
214 echo $$r/binutils/nm.new ; \
215 else \
216 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
217 echo $(NM); \
218 else \
219 t='$(program_transform_name)'; echo nm | sed -e 's/brokensed/brokensed/' $$t ; \
220 fi; \
221 fi`
222
223 #### host and target specific makefile fragments come in here.
224 ###
225
226 # Flags to pass down to all sub-makes.
227 # Please keep these in alphabetical order.
228 BASE_FLAGS_TO_PASS = \
229 "AR_FLAGS=$(AR_FLAGS)" \
230 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
231 "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
232 "BISON=$(BISON)" \
233 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
234 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
235 "CFLAGS=$(CFLAGS)" \
236 $(start-sanitize-chill)\
237 "CHILLFLAGS=$(CHILLFLAGS)" \
238 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
239 "CHILL_LIB=$(CHILL_LIB)" \
240 $(end-sanitize-chill)\
241 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
242 "CXXFLAGS=$(CXXFLAGS)" \
243 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
244 "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
245 "INSTALL=$(INSTALL)" \
246 "INSTALL_DATA=$(INSTALL_DATA)" \
247 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
248 "INSTALL_XFORM=$(INSTALL_XFORM)" \
249 "LDFLAGS=$(LDFLAGS)" \
250 "LEX=$(LEX)" \
251 "M4=$(M4)" \
252 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
253 "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
254 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
255 "SHELL=$(SHELL)" \
256 "EXPECT=$(EXPECT)" \
257 "RUNTEST=$(RUNTEST)" \
258 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
259 "YACC=$(BISON)" \
260 "exec_prefix=$(exec_prefix)" \
261 "prefix=$(prefix)" \
262 "tooldir=$(tooldir)"
263
264 # Flags to pass down to most sub-makes, in which we're building with
265 # the host environment.
266 # If any variables are added here, they must be added to do-*, below.
267 EXTRA_HOST_FLAGS = \
268 'AR=$(AR)' \
269 'AS=$(AS)' \
270 'CC=$(CC)' \
271 'CXX=$(CXX)' \
272 'NM=$(NM)' \
273 'RANLIB=$(RANLIB)'
274
275 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
276
277 # Flags that are concerned with the location of the X11 include files
278 # and library files
279 X11_FLAGS_TO_PASS = \
280 "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
281 "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
282 "X11_LIB=$(X11_LIB)"
283
284 # Flags to pass down to makes which are built with the target environment.
285 # The double $ decreases the length of the command line; the variables
286 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
287 # If any variables are added here, they must be added to do-*, below.
288 EXTRA_TARGET_FLAGS = \
289 'AR=$$(AR_FOR_TARGET)' \
290 'AS=$$(AS_FOR_TARGET)' \
291 'CC=$$(CC_FOR_TARGET)' \
292 'CXX=$$(CXX_FOR_TARGET)' \
293 'NM=$$(NM_FOR_TARGET)' \
294 'RANLIB=$$(RANLIB_FOR_TARGET)'
295
296 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
297
298 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
299 # unfortunately needs the native compiler and the target ar and
300 # ranlib.
301
302 EXTRA_GCC_FLAGS = \
303 'AR=$$(AR_FOR_TARGET)' \
304 'AS=$(AS)' \
305 'CC=$(CC)' \
306 'CXX=$(CXX)' \
307 'HOST_CC=$(CC_FOR_BUILD)' \
308 'HOST_PREFIX=$(HOST_PREFIX)' \
309 'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
310 'NM=$(NM)' \
311 'RANLIB=$$(RANLIB_FOR_TARGET)'
312
313 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
314
315 # This is a list of the targets for all of the modules which are compiled
316 # using $(FLAGS_TO_PASS).
317 ALL_MODULES = \
318 all-autoconf \
319 all-bfd \
320 all-binutils \
321 all-byacc \
322 all-cvs \
323 all-dejagnu \
324 all-diff \
325 all-dosutils \
326 all-etc \
327 all-fileutils \
328 all-find \
329 all-flex \
330 all-gas \
331 all-gawk \
332 all-gdb \
333 all-gprof \
334 all-grep \
335 all-gzip \
336 all-hello \
337 all-indent \
338 all-ispell \
339 all-ld \
340 all-libiberty \
341 all-m4 \
342 all-make \
343 all-mmalloc \
344 all-opcodes \
345 all-pagas \
346 all-patch \
347 all-prms \
348 all-rcs \
349 all-readline \
350 all-release \
351 all-recode \
352 all-sed \
353 all-send-pr \
354 all-shellutils \
355 all-sim \
356 all-tar \
357 all-tcl \
358 all-texinfo \
359 all-textutils \
360 all-tgas \
361 all-time \
362 all-uudecode \
363 all-wdiff
364
365
366 # This is a list of the check targets for all of the modules which are
367 # compiled using $(FLAGS_TO_PASS).
368 CHECK_MODULES = \
369 check-autoconf \
370 check-bfd \
371 check-binutils \
372 check-byacc \
373 check-cvs \
374 check-dejagnu \
375 check-diff \
376 check-etc \
377 check-fileutils \
378 check-find \
379 check-flex \
380 check-gas \
381 check-gawk \
382 check-gdb \
383 check-gprof \
384 check-grep \
385 check-gzip \
386 check-hello \
387 check-indent \
388 check-ispell \
389 check-ld \
390 check-libiberty \
391 check-m4 \
392 check-make \
393 check-mmcheckoc \
394 check-opcodes \
395 check-pagas \
396 check-patch \
397 check-prms \
398 check-rcs \
399 check-readline \
400 check-recode \
401 check-sed \
402 check-send-pr \
403 check-shellutils \
404 check-sim \
405 check-tar \
406 check-tcl \
407 check-texinfo \
408 check-textutils \
409 check-tgas \
410 check-time \
411 check-uudecode \
412 check-wdiff
413
414 # This is a list of the install targets for all of the modules which are
415 # compiled using $(FLAGS_TO_PASS).
416 INSTALL_MODULES = \
417 install-autoconf \
418 install-bfd \
419 install-binutils \
420 install-byacc \
421 install-cvs \
422 install-dejagnu \
423 install-diff \
424 install-dosutils \
425 install-etc \
426 install-fileutils \
427 install-find \
428 install-flex \
429 install-gas \
430 install-gawk \
431 install-gdb \
432 install-glob \
433 install-gprof \
434 install-grep \
435 install-gzip \
436 install-hello \
437 install-indent \
438 install-ispell \
439 install-ld \
440 install-libiberty \
441 install-m4 \
442 install-make \
443 install-mmalloc \
444 install-opcodes \
445 install-pagas \
446 install-patch \
447 install-prms \
448 install-rcs \
449 install-readline \
450 install-recode \
451 install-sed \
452 install-send-pr \
453 install-shellutils \
454 install-sim \
455 install-tar \
456 install-tcl \
457 install-texinfo \
458 install-textutils \
459 install-tgas \
460 install-time \
461 install-uudecode \
462 install-wdiff
463
464 # This is a list of the targets for all of the modules which are compiled
465 # using $(X11_FLAGS_TO_PASS).
466 ALL_X11_MODULES = \
467 all-emacs \
468 all-expect \
469 all-gash \
470 all-tclX \
471 all-tk
472
473 # This is a list of the check targets for all of the modules which are
474 # compiled using $(X11_FLAGS_TO_PASS).
475 CHECK_X11_MODULES = \
476 check-emacs \
477 check-expect \
478 check-gash \
479 check-tclX \
480 check-tk
481
482 # This is a list of the install targets for all the modules which are
483 # compiled using $(X11_FLAGS_TO_PASS).
484 INSTALL_X11_MODULES = \
485 install-emacs \
486 install-expect \
487 install-gash \
488 install-tclX \
489 install-tk
490
491 # This is a list of the targets for all of the modules which are compiled
492 # using $(TARGET_FLAGS_TO_PASS).
493 ALL_TARGET_MODULES = \
494 $(start-sanitize-chill) \
495 all-chillrt \
496 $(end-sanitize-chill) \
497 all-libio \
498 all-libg++ \
499 all-newlib \
500 all-xiberty
501
502 # This is a list of the check targets for all of the modules which are
503 # compiled using $(TARGET_FLAGS_TO_PASS).
504 CHECK_TARGET_MODULES = \
505 $(start-sanitize-chill) \
506 check-chillrt \
507 $(end-sanitize-chill) \
508 check-libio \
509 check-libg++ \
510 check-newlib \
511 check-xiberty
512
513 # This is a list of the install targets for all of the modules which are
514 # compiled using $(TARGET_FLAGS_TO_PASS).
515 INSTALL_TARGET_MODULES = \
516 $(start-sanitize-chill) \
517 install-chillrt \
518 $(end-sanitize-chill) \
519 install-libio \
520 install-libg++ \
521 install-newlib \
522 install-xiberty
523
524 # This is a shell case of all modules which are compiled using
525 # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
526 TARGET_LIBS = libio | libg++ | newlib | xiberty
527 # start-sanitize-chill
528 TARGET_LIBS = chillrt | libio | libg++ | newlib | xiberty
529 # end-sanitize-chill
530
531 # The first rule in the file had better be this one. Don't put any above it.
532 all: all.normal
533 .PHONY: all
534
535 # The target built for a native build.
536 .PHONY: all.normal
537 all.normal: \
538 $(ALL_MODULES) \
539 $(ALL_TARGET_MODULES) \
540 $(ALL_X11_MODULES) \
541 all-gcc
542
543 # Do a target for all the subdirectories. A ``make do-X'' will do a
544 # ``make X'' in all subdirectories (because, in general, there is a
545 # dependency (below) of X upon do-X, a ``make X'' will also do this,
546 # but it may do additional work as well).
547 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
548 # because it is so large that it can easily overflow the command line
549 # length limit on some systems.
550 DO_X = \
551 do-clean \
552 do-distclean \
553 do-dvi \
554 do-info \
555 do-install-info \
556 do-installcheck \
557 do-mostlyclean \
558 do-realclean \
559 do-TAGS
560 .PHONY: $(DO_X)
561 $(DO_X):
562 @target=`echo $@ | sed -e 's/^do-//'`; \
563 r=`pwd`; export r; \
564 srcroot=`cd $(srcdir); pwd`; export srcroot; \
565 for i in $(SUBDIRS); do \
566 if [ -f ./$$i/Makefile ]; then \
567 case $$i in \
568 $(TARGET_LIBS) ) \
569 for flag in $(EXTRA_TARGET_FLAGS); do \
570 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
571 done; \
572 ;; \
573 gcc) \
574 for flag in $(EXTRA_GCC_FLAGS); do \
575 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
576 done; \
577 ;; \
578 *) \
579 for flag in $(EXTRA_HOST_FLAGS); do \
580 eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
581 done; \
582 ;; \
583 esac ; \
584 export AR AS CC CXX NM RANLIB; \
585 if (cd ./$$i; \
586 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
587 "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
588 "RANLIB=$${RANLIB}" \
589 $${target}); \
590 then true; else exit 1; fi; \
591 else true; fi; \
592 done
593
594 # Here are the targets which correspond to the do-X targets.
595
596 .PHONY: info installcheck dvi install-info
597 .PHONY: clean distclean mostlyclean realclean local-clean local-distclean
598 info: do-info
599 installcheck: do-installcheck
600 dvi: do-dvi
601
602 install-info: do-install-info dir.info
603 srcroot=`cd $(srcdir); pwd`; export srcroot; \
604 if [ -f dir.info ] ; then \
605 $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
606 else true ; fi
607
608 local-clean:
609 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
610
611 local-distclean:
612 -rm -f Makefile config.status
613
614 clean: do-clean local-clean
615 mostlyclean: do-mostlyclean local-clean
616 distclean: do-distclean local-clean local-distclean
617 realclean: do-realclean local-clean local-distclean
618
619 # Check target.
620
621 .PHONY: check
622 check: $(CHECK_MODULES) \
623 $(CHECK_TARGET_MODULES) \
624 $(CHECK_X11_MODULES) \
625 check-gcc
626
627 # Installation targets.
628
629 .PHONY: install uninstall vault-install
630 install: $(INSTALL_TARGET)
631
632 uninstall:
633 @echo "the uninstall target is not supported in this tree"
634
635 vault-install:
636 @if [ -f ./release/vault-install ] ; then \
637 ./release/vault-install $(host_alias) $(target_alias) ; \
638 else \
639 true ; \
640 fi
641
642 .PHONY: install.all
643 install.all: install-no-fixedincludes
644 @if [ -f ./gcc/Makefile ] ; then \
645 r=`pwd` ; export r ; \
646 (cd ./gcc; \
647 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
648 else \
649 true ; \
650 fi
651
652 # install-no-fixedincludes is used because Cygnus can not distribute
653 # the fixed header files.
654 .PHONY: install-no-fixedincludes
655 install-no-fixedincludes: \
656 install-dirs \
657 $(INSTALL_MODULES) \
658 $(INSTALL_TARGET_MODULES) \
659 $(INSTALL_X11_MODULES) \
660 gcc-no-fixedincludes
661
662 # Install the gcc headers files, but not the fixed include files,
663 # which Cygnus is not allowed to distribute. This rule is very
664 # dependent on the workings of the gcc Makefile.in.
665 .PHONY: gcc-no-fixedincludes
666 gcc-no-fixedincludes:
667 @if [ -f ./gcc/Makefile ]; then \
668 rm -rf gcc/tmp-include; \
669 mv gcc/include gcc/tmp-include 2>/dev/null; \
670 mkdir gcc/include; \
671 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
672 touch gcc/stmp-fixinc gcc/include/fixed; \
673 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
674 r=`pwd`; export r; \
675 srcroot=`cd $(srcdir); pwd` ; export srcroot; \
676 (cd ./gcc; \
677 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
678 rm -rf gcc/include; \
679 mv gcc/tmp-include gcc/include 2>/dev/null; \
680 else true; fi
681
682 # This rule is used to build the modules which use FLAGS_TO_PASS. To
683 # build a target all-X means to cd to X and make all.
684 # all-glob is handled specially because it doesn't actually build.
685 .PHONY: $(ALL_MODULES) all-glob
686 $(ALL_MODULES) all-glob:
687 @dir=`echo $@ | sed -e 's/all-//'`; \
688 if [ -f ./$${dir}/Makefile ] ; then \
689 r=`pwd`; export r; \
690 srcroot=`cd $(srcdir); pwd`; export srcroot; \
691 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
692 else \
693 true; \
694 fi
695
696 # This rule is used to check the modules which use FLAGS_TO_PASS. To
697 # build a target check-X means to cd to X and make all.
698 .PHONY: $(CHECK_MODULES)
699 $(CHECK_MODULES):
700 @dir=`echo $@ | sed -e 's/check-//'`; \
701 if [ -f ./$${dir}/Makefile ] ; then \
702 r=`pwd`; export r; \
703 srcroot=`cd $(srcdir); pwd`; export srcroot; \
704 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
705 else \
706 true; \
707 fi
708
709 # This rule is used to install the modules which use FLAGS_TO_PASS.
710 # To build a target install-X means to cd to X and make install.
711 .PHONY: $(INSTALL_MODULES)
712 $(INSTALL_MODULES): install-dirs
713 @dir=`echo $@ | sed -e 's/install-//'`; \
714 if [ -f ./$${dir}/Makefile ] ; then \
715 r=`pwd`; export r; \
716 srcroot=`cd $(srcdir); pwd`; export srcroot; \
717 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
718 else \
719 true; \
720 fi
721
722 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
723 # To build a target all-X means to cd to X and make all.
724 .PHONY: $(ALL_TARGET_MODULES)
725 $(ALL_TARGET_MODULES):
726 @dir=`echo $@ | sed -e 's/all-//'`; \
727 if [ -f ./$${dir}/Makefile ] ; then \
728 r=`pwd`; export r; \
729 srcroot=`cd $(srcdir); pwd`; export srcroot; \
730 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
731 else \
732 true; \
733 fi
734
735 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
736 # To build a target install-X means to cd to X and make install.
737 .PHONY: $(CHECK_TARGET_MODULES)
738 $(CHECK_TARGET_MODULES):
739 @dir=`echo $@ | sed -e 's/check-//'`; \
740 if [ -f ./$${dir}/Makefile ] ; then \
741 r=`pwd`; export r; \
742 srcroot=`cd $(srcdir); pwd`; export srcroot; \
743 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
744 else \
745 true; \
746 fi
747
748 # This rule is used to install the modules which use
749 # TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X
750 # and make install.
751 .PHONY: $(INSTALL_TARGET_MODULES)
752 $(INSTALL_TARGET_MODULES): install-dirs
753 @dir=`echo $@ | sed -e 's/install-//'`; \
754 if [ -f ./$${dir}/Makefile ] ; then \
755 r=`pwd`; export r; \
756 srcroot=`cd $(srcdir); pwd`; export srcroot; \
757 (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
758 else \
759 true; \
760 fi
761
762 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
763 # To build a target all-X means to cd to X and make all.
764 .PHONY: $(ALL_X11_MODULES)
765 $(ALL_X11_MODULES):
766 @dir=`echo $@ | sed -e 's/all-//'`; \
767 if [ -f ./$${dir}/Makefile ] ; then \
768 r=`pwd`; export r; \
769 srcroot=`cd $(srcdir); pwd`; export srcroot; \
770 (cd $${dir}; \
771 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
772 else \
773 true; \
774 fi
775
776 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
777 # To build a target check-X means to cd to X and make all.
778 .PHONY: $(CHECK_X11_MODULES)
779 $(CHECK_X11_MODULES):
780 @dir=`echo $@ | sed -e 's/check-//'`; \
781 if [ -f ./$${dir}/Makefile ] ; then \
782 r=`pwd`; export r; \
783 srcroot=`cd $(srcdir); pwd`; export srcroot; \
784 (cd $${dir}; \
785 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
786 else \
787 true; \
788 fi
789
790 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
791 # To build a target install-X means to cd to X and make install.
792 .PHONY: $(INSTALL_X11_MODULES)
793 $(INSTALL_X11_MODULES):
794 @dir=`echo $@ | sed -e 's/install-//'`; \
795 if [ -f ./$${dir}/Makefile ] ; then \
796 r=`pwd`; export r; \
797 srcroot=`cd $(srcdir); pwd`; export srcroot; \
798 (cd $${dir}; \
799 $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
800 else \
801 true; \
802 fi
803
804 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
805 .PHONY: all-gcc
806 all-gcc:
807 @if [ -f ./gcc/Makefile ] ; then \
808 r=`pwd`; export r; \
809 srcroot=`cd $(srcdir); pwd`; export srcroot; \
810 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
811 else \
812 true; \
813 fi
814
815 .PHONY: check-gcc
816 check-gcc:
817 @if [ -f ./gcc/Makefile ] ; then \
818 r=`pwd`; export r; \
819 srcroot=`cd $(srcdir); pwd`; export srcroot; \
820 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
821 else \
822 true; \
823 fi
824
825 .PHONY: install-gcc
826 install-gcc:
827 @if [ -f ./gcc/Makefile ] ; then \
828 r=`pwd`; export r; \
829 srcroot=`cd $(srcdir); pwd`; export srcroot; \
830 (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
831 else \
832 true; \
833 fi
834
835
836 # EXPERIMENTAL STUFF
837 # This rule is used to install the modules which use FLAGS_TO_PASS.
838 # To build a target install-X means to cd to X and make install.
839 .PHONY: $(INSTALL_LAST)
840 $(INSTALL_LAST): install-dirs
841 @dir=`echo $@ | sed -e 's/install-//'`; \
842 if [ -f ./$${dir}/Makefile ] ; then \
843 r=`pwd`; export r; \
844 srcroot=`cd $(srcdir); pwd`; export srcroot; \
845 (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
846 else \
847 true; \
848 fi
849
850
851 # This is a list of inter-dependencies among modules.
852 all-autoconf: all-m4
853 all-bfd:
854 all-binutils: all-libiberty all-opcodes all-bfd all-flex
855 all-byacc:
856 # start-sanitize-chill
857 all-chillrt: all-binutils all-gas all-gcc all-newlib
858 # end-sanitize-chill
859 all-cvs:
860 all-dejagnu:
861 all-diff: all-libiberty
862 all-emacs:
863 all-etc:
864 all-expect: all-tcl all-tk
865 all-fileutils: all-libiberty
866 all-find:
867 all-flex: all-libiberty all-byacc
868 all-gas: all-libiberty all-opcodes all-bfd
869 all-gash: all-tcl
870 all-gawk:
871 all-gcc: all-libiberty all-byacc all-binutils all-gas all-pagas
872 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc all-sim
873 all-glob:
874 all-gprof: all-libiberty all-bfd
875 all-grep: all-libiberty
876 all-gzip: all-libiberty
877 all-hello: all-libiberty
878 all-indent:
879 all-ispell: all-emacs
880 all-ld: all-libiberty all-bfd all-byacc all-flex
881 all-libg++: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib all-libio
882 all-libio: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib
883 all-libiberty:
884 all-m4: all-libiberty
885 all-make: all-libiberty
886 all-mmalloc:
887 all-newlib: all-binutils all-gas all-pagas all-gcc
888 all-opcodes: all-bfd
889 all-patch:
890 all-prms: all-libiberty
891 all-rcs:
892 all-readline:
893 all-recode: all-libiberty
894 all-sed: all-libiberty
895 all-send-pr: all-prms
896 all-shellutils:
897 all-sim: all-libiberty all-bfd
898 all-tar: all-libiberty
899 all-tcl:
900 all-tclX: all-tcl all-tk
901 all-tk: all-tcl
902 all-texinfo: all-libiberty
903 all-textutils:
904 all-tgas: all-libiberty all-bfd
905 all-time:
906 all-wdiff:
907 all-uudecode: all-libiberty
908 all-xiberty: all-gcc all-newlib
909
910 ### other supporting targets
911
912 MAKEDIRS= \
913 $(prefix) \
914 $(exec_prefix) \
915 $(tooldir)
916
917 .PHONY: install-dirs
918 install-dirs:
919 @for i in $(MAKEDIRS) ; do \
920 echo Making $$i... ; \
921 parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
922 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
923 if [ ! -d $$i ] ; then \
924 if mkdir $$i ; then \
925 true ; \
926 else \
927 exit 1 ; \
928 fi ; \
929 else \
930 true ; \
931 fi ; \
932 done
933
934
935 dir.info: do-install-info
936 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
937 $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
938 mv -f dir.info.new dir.info ; \
939 else true ; \
940 fi
941
942 dist:
943 @echo "Building a full distribution of this tree isn't done"
944 @echo "via 'make dist'. Check out the etc/ subdirectory"
945
946 etags tags: TAGS
947
948 # Right now this just builds TAGS in each subdirectory. emacs19 has the
949 # ability to use several tags files at once, so there is probably no need
950 # to combine them into one big TAGS file (like CVS 1.3 does). We could
951 # (if we felt like it) have this Makefile write a piece of elisp which
952 # the user could load to tell emacs19 where all the TAGS files we just
953 # built are.
954 TAGS: do-TAGS
955
956 # with the gnu make, this is done automatically.
957
958 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
959 $(SHELL) ./config.status
960
961 #
962 # Support for building net releases
963
964 # Files in devo used in any net release.
965 # ChangeLog omitted because it may refer to files which are not in this
966 # distribution (perhaps it would be better to include it anyway).
967 DEVO_SUPPORT= README Makefile.in configure configure.in \
968 config.guess config.sub config move-if-change \
969 COPYING COPYING.LIB install.sh
970
971 # Files in devo/etc used in any net release.
972 # ChangeLog omitted because it may refer to files which are not in this
973 # distribution (perhaps it would be better to include it anyway).
974 ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
975 configure.texi standards.texi make-stds.texi
976
977 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob sim
978 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS)
979
980 .PHONY: setup-dirs-gdb gdb.tar.gz make-gdb.tar.gz
981 setup-dirs-gdb:
982 $(start-sanitize-Sanitize)
983 @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
984 $(end-sanitize-Sanitize)
985 ./configure sun4
986 $(MAKE) clean
987 ./configure -rm sun4
988 chmod og=u `find etc $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
989
990 gdb.tar.gz: setup-dirs-gdb
991 (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir BISON="byacc")
992 (cd gdb; $(MAKE) -f Makefile.in make-proto-testsuite.dir)
993 $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.gz
994
995 make-gdb.tar.gz: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/texinfo.tex
996 rm -rf proto-toplev; mkdir proto-toplev
997 ln -s ../gdb/proto-gdb.dir proto-toplev/gdb
998 (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \
999 ln -s ../$$i . ; \
1000 done)
1001 mkdir proto-toplev/etc
1002 (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
1003 ln -s ../../etc/$$i . ; \
1004 done)
1005 # Put only one copy (four hard links) of COPYING in the tar file.
1006 rm proto-toplev/bfd/COPYING
1007 ln proto-toplev/gdb/COPYING proto-toplev/bfd/COPYING
1008 rm proto-toplev/include/COPYING
1009 ln proto-toplev/gdb/COPYING proto-toplev/include/COPYING
1010 rm proto-toplev/readline/COPYING
1011 ln proto-toplev/gdb/COPYING proto-toplev/readline/COPYING
1012
1013 # Change the bug reporting address in configure to bug-gdb
1014 rm proto-toplev/configure
1015 sed -e 's/configure@cygnus.com/bug-gdb@prep.ai.mit.edu/' \
1016 <configure >proto-toplev/configure
1017 chmod a+x proto-toplev/configure
1018
1019 # Take out texinfo and glob from configurable dirs
1020 rm proto-toplev/configure.in
1021 sed -e '/^host_tools=/s/texinfo //' \
1022 -e '/^host_libs=/s/glob //' \
1023 <configure.in >proto-toplev/configure.in
1024
1025 # Take out texinfo from a few places; make simple BISON=bison line.
1026 rm proto-toplev/Makefile.in
1027 sed -e '/^all\.normal: /s/\all-texinfo //' \
1028 -e '/^ install-texinfo /d' \
1029 -e '/^BISON = /,/^$$/d' \
1030 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1031 <Makefile.in >proto-toplev/Makefile.in
1032
1033 mkdir proto-toplev/texinfo
1034 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1035 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1036 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1037 chmod og=u `find proto-toplev -print`
1038 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1039 echo "==> Making gdb-$$VER.tar.gz"; \
1040 rm -f gdb-$$VER; ln -s proto-toplev gdb-$$VER; \
1041 tar cfh - gdb-$$VER \
1042 | $(GZIPPROG) -v -9 >gdb-$$VER.tar.gz)
1043
1044 # Make the testsuite archive separately.
1045 ln -s ../../gdb/proto-testsuite.dir/testsuite proto-toplev/gdb/testsuite
1046 # Blow away the Chill test that requires a Chill compiled executable,
1047 # since GNU Chill is not yet publically available.
1048 rm -rf proto-toplev/gdb/testsuite/gdb.t31
1049
1050 # Put a copy of COPYING in the tar file.
1051 ln proto-toplev/gdb/COPYING proto-toplev/gdb/testsuite/COPYING
1052 chmod og=u `find proto-toplev/gdb/testsuite -print`
1053 (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \
1054 echo "==> Making gdb-$$VER-testsuite.tar.gz"; \
1055 tar cfh - gdb-$$VER/configure gdb-$$VER/config.guess \
1056 gdb-$$VER/config.sub gdb-$$VER/move-if-change \
1057 gdb-$$VER/gdb/testsuite \
1058 | $(GZIPPROG) -v -9 >gdb-$$VER-testsuite.tar.gz)
1059
1060 # When you use `make setup-dirs' or `make taz' you should always redefine
1061 # this macro.
1062 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1063 # Directories that might want `make diststuff' run.
1064 DISTSTUFFDIRS= ld gprof gdb libg++ binutils gnats
1065 # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
1066 DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
1067 # Directories where "info" should be built.
1068 DISTDOCDIRS= ld gprof binutils gas bfd libg++ libio gdb gnats send-pr
1069
1070 .PHONY: taz
1071
1072 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1073 texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1074 # Make sure "diststuff" files get built properly.
1075 for f in $(DISTBISONFILES) ; do \
1076 if [ -r $$f ]; then \
1077 sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
1078 mv -f tmp $$f ; \
1079 else true; fi ; \
1080 done
1081 # Take out texinfo from a few places; make simple BISON=bison line.
1082 sed -e '/^all\.normal: /s/\all-texinfo //' \
1083 -e '/^ install-texinfo /d' \
1084 -e '/^BISON = /,/^$$/d' \
1085 -e '/^# BISON:/s/.*/BISON = bison -y/' \
1086 <Makefile.in >tmp
1087 mv -f tmp Makefile.in
1088 #
1089 ./configure sun4
1090 # Doc files don't change; include them in distribution.
1091 for f in $(DISTDOCDIRS) ; do \
1092 if [ -r $$f/Makefile ]; then \
1093 (cd $$f ; $(MAKE) info) || exit 1 ; \
1094 else true ; fi ; \
1095 done
1096 # Make links, and run "make diststuff" when needed.
1097 # The `echo' for setting `p' is to convert all whitespace to spaces.
1098 # Then the `case' further below should tell whether $$d is in
1099 # DISTSTUFFDIRS.
1100 rm -rf proto-toplev ; mkdir proto-toplev
1101 set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1102 p=" `echo $(DISTSTUFFDIRS)` " ; \
1103 for d in $$dirs ; do \
1104 if [ -d $$d ]; then \
1105 case " $$p " in \
1106 *" $$d "*) \
1107 echo making diststuff in $$d ; \
1108 (cd $$d ; pwd ; $(MAKE) diststuff ) || exit 1 ;; \
1109 esac ; \
1110 if [ -d $$d/proto-$$d.dir ]; then \
1111 ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1112 else \
1113 ln -s ../$$d proto-toplev/$$d ; \
1114 fi ; \
1115 else ln -s ../$$d proto-toplev/$$d ; fi ; \
1116 done
1117 $(MAKE) distclean
1118 #
1119 mkdir proto-toplev/etc
1120 (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
1121 ln -s ../../etc/$$i . ; \
1122 done)
1123 #
1124 # Take out texinfo and glob from configurable dirs
1125 rm proto-toplev/configure.in
1126 sed -e '/^host_tools=/s/texinfo //' \
1127 -e '/^host_libs=/s/glob //' \
1128 <configure.in >proto-toplev/configure.in
1129 #
1130 mkdir proto-toplev/texinfo
1131 ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
1132 ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
1133 ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
1134 ln -s ../../texinfo/tex3patch proto-toplev/texinfo/
1135 chmod og=u `find . -print`
1136 (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
1137 echo "==> Making $(TOOL)-$$VER.tar.gz"; \
1138 rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \
1139 tar cfh - $(TOOL)-$$VER \
1140 | $(GZIPPROG) -v -9 >$(TOOL)-$$VER.tar.gz )
1141
1142 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1143 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1144
1145 .PHONY: gas.tar.gz
1146 GAS_SUPPORT_DIRS= bfd include libiberty opcodes
1147 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1148 $(MAKE) -f Makefile.in taz TOOL=gas \
1149 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1150
1151 # The FSF "binutils" release includes gprof and ld.
1152 .PHONY: binutils.tar.gz
1153 BINUTILS_SUPPORT_DIRS= bfd include libiberty opcodes ld gprof
1154 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1155 $(MAKE) -f Makefile.in taz TOOL=binutils \
1156 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
1157
1158 .PHONY: gas+binutils.tar.gz
1159 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1160 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1161 $(MAKE) -f Makefile.in taz TOOL=gas \
1162 SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
1163
1164 .PHONY: libg++.tar.gz
1165 LIBGXX_SUPPORT_DIRS=include libio libiberty xiberty
1166 libg++.tar.gz: $(DIST_SUPPORT) libg++
1167 $(MAKE) -f Makefile.in taz TOOL=libg++ \
1168 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1169
1170 GNATS_SUPPORT_DIRS=include libiberty send-pr
1171 gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1172 $(MAKE) -f Makefile.in taz TOOL=gnats \
1173 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1174
1175 .NOEXPORT:
1176 MAKEOVERRIDES=
1177
1178 # start-sanitize-chill
1179 ## This is ugly, but I don't want GNU make to put these variables in
1180 ## the environment. Older makes will see this as a set of targets
1181 ## with no dependencies and no actions.
1182 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1183 # end-sanitize-chill
1184
1185 # end of Makefile.in