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