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