| 1 | # |
| 2 | # Makefile for directory with subdirs to build. |
| 3 | # Copyright (C) 1990, 1991 Cygnus Support |
| 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 | # Last Mod Wed Nov 6 20:56:58 PST 1991, by rich@rtl.cygnus.com |
| 20 | # |
| 21 | # $Id$ |
| 22 | |
| 23 | srcdir = . |
| 24 | |
| 25 | idestdir = /usr/local |
| 26 | ddestdir = $(idestdir) |
| 27 | |
| 28 | SHELL=/bin/sh |
| 29 | |
| 30 | RANLIB = ranlib |
| 31 | AR = ar |
| 32 | AR_FLAGS = cq |
| 33 | |
| 34 | BISON = `if [ -d $(unsubdir)/../bison ] ; \ |
| 35 | then echo \`pwd\`/$(unsubdir)/../bison$(subdir)/bison -L \`pwd\`/$(unsubdir)/../bison$(subdir)/ ; \ |
| 36 | else echo yacc ; fi` |
| 37 | |
| 38 | #\`(cd $(srcdir)/bison ; \\`pwd\\`)\` |
| 39 | SUBDIRS = libiberty readline bfd gdb binutils ld gas gcc gnulib clib |
| 40 | OTHERS = |
| 41 | |
| 42 | ALL = all.normal |
| 43 | INSTALL_HEADERS = install-headers |
| 44 | INSTALL_FIXED_INCLUDES = install-fixed-includes |
| 45 | #### host and target specific makefile fragments come in here. |
| 46 | ### |
| 47 | |
| 48 | all: $(ALL) |
| 49 | |
| 50 | all.normal: |
| 51 | $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS) $(OTHERS)" |
| 52 | |
| 53 | # this is a bad hack. |
| 54 | all.xclib: all.normal |
| 55 | if [ -d clib ] ; then \ |
| 56 | (cd clib ; $(MAKE)) ; \ |
| 57 | fi |
| 58 | |
| 59 | subdir_do: force |
| 60 | for i in $(DODIRS); do \ |
| 61 | if [ -f $(unsubdir)/$$i/localenv ] ; then \ |
| 62 | if (cd $(unsubdir)/$$i$(subdir); \ |
| 63 | $(MAKE) \ |
| 64 | "against=$(against)" \ |
| 65 | "BISON=$(BISON)" $(DO)) ; then true ; \ |
| 66 | else exit 1 ; fi ; \ |
| 67 | else if [ -d $(unsubdir)/$$i ] ; then \ |
| 68 | if (cd $(unsubdir)/$$i$(subdir); \ |
| 69 | $(MAKE) \ |
| 70 | "against=$(against)" \ |
| 71 | "AR=$(AR)" \ |
| 72 | "CC=$(CC)" \ |
| 73 | "AR_FLAGS=$(AR_FLAGS)" \ |
| 74 | "RANLIB=$(RANLIB)" \ |
| 75 | "LOADLIBES=$(LOADLIBES)" \ |
| 76 | "LDFLAGS=$(LDFLAGS)" \ |
| 77 | "BISON=$(BISON)" $(DO)) ; then true ; \ |
| 78 | else exit 1 ; fi ; \ |
| 79 | else true ; fi ; \ |
| 80 | fi ; \ |
| 81 | done |
| 82 | |
| 83 | |
| 84 | |
| 85 | bootstrap: |
| 86 | $(MAKE) all |
| 87 | $(MAKE) stage1 |
| 88 | $(MAKE) pass "stagepass=stage1" |
| 89 | $(MAKE) stage2 |
| 90 | $(MAKE) pass "stagepass=stage2" |
| 91 | $(MAKE) comparison |
| 92 | |
| 93 | bootstrap2: |
| 94 | $(MAKE) pass "stagepass=stage1" |
| 95 | $(MAKE) stage2 |
| 96 | $(MAKE) pass "stagepass=stage2" |
| 97 | $(MAKE) comparison |
| 98 | |
| 99 | bootstrap3: |
| 100 | $(MAKE) pass "stagepass=stage2" |
| 101 | $(MAKE) comparison |
| 102 | |
| 103 | pass: |
| 104 | cp $(srcdir)/gcc/gstdarg.h $(unsubdir)/gas$(subdir)/stdarg.h |
| 105 | $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)" \ |
| 106 | "CC=`pwd`/$(unsubdir)/gcc$(subdir)/$(stagepass)/gcc \ |
| 107 | -O \ |
| 108 | -B`pwd`/$(unsubdir)/gcc$(subdir)/$(stagepass)/ \ |
| 109 | -B`pwd`/$(unsubdir)/gas$(subdir)/$(stagepass)/ \ |
| 110 | -B`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/" \ |
| 111 | "AR=`pwd`/$(unsubdir)/binutils$(subdir)/$(stagepass)/ar" \ |
| 112 | "RANLIB=`pwd`/$(unsubdir)/binutils$(subdir)/$(stagepass)/ranlib" \ |
| 113 | "LOADLIBES=`pwd`/$(unsubdir)/gnulib$(subdir)/$(stagepass)/gnulib.a /lib/libc.a" \ |
| 114 | "LDFLAGS=-nostdlib /lib/crt0.o \ |
| 115 | -L`pwd`/$(unsubdir)/gnulib$(subdir)/$(stagepass)/ \ |
| 116 | -B`pwd`/$(unsubdir)/ld$(subdir)/$(stagepass)/" |
| 117 | |
| 118 | |
| 119 | stage1: |
| 120 | $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)" |
| 121 | |
| 122 | stage2: |
| 123 | $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)" |
| 124 | |
| 125 | stage3: |
| 126 | $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)" |
| 127 | |
| 128 | stage4: |
| 129 | $(MAKE) subdir_do DO=stage4 "DODIRS=$(SUBDIRS)" |
| 130 | |
| 131 | against=stage2 |
| 132 | |
| 133 | comparison:; $(MAKE) subdir_do DO=comparison against=$(against) "DODIRS=$(SUBDIRS)" |
| 134 | |
| 135 | de-stage1:; $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)" |
| 136 | de-stage2:; $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)" |
| 137 | de-stage3:; $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)" |
| 138 | de-stage4:; $(MAKE) subdir_do DO=de-stage4 "DODIRS=$(SUBDIRS)" |
| 139 | |
| 140 | clean: |
| 141 | rm -rf *.a TEMP errs core *.o *~ \#* TAGS *.E |
| 142 | $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS) $(OTHERS)" |
| 143 | |
| 144 | install: install-dirs $(INSTALL_FIXED_INCLUDES) $(INSTALL_HEADERS) |
| 145 | $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS) $(OTHERS)" |
| 146 | |
| 147 | # The "else true" stuff is for Ultrix; the shell returns the exit code |
| 148 | # of the "if" command, if no commands are run in the "then" or "else" part, |
| 149 | # causing Make to quit. |
| 150 | install-dirs: force |
| 151 | - mkdir $(ddestdir) |
| 152 | - mkdir $(ddestdir)/bin |
| 153 | - mkdir $(ddestdir)/include |
| 154 | - mkdir $(ddestdir)/lib |
| 155 | - mkdir $(ddestdir)/lib/emacs |
| 156 | - mkdir $(idestdir) |
| 157 | - mkdir $(idestdir)/bin |
| 158 | - mkdir $(idestdir)/lib |
| 159 | - mkdir $(idestdir)/include |
| 160 | - mkdir $(idestdir)/doc |
| 161 | - mkdir $(idestdir)/man |
| 162 | - mkdir $(idestdir)/man/man1 |
| 163 | - mkdir $(idestdir)/man/man2 |
| 164 | - mkdir $(idestdir)/man/man3 |
| 165 | - mkdir $(idestdir)/man/man4 |
| 166 | - mkdir $(idestdir)/man/man5 |
| 167 | - mkdir $(idestdir)/man/man6 |
| 168 | - mkdir $(idestdir)/man/man7 |
| 169 | - mkdir $(idestdir)/man/man8 |
| 170 | |
| 171 | install-headers: |
| 172 | if [ -d $(unsubdir)/gcc$(subdir) ] ; then \ |
| 173 | (cd $(unsubdir)/gcc$(subdir) ; \ |
| 174 | $(MAKE) install-dir) ; \ |
| 175 | else true; \ |
| 176 | fi |
| 177 | |
| 178 | install-fixed-includes: force |
| 179 | if [ -d $(unsubdir)/gcc$(subdir) ] ; then \ |
| 180 | (cd $(unsubdir)/gcc$(subdir) ; \ |
| 181 | $(MAKE) install-fixed-includes) ; \ |
| 182 | else true; \ |
| 183 | fi |
| 184 | |
| 185 | etags tags: TAGS |
| 186 | |
| 187 | TAGS: FORCE |
| 188 | etags `$(MAKE) ls` |
| 189 | |
| 190 | ls: |
| 191 | @echo Makefile |
| 192 | @for i in $(SUBDIRS); \ |
| 193 | do \ |
| 194 | (cd $$i; \ |
| 195 | pwd=`pwd`; \ |
| 196 | wd=`basename $$pwd`; \ |
| 197 | for j in `$(MAKE) ls`; \ |
| 198 | do \ |
| 199 | echo $$wd/$$j; \ |
| 200 | done) \ |
| 201 | done |
| 202 | |
| 203 | force: |
| 204 | |
| 205 | # with the gnu make, this is done automatically. |
| 206 | |
| 207 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
| 208 | $(SHELL) ./config.status |
| 209 | |
| 210 | # |
| 211 | # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc |
| 212 | |
| 213 | DEVO_SUPPORT= README README.configure Makefile.in configure configure.in \ |
| 214 | config.sub config |
| 215 | GDB_SUPPORT_DIRS= bfd include libiberty readline |
| 216 | GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS) texinfo/fsf/texinfo.tex |
| 217 | |
| 218 | setup-dirs: force_update |
| 219 | ./configure sun4 |
| 220 | make clean |
| 221 | ./configure -rm sun4 |
| 222 | chmod og=u `find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print` |
| 223 | |
| 224 | bfd.ilrt.tar.Z: setup-dirs |
| 225 | rm -f bfd.ilrt.tar.Z |
| 226 | tar cf - $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) \ |
| 227 | | compress -v >bfd.ilrt.tar.Z |
| 228 | |
| 229 | gdb.tar.Z: setup-dirs |
| 230 | (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir) |
| 231 | $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z |
| 232 | |
| 233 | make-gdb.tar.Z: $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS) gdb texinfo/fsf/texinfo.tex |
| 234 | rm -rf proto-toplev; mkdir proto-toplev |
| 235 | ln -s ../gdb/proto-gdb.dir proto-toplev/gdb |
| 236 | (cd proto-toplev; for i in $(DEVO_SUPPORT) $(GDB_SUPPORT_DIRS); do \ |
| 237 | ln -s ../$$i . ; \ |
| 238 | done) |
| 239 | mkdir proto-toplev/texinfo |
| 240 | mkdir proto-toplev/texinfo/fsf |
| 241 | ln -s ../../../texinfo/fsf/texinfo.tex proto-toplev/texinfo/fsf/ |
| 242 | chmod og=u `find proto-toplev -print` |
| 243 | (VER=`sed <gdb/Makefile.in -n 's/VERSION = //p'`; \ |
| 244 | echo "==> Making gdb-$$VER.tar.Z"; \ |
| 245 | ln -s proto-toplev gdb-$$VER; \ |
| 246 | tar cfh - gdb-$$VER \ |
| 247 | | compress -v >gdb-$$VER.tar.Z) |
| 248 | |
| 249 | force_update: |
| 250 | |
| 251 | nothing: |
| 252 | |
| 253 | # end of Makefile.in |