1############################################################################### 2# Defines $(ASR_GLOBAL_DEFINES) (among other things) that specify a build. 3# 4# !!! NOTE: This file must be kept synchronized with builddef.h 5# !!! Also the values of $(ASR_OPTIMIZE), $(ASR_PROFILE), & $(ASR_TRACE) must 6# !!! be compatible with the corresponding values in buildddef.h 7# 8# Required macros set in macros.mak: 9# $(ASR_OS) The name of the operating system. 10# $(ASR_CPU) The name of the CPU architecture. 11# $(ASR_COMPILER) The name of the compiler. 12# $(ASR_BUILD) A string that defines what type of build to perform. 13# $(ASR_UI) The name of the type of user interface. 14# 15# The important macros defined herein are: 16# * $(ASR_GLOBAL_DEFINES)The compiler defines based on the values of: 17# $(ASR_OS), $(ASR_CPU), $(ASR_COMPILER), $(ASR_BUILD), & $(ASR_UI). 18# * $(ASR_SUB_DIR) The object, library, & binary sub-directory name. 19# * $(ASR_OPTIMIZE) Used by $(ASR_COMPILER_CHAR)flags.mak to enable optimization. 20# * $(ASR_PROFILE) Used by $(ASR_COMPILER_CHAR)flags.mak to enable profiling. 21# * $(ASR_TRACE) Used by $(ASR_COMPILER_CHAR)flags.mak to enable tracing. 22# 23# Other macros incidentally valid on exit: 24# * $(ASR_OS_TYPE) Value corresponding to the type of operating system. 25# $(ASR_CPU_TYPE) Value corresponding to the type of CPU architecture. 26# $(ASR_COMPILER_TYPE)Value corresponding to the type of compiler. 27# * $(ASR_BUILD_TYPE) Value corresponding to the type of build to perform. 28# $(ASR_UI_TYPE) Value corresponding to the type of user interface. 29# $(ASR_OS_CHAR) Character corresponding to the type of operating system. 30# $(ASR_CPU_CHARS) Characters corresponding to the type of CPU architecture. 31# * $(ASR_COMPILER_CHAR)Character corresponding to the type of compiler. 32# $(ASR_BUILD_CHAR) Character corresponding to the type of build to perform. 33# $(ASR_OS_MSDOS) Value associated with $(ASR_OS_CHAR) = D. 34# $(ASR_OS_WIN32) Value associated with $(ASR_OS_CHAR) = W. 35# $(ASR_OS_MAC) Value associated with $(ASR_OS_CHAR) = M. 36# $(ASR_OS_UNIX) Value associated with $(ASR_OS_CHAR) = U. 37# $(ASR_OS_EMBEDDED) Value associated with $(ASR_OS_CHAR) = E. 38# $(ASR_OS_VXWORKS) Value associated with $(ASR_OS_CHAR) = V. 39# $(ASR_OS_QNX) Value associated with $(ASR_OS_CHAR) = Q. 40# $(ASR_OS_PSOS) Value associated with $(ASR_OS_CHAR) = S. 41# $(ASR_OS_WINCE) Value associated with $(ASR_OS_CHAR) = C. 42# $(ASR_OS_PALM) Value associated with $(ASR_OS_CHAR) = P. 43# $(ASR_OS_JAVA) Value associated with $(ASR_OS_CHAR) = J. 44# $(ASR_CPU_I86) Value associated with $(ASR_CPU_CHARS) = IN. 45# $(ASR_CPU_68K) Value associated with $(ASR_CPU_CHARS) = MO. 46# $(ASR_CPU_MIPS) Value associated with $(ASR_CPU_CHARS) = MI. 47# $(ASR_CPU_ALPHA) Value associated with $(ASR_CPU_CHARS) = AL. 48# $(ASR_CPU_PPC) Value associated with $(ASR_CPU_CHARS) = PP. 49# $(ASR_CPU_SPARC) Value associated with $(ASR_CPU_CHARS) = SP. 50# $(ASR_CPU_ARM) Value associated with $(ASR_CPU_CHARS) = AR. 51# $(ASR_CPU_STRONGARM)Value associated with $(ASR_CPU_CHARS) = SA. 52# $(ASR_CPU_TMS320X) Value associated with $(ASR_CPU_CHARS) = TI. 53# $(ASR_CPU_SH3) Value associated with $(ASR_CPU_CHARS) = HI. 54# $(ASR_CPU_SH4) Value associated with $(ASR_CPU_CHARS) = HI. 55# $(ASR_CPU_FAMILY_TMS320C30)Value associated with $(ASR_CPU_FAMILY) = 3. 56# $(ASR_CPU_FAMILY_TMS320C40)Value associated with $(ASR_CPU_FAMILY) = 4. 57# $(ASR_CPU_FAMILY_TMS320C2XX)Value associated with $(ASR_CPU_FAMILY) = 2. 58# $(ASR_CPU_FAMILY_TMS320C54X)Value associated with $(ASR_CPU_FAMILY) = 5. 59# $(ASR_C_BORLAND) Value associated with $(ASR_COMPILER_CHAR) = B. 60# $(ASR_C_MICROSOFT) Value associated with $(ASR_COMPILER_CHAR) = M. 61# $(ASR_C_HIGH) Value associated with $(ASR_COMPILER_CHAR) = H. 62# $(ASR_C_INTEL) Value associated with $(ASR_COMPILER_CHAR) = I. 63# $(ASR_C_ZORTECH) Value associated with $(ASR_COMPILER_CHAR) = Z. 64# $(ASR_C_WATCOM) Value associated with $(ASR_COMPILER_CHAR) = W. 65# $(ASR_C_GNU) Value associated with $(ASR_COMPILER_CHAR) = G. 66# $(ASR_C_SUNPRO) Value associated with $(ASR_COMPILER_CHAR) = S. 67# $(ASR_C_DECCXX) Value associated with $(ASR_COMPILER_CHAR) = D. 68# $(ASR_C_METROWERKS) Value associated with $(ASR_COMPILER_CHAR) = C. 69# $(ASR_C_GHS) Value associated with $(ASR_COMPILER_CHAR) = X. 70# $(ASR_C_TICXC) Value associated with $(ASR_COMPILER_CHAR) = T. 71# $(ASR_C_ARM) Value associated with $(ASR_COMPILER_CHAR) = A. 72# $(ASR_BUILD_SHIP) Value associated with $(ASR_BUILD_CHAR) = S. 73# $(ASR_BUILD_INHOUSE)Value associated with $(ASR_BUILD_CHAR) = I. 74# $(ASR_BUILD_DEBUGO) Value associated with $(ASR_BUILD_CHAR) = G. 75# $(ASR_BUILD_DEBUG) Value associated with $(ASR_BUILD_CHAR) = X. 76# $(ASR_BUILD_PROFILE)Value associated with $(ASR_BUILD_CHAR) = P. 77# $(ASR_BUILD_TRACE) Value associated with $(ASR_BUILD_CHAR) = L. 78# 79# !!! NOTE: Should these UI macros be used? 80# 81# $(ASR_UI_NONE) 82# $(ASR_UI_TTY) 83# $(ASR_UI_GUI) 84# 85# Optional (for certain values of $(ASR_CPU)) macros used herein: 86# $(ASR_CPU_FAMILY) OPTIONAL single-character name of the $(ASR_CPU) family. 87# 88# Optional (for certain values of $(ASR_CPU)) macros defined herein: 89# * $(ASR_CPU_FAMILY_TYPE)For OPTIONAL CPU-specifics in $(ASR_COMPILER_CHAR)flags.mak. 90# 91# * Used outside of this makefile. All macros with the suffix ``_TYPE'' 92# used outside of this makefile can be &ed with macros with the 93# corresponding prefix. Threfore it is implied that those macros are 94# also available outside of this makefile. 95############################################################################### 96 97# Makefile.config configures the ASR build. Include this first! 98include $(ASR_MAKE_DIR)/Makefile.config 99 100# Makefile.common contains settings available to all ASR modules 101include $(ASR_MAKE_DIR)/Makefile.common 102 103# Define $(ASR_OS_*), $(ASR_CPU_*), $(ASR_COMPILER_*), $(ASR_BUILD_*) & $(ASR_UI_*) values. 104 105# OS 106 107ASR_OS_MSDOS = 1 108ASR_OS_WIN32 = 2 109ASR_OS_MAC = 4 110ASR_OS_UNIX = 8 111ASR_OS_EMBEDDED = 16 112ASR_OS_VXWORKS = 32 113ASR_OS_PSOS = 64 114ASR_OS_WINCE = 128 115ASR_OS_PALM = 256 116ASR_OS_JAVA = 512 117ASR_OS_QNX = 1024 118 119# CPU 120 121ASR_CPU_I86 = 1 122ASR_CPU_68K = 2 123ASR_CPU_MIPS = 4 124ASR_CPU_ALPHA = 8 125ASR_CPU_PPC = 16 126ASR_CPU_SPARC = 32 127ASR_CPU_ARM = 64 128ASR_CPU_STRONGARM = 128 129ASR_CPU_TMS320X = 256 130ASR_CPU_SH3 = 512 131ASR_CPU_SH4 = 1024 132 133# Used only by TFLAGS.MAK. 134 135ASR_CPU_FAMILY_TMS320C30 = 1 136ASR_CPU_FAMILY_TMS320C40 = 2 137ASR_CPU_FAMILY_TMS320C2XX = 4 138ASR_CPU_FAMILY_TMS320C54X = 8 139 140# COMPILER 141 142ASR_C_BORLAND = 1 143ASR_C_MICROSOFT = 2 144ASR_C_INTEL = 4 145ASR_C_HIGH = 8 146ASR_C_ZORTECH = 16 147ASR_C_WATCOM = 32 148ASR_C_GNU = 64 149ASR_C_SUNPRO = 128 150ASR_C_DECCXX = 256 151ASR_C_METROWERKS = 512 152ASR_C_GHS = 1024 153ASR_C_TICXC = 2048 154ASR_C_ARM = 4096 155ASR_C_DIABDATA = 8192 156 157# BUILD (must be synchronized with vcc_helper.h included by buildopt.h) 158 159ASR_BUILD_SHIP = 1 160ASR_BUILD_INHOUSE = 2 161ASR_BUILD_DEBUGO = 4 162ASR_BUILD_DEBUG = 8 163ASR_BUILD_PROFILE = 16 164ASR_BUILD_TRACE = 32 165 166ASR_OFF = 0 167 168# UI 169 170ASR_UI_NONE = 1 171ASR_UI_TTY = 2 172ASR_UI_GUI = 4 173 174######################################################################## 175# 176# Define $(ASR_*_TYPE) and $(ASR_*_CHAR[S]) to be used to define $(ASR_GLOBAL_DEFINES) 177# and $(ASR_SUB_DIR). 178 179################################## OS ################################## 180 181ifeq ("$(ASR_OS)","MSDOS") 182ASR_OS_TYPE = $(ASR_OS_MSDOS) 183 184else # same as OS = "Windows_NT" 185ifeq ("$(ASR_OS)","WIN32") 186ASR_OS_TYPE = $(ASR_OS_WIN32) 187 188else # same as OS = "WIN32" 189ifeq ("$(ASR_OS)","Windows_NT") 190ASR_OS_TYPE = $(ASR_OS_WIN32) 191 192else 193ifeq ("$(ASR_OS)","MAC") 194ASR_OS_TYPE = $(ASR_OS_MAC) 195 196else 197ifeq ("$(ASR_OS)","UNIX") 198ASR_OS_TYPE = $(ASR_OS_UNIX) 199 200else 201ifeq ("$(ASR_OS)","EMBEDDED") 202ASR_OS_TYPE = $(ASR_OS_EMBEDDED) 203 204else 205ifeq ("$(ASR_OS)","VXWORKS") 206ASR_OS_TYPE = $(ASR_OS_VXWORKS) 207 208else 209ifeq ("$(ASR_OS)","PSOS") 210ASR_OS_TYPE = $(ASR_OS_PSOS) 211 212else 213ifeq ("$(ASR_OS)","Wince") 214ASR_OS_TYPE = $(ASR_OS_WINCE) 215 216else 217ifeq ("$(ASR_OS)","PALM") 218ASR_OS_TYPE = $(ASR_OS_PALM) 219 220else 221ifeq ("$(ASR_OS)","JAVA") 222ASR_OS_TYPE = $(ASR_OS_JAVA) 223 224else 225ifeq ("$(ASR_OS)","QNX") 226ASR_OS_TYPE = $(ASR_OS_QNX) 227 228else 229ERROR += \ 230$(subst $(space),|,'Failed to select operating system with $$(ASR_OS) == "$(ASR_$(ASR_OS))"') 231ASR_OS_TYPE = ASR_BAD_OS 232endif 233endif 234endif 235endif 236endif 237endif 238endif 239endif 240endif 241endif 242endif 243endif 244 245 246################################## HOST_OS ################################## 247 248ifeq ("$(ASR_HOST_OS)","MSDOS") 249ASR_HOST_OS_TYPE = $(ASR_OS_MSDOS) 250 251else # same as OS = "Windows_NT" 252ifeq ("$(ASR_HOST_OS)","WIN32") 253ASR_HOST_OS_TYPE = $(ASR_OS_WIN32) 254 255else # same as OS = "WIN32" 256ifeq ("$(ASR_HOST_OS)","Windows_NT") 257ASR_HOST_OS_TYPE = $(ASR_OS_WIN32) 258 259else 260ifeq ("$(ASR_HOST_OS)","MAC") 261ASR_HOST_OS_TYPE = $(ASR_OS_MAC) 262 263else 264ifeq ("$(ASR_HOST_OS)","UNIX") 265ASR_HOST_OS_TYPE = $(ASR_OS_UNIX) 266 267else 268ifeq ("$(ASR_HOST_OS)","EMBEDDED") 269ASR_HOST_OS_TYPE = $(ASR_OS_EMBEDDED) 270 271else 272ifeq ("$(ASR_HOST_OS)","VXWORKS") 273ASR_HOST_OS_TYPE = $(ASR_OS_VXWORKS) 274 275else 276ifeq ("$(ASR_HOST_OS)","PSOS") 277ASR_HOST_OS_TYPE = $(ASR_OS_PSOS) 278 279else 280ifeq ("$(ASR_HOST_OS)","Wince") 281ASR_HOST_OS_TYPE = $(ASR_OS_WINCE) 282 283else 284ifeq ("$(ASR_HOST_OS)","PALM") 285ASR_HOST_OS_TYPE = $(ASR_OS_PALM) 286 287else 288ifeq ("$(ASR_HOST_OS)","JAVA") 289ASR_HOST_OS_TYPE = $(ASR_OS_JAVA) 290 291else 292ifeq ("$(ASR_HOST_OS)","QNX") 293ASR_HOST_OS_TYPE = $(ASR_OS_QNX) 294 295else 296ERROR += \ 297$(subst $(space),|,'Failed to select operating system with $$(ASR_HOST_OS) == "$(ASR_HOST_OS)"') 298ASR_HOST_OS_TYPE = ASR_BAD_OS 299endif 300endif 301endif 302endif 303endif 304endif 305endif 306endif 307endif 308endif 309endif 310endif 311 312################################## TARGET_OS ################################## 313 314ifeq ("$(ASR_TARGET_OS)","MSDOS") 315ASR_TARGET_OS_TYPE = $(ASR_OS_MSDOS) 316 317else # same as OS = "Windows_NT" 318ifeq ("$(ASR_TARGET_OS)","WIN32") 319ASR_TARGET_OS_TYPE = $(ASR_OS_WIN32) 320 321else # same as OS = "WIN32" 322ifeq ("$(ASR_TARGET_OS)","Windows_NT") 323ASR_TARGET_OS_TYPE = $(ASR_OS_WIN32) 324 325else 326ifeq ("$(ASR_TARGET_OS)","MAC") 327ASR_TARGET_OS_TYPE = $(ASR_OS_MAC) 328 329else 330ifeq ("$(ASR_TARGET_OS)","UNIX") 331ASR_TARGET_OS_TYPE = $(ASR_OS_UNIX) 332 333else 334ifeq ("$(ASR_TARGET_OS)","EMBEDDED") 335ASR_TARGET_OS_TYPE = $(ASR_OS_EMBEDDED) 336 337else 338ifeq ("$(ASR_TARGET_OS)","VXWORKS") 339ASR_TARGET_OS_TYPE = $(ASR_OS_VXWORKS) 340 341else 342ifeq ("$(ASR_TARGET_OS)","PSOS") 343ASR_TARGET_OS_TYPE = $(ASR_OS_PSOS) 344 345else 346ifeq ("$(ASR_TARGET_OS)","Wince") 347ASR_TARGET_OS_TYPE = $(ASR_OS_WINCE) 348 349else 350ifeq ("$(ASR_TARGET_OS)","PALM") 351ASR_TARGET_OS_TYPE = $(ASR_OS_PALM) 352 353else 354ifeq ("$(ASR_TARGET_OS)","JAVA") 355ASR_TARGET_OS_TYPE = $(ASR_OS_JAVA) 356 357else 358ifeq ("$(ASR_TARGET_OS)","QNX") 359ASR_TARGET_OS_TYPE = $(ASR_OS_QNX) 360 361else 362ERROR += \ 363$(subst $(space),|,'Failed to select operating system with $$(ASR_TARGET_OS) == "$(ASR_TARGET_OS)"') 364ASR_TARGET_OS_TYPE = ASR_BAD_OS 365endif 366endif 367endif 368endif 369endif 370endif 371endif 372endif 373endif 374endif 375endif 376endif 377 378################################## CPU ################################# 379 380ifeq ("$(ASR_CPU)","I86") 381ASR_CPU_TYPE = $(ASR_CPU_I86) 382ASR_CPU_CHARS = in 383 384else 385ifeq ("$(ASR_CPU)", "SIMNT") 386ASR_CPU_TYPE = $(ASR_CPU_I86) 387ASR_CPU_CHARS = in 388 389else 390ifeq ("$(ASR_CPU)","68K") 391ASR_CPU_TYPE = $(ASR_CPU_68K) 392ASR_CPU_CHARS = mo 393 394else 395ifeq ("$(ASR_CPU)","MIPS") 396ASR_CPU_TYPE = $(ASR_CPU_MIPS) 397ASR_CPU_CHARS = mi 398 399else 400ifeq ("$(ASR_CPU)","ALPHA") 401ASR_CPU_TYPE = $(ASR_CPU_ALPHA) 402ASR_CPU_CHARS = al 403 404else 405ifeq ("$(ASR_CPU)","PPC") 406ASR_CPU_TYPE = $(ASR_CPU_PPC) 407ASR_CPU_CHARS = pp 408 409else 410ifeq ("$(ASR_CPU)","SPARC") 411ASR_CPU_TYPE = $(ASR_CPU_SPARC) 412ASR_CPU_CHARS = pp 413 414else 415ifeq ("$(ASR_CPU)","ARM") 416ASR_CPU_TYPE = $(ASR_CPU_ARM) 417ASR_CPU_CHARS = ar 418 419else 420ifeq ("$(ASR_CPU)","STRONGARM") 421ASR_CPU_TYPE = $(ASR_CPU_STRONGARM) 422ASR_CPU_CHARS = sa 423 424else 425ifeq ("$(ASR_CPU)","TMS320X") 426ASR_CPU_TYPE = $(ASR_CPU_TMS320X) 427ASR_CPU_CHARS = ti 428 429ifndef CPU_FAMILY 430CPU_FAMILY_TYPE = 0 431MESSAGE += \ 432$(subst $(space),|,'$$(ASR_CPU_FAMILY_TYPE) defaulted to "$(ASR_CPU_FAMILY_TYPE)"') 433 434else 435ASR_CPU_CHARS = T$(ASR_CPU_FAMILY) 436 437ifeq ("$(ASR_CPU_FAMILY)","3") 438ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C30) 439 440else 441ifeq ("$(ASR_CPU_FAMILY)","4") 442ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C40) 443 444else 445ifeq ("$(ASR_CPU_FAMILY)","2") 446ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C2XX) 447 448else 449ifeq ("$(ASR_CPU_FAMILY)","5") 450ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C54X) 451 452else 453ERROR += \ 454$(subst $(space),|,\ 455'Failed to select CPU family with $$(ASR_CPU_FAMILY) == "$(ASR_CPU_FAMILY)"') 456ASR_CPU_FAMILY_TYPE=ASR_BAD_CPU_FAMILY 457endif 458endif 459endif 460endif 461endif 462 463else 464ifeq ("$(ASR_CPU)","SH3") 465ASR_CPU_TYPE = $(ASR_CPU_SH3) 466ASR_CPU_CHARS = hi 467 468else 469ifeq ("$(ASR_CPU)","SH4") 470ASR_CPU_TYPE = $(ASR_CPU_SH4) 471ASR_CPU_CHARS = hi 472 473else 474ERROR += \ 475$(subst $(space),|,\ 476'Failed to select CPU architecture with $$(ASR_CPU) == "$(ASR_$(ASR_CPU))"') 477ASR_CPU_TYPE = ASR_BAD_CPU 478ASR_CPU_CHARS = ASR_BAD_CPU 479endif 480endif 481endif 482endif 483endif 484endif 485endif 486endif 487endif 488endif 489endif 490endif 491 492################################## HOST_CPU ################################# 493 494ifeq ("$(ASR_HOST_CPU)","I86") 495ASR_HOST_CPU_TYPE = $(ASR_CPU_I86) 496 497else 498ifeq ("$(ASR_HOST_CPU)","68K") 499ASR_HOST_CPU_TYPE = $(ASR_CPU_68K) 500 501else 502ifeq ("$(ASR_HOST_CPU)","MIPS") 503ASR_HOST_CPU_TYPE = $(ASR_CPU_MIPS) 504 505else 506ifeq ("$(ASR_HOST_CPU)","ALPHA") 507ASR_HOST_CPU_TYPE = $(ASR_CPU_ALPHA) 508 509else 510ifeq ("$(ASR_HOST_CPU)","PPC") 511ASR_HOST_CPU_TYPE = $(ASR_CPU_PPC) 512 513else 514ifeq ("$(ASR_HOST_CPU)","SPARC") 515ASR_HOST_CPU_TYPE = $(ASR_CPU_SPARC) 516 517else 518ifeq ("$(ASR_HOST_CPU)","ARM") 519ASR_HOST_CPU_TYPE = $(ASR_CPU_ARM) 520 521else 522ifeq ("$(ASR_HOST_CPU)","STRONGARM") 523ASR_HOST_CPU_TYPE = $(ASR_CPU_STRONGARM) 524 525else 526ifeq ("$(ASR_HOST_CPU)","TMS320X") 527ASR_HOST_CPU_TYPE = $(ASR_CPU_TMS320X) 528 529ifndef CPU_FAMILY 530ASR_CPU_FAMILY_TYPE = 0 531MESSAGE += \ 532$(subst $(space),|,'$$(ASR_CPU_FAMILY_TYPE) defaulted to "$(ASR_CPU_FAMILY_TYPE)"') 533 534else 535 536ifeq ("$(ASR_CPU_FAMILY)","3") 537ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C30) 538 539else 540ifeq ("$(ASR_CPU_FAMILY)","4") 541ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C40) 542 543else 544ifeq ("$(ASR_CPU_FAMILY)","2") 545ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C2XX) 546 547else 548ifeq ("$(ASR_CPU_FAMILY)","5") 549ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C54X) 550 551else 552ERROR += \ 553$(subst $(space),|,\ 554'Failed to select CPU family with $$(ASR_CPU_FAMILY) == "$(ASR_CPU_FAMILY)"') 555ASR_CPU_FAMILY_TYPE=ASR_BAD_CPU_FAMILY 556endif 557endif 558endif 559endif 560endif 561 562else 563ifeq ("$(ASR_HOST_CPU)","SH3") 564ASR_HOST_CPU_TYPE = $(ASR_CPU_SH3) 565 566else 567ifeq ("$(ASR_HOST_CPU)","SH4") 568ASR_HOST_CPU_TYPE = $(ASR_CPU_SH4) 569 570 571else 572ERROR += \ 573$(subst $(space),|,\ 574'Failed to select CPU architecture with $$(ASR_HOST_CPU) == "$(ASR_HOST_CPU)"') 575ASR_HOST_CPU_TYPE = ASR_BAD_CPU 576endif 577endif 578endif 579endif 580endif 581endif 582endif 583endif 584endif 585endif 586endif 587 588################################## TARGET_CPU ################################# 589 590ifeq ("$(ASR_TARGET_CPU)","I86") 591ASR_TARGET_CPU_TYPE = $(ASR_CPU_I86) 592 593else 594ifeq ("$(ASR_TARGET_CPU)","68K") 595ASR_TARGET_CPU_TYPE = $(ASR_CPU_68K) 596 597else 598ifeq ("$(ASR_TARGET_CPU)","MIPS") 599ASR_TARGET_CPU_TYPE = $(ASR_CPU_MIPS) 600 601else 602ifeq ("$(ASR_TARGET_CPU)","ALPHA") 603ASR_TARGET_CPU_TYPE = $(ASR_CPU_ALPHA) 604 605else 606ifeq ("$(ASR_TARGET_CPU)","PPC") 607ASR_TARGET_CPU_TYPE = $(ASR_CPU_PPC) 608 609else 610ifeq ("$(ASR_TARGET_CPU)","SPARC") 611ASR_TARGET_CPU_TYPE = $(ASR_CPU_SPARC) 612 613else 614ifeq ("$(ASR_TARGET_CPU)","ARM") 615ASR_TARGET_CPU_TYPE = $(ASR_CPU_ARM) 616 617else 618ifeq ("$(ASR_TARGET_CPU)","STRONGARM") 619ASR_TARGET_CPU_TYPE = $(ASR_CPU_STRONGARM) 620 621else 622ifeq ("$(ASR_TARGET_CPU)","TMS320X") 623ASR_TARGET_CPU_TYPE = $(ASR_CPU_TMS320X) 624 625ifndef CPU_FAMILY 626ASR_CPU_FAMILY_TYPE = 0 627MESSAGE += \ 628$(subst $(space),|,'$$(ASR_CPU_FAMILY_TYPE) defaulted to "$(ASR_CPU_FAMILY_TYPE)"') 629 630else 631 632ifeq ("$(ASR_CPU_FAMILY)","3") 633ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C30) 634 635else 636ifeq ("$(ASR_CPU_FAMILY)","4") 637ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C40) 638 639else 640ifeq ("$(ASR_CPU_FAMILY)","2") 641ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C2XX) 642 643else 644ifeq ("$(ASR_CPU_FAMILY)","5") 645ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C54X) 646 647else 648ERROR += \ 649$(subst $(space),|,\ 650'Failed to select CPU family with $$(ASR_CPU_FAMILY) == "$(ASR_CPU_FAMILY)"') 651ASR_CPU_FAMILY_TYPE=ASR_BAD_CPU_FAMILY 652endif 653endif 654endif 655endif 656endif 657 658else 659ifeq ("$(ASR_TARGET_CPU)","SH3") 660ASR_TARGET_CPU_TYPE = $(ASR_CPU_SH3) 661 662else 663ifeq ("$(ASR_TARGET_CPU)","SH4") 664ASR_TARGET_CPU_TYPE = $(ASR_CPU_SH4) 665 666else 667 668ERROR += \ 669$(subst $(space),|,\ 670'Failed to select CPU architecture with $$(ASR_TARGET_CPU) == "$(ASR_TARGET_CPU)"') 671ASR_TARGET_CPU_TYPE = ASR_BAD_CPU 672endif 673endif 674endif 675endif 676endif 677endif 678endif 679endif 680endif 681endif 682endif 683 684 685############################### COMPILER ############################### 686# 687# $(ASR_COMPILER_CHAR) is also used to select which flags makefile to include. 688 689ifeq ("$(ASR_COMPILER)","BORLAND") # !!! NOT SURE WHAT STRING TO USE !!! 690ASR_COMPILER_TYPE = $(ASR_C_BORLAND) 691 692else # same as COMPILER = "M$$" 693ifeq ("$(ASR_COMPILER)","MS") 694ASR_COMPILER_TYPE = $(ASR_C_MICROSOFT) 695 696else 697ifeq ("$(ASR_COMPILER)","INTEL") # !!! NOT SURE WHAT STRING TO USE !!! 698ASR_COMPILER_TYPE = $(ASR_C_INTEL) 699 700else 701ifeq ("$(ASR_COMPILER)","HIGH") # !!! NOT SURE WHAT STRING TO USE !!! 702ASR_COMPILER_TYPE = $(ASR_C_HIGH) 703 704else 705ifeq ("$(ASR_COMPILER)","ZORTECH") # !!! NOT SURE WHAT STRING TO USE !!! 706ASR_COMPILER_TYPE = $(ASR_C_ZORTECH) 707 708else 709ifeq ("$(ASR_COMPILER)","WATCOM") # !!! NOT SURE WHAT STRING TO USE !!! 710ASR_COMPILER_TYPE = $(ASR_C_WATCOM) 711 712else 713ifeq ("$(ASR_COMPILER)","GNU") # !!! NOT SURE WHAT STRING TO USE !!! 714ASR_COMPILER_TYPE = $(ASR_C_GNU) 715 716else 717ifeq ("$(ASR_COMPILER)","SUNPRO") # !!! NOT SURE WHAT STRING TO USE !!! 718ASR_COMPILER_TYPE = $(ASR_C_SUNPRO) 719 720else 721ifeq ("$(ASR_COMPILER)","DECCXX") # !!! NOT SURE WHAT STRING TO USE !!! 722ASR_COMPILER_TYPE = $(ASR_C_DECCXX) 723 724else 725ifeq ("$(ASR_COMPILER)","METROWERKS") # !!! NOT SURE WHAT STRING TO USE !!! 726ASR_COMPILER_TYPE = $(ASR_C_METROWERKS) 727 728else 729ifeq ("$(ASR_COMPILER)","GHS") # !!! NOT SURE WHAT STRING TO USE !!! 730ASR_COMPILER_TYPE = $(ASR_C_GHS) 731 732else 733ifeq ("$(ASR_COMPILER)","TICXC") # !!! NOT SURE WHAT STRING TO USE !!! 734ASR_COMPILER_TYPE = $(ASR_C_TICXC) 735 736else 737ifeq ("$(ASR_COMPILER)","ARM") # !!! NOT ANY PARTICULAR COMPILER !!! 738ASR_COMPILER_TYPE = $(ASR_C_ARM) 739 740else 741ifeq ("$(ASR_COMPILER)","DIABDATA") # !!! NOT ANY PARTICULAR COMPILER !!! 742ASR_COMPILER_TYPE = $(ASR_C_DIABDATA) 743 744else 745ERROR += \ 746$(subst $(space),|,\ 747'Failed to select compiler with $$(ASR_COMPILER) == "$(ASR_COMPILER)"') 748ASR_COMPILER_TYPE = ASR_BAD_COMPILER 749ASR_COMPILER_CHAR = ASR_BAD_COMPILER 750endif 751endif 752endif 753endif 754endif 755endif 756endif 757endif 758endif 759endif 760endif 761endif 762endif 763endif 764 765################################# BUILD ################################ 766# 767# Define OPTIMIZE, PROFILE, and TRACE for use in $(ASR_COMPILER_CHAR)flags.mak. 768# These values must be compatible with the corresponding ones in builddef.h. 769 770ASR_OPTIMIZE = $(ASR_OFF) 771ASR_PROFILE = $(ASR_OFF) 772ASR_TRACE = $(ASR_OFF) 773 774# # BUILD CHAR OPTIMIZE PROFILE TRACE 775# ---- ---- -------- ------- ----- 776ifeq ("$(ASR_BUILD)","SHIP") # SHIP `S' OPTIMIZE 777ASR_BUILD_TYPE = $(ASR_BUILD_SHIP) 778ASR_BUILD_CHAR = s 779ASR_OPTIMIZE = $(ASR_BUILD_TYPE) 780 781else 782ifeq ("$(ASR_BUILD)","NDEBUG") # SHIP `S' OPTIMIZE 783ASR_BUILD_TYPE = $(ASR_BUILD_SHIP) 784ASR_BUILD_CHAR = s 785ASR_OPTIMIZE = $(ASR_BUILD_TYPE) 786 787else 788ifeq ("$(ASR_BUILD)","INHOUSE") # INHOUSE `I' OPTIMIZE 789ASR_BUILD_TYPE = $(ASR_BUILD_INHOUSE) 790ASR_BUILD_CHAR = i 791ASR_OPTIMIZE = $(ASR_BUILD_TYPE) 792 793else 794ifeq ("$(ASR_BUILD)","DEBUGO") # DEBUG `G' OPTIMIZE 795ASR_BUILD_TYPE = $(ASR_BUILD_DEBUGO) 796ASR_BUILD_CHAR = g 797ASR_OPTIMIZE = $(ASR_BUILD_TYPE) 798 799else 800ifeq ("$(ASR_BUILD)","DEBUG") # DEBUG `X' 801ASR_BUILD_TYPE = $(ASR_BUILD_DEBUG) 802ASR_BUILD_CHAR = x 803 804else 805ifeq ("$(ASR_BUILD)","PROFILE") # INHOUSE `P' OPTIMIZE PROFILE 806ASR_BUILD_TYPE = $(ASR_BUILD_PROFILE) 807ASR_BUILD_CHAR = p 808ASR_OPTIMIZE = $(ASR_BUILD_TYPE) 809ASR_PROFILE = $(ASR_BUILD_TYPE) 810 811else 812ifeq ("$(ASR_BUILD)","TRACE") # INHOUSE `L' OPTIMIZE TRACE 813ASR_BUILD_TYPE = $(ASR_BUILD_TRACE) 814ASR_BUILD_CHAR = l 815ASR_OPTIMIZE = $(ASR_BUILD_TYPE) 816ASR_TRACE = $(ASR_BUILD_TYPE) 817 818else 819ERROR += \ 820$(subst $(space),|,'Failed to select build type with $$(ASR_BUILD) == "$(ASR_BUILD)"') 821ASR_BUILD_TYPE = ASR_BAD_BUILD 822ASR_BUILD_CHAR = ASR_BAD_BUILD 823endif 824endif 825endif 826endif 827endif 828endif 829endif 830 831################################# UI ################################# 832# 833# !!! NOT USED !!! 834 835###################################################################### 836# 837# Finally define the macros of interest. 838 839ASR_GLOBAL_DEFINES = \ 840 -DOS_UNIX=$(ASR_OS_UNIX) \ 841 -DOS_EMBEDDED=$(ASR_OS_EMBEDDED) \ 842 -DOS_VXWORKS=$(ASR_OS_VXWORKS) \ 843 -DOS_PSOS=$(ASR_OS_PSOS) \ 844 -DOS_QNX=$(ASR_OS_QNX) \ 845 -DOS=$(ASR_OS_TYPE) \ 846 -DHOST_OS=$(ASR_HOST_OS_TYPE) \ 847 -DTARGET_OS=$(ASR_TARGET_OS_TYPE) \ 848 -DCPU_PPC=$(ASR_CPU_PPC) \ 849 -DCPU_SPARC=$(ASR_CPU_SPARC) \ 850 -DCPU_ARM=$(ASR_CPU_ARM) \ 851 -DCPU_STRONGARM=$(ASR_CPU_STRONGARM) \ 852 -DCPU_TMS320X=$(ASR_CPU_TMS320X) \ 853 -DCPU_SH3=$(ASR_CPU_SH3) \ 854 -DCPU_SH4=$(ASR_CPU_SH4) \ 855 -DCPU=$(ASR_CPU_TYPE) \ 856 -DHOST_CPU=$(ASR_HOST_CPU_TYPE) \ 857 -DTARGET_CPU=$(ASR_TARGET_CPU_TYPE) \ 858 -DC_GNU=$(ASR_C_GNU) \ 859 -DC_SUNPRO=$(ASR_C_SUNPRO) \ 860 -DC_METROWERKS=$(ASR_C_METROWERKS) \ 861 -DC_TICXC=$(ASR_C_TICXC) \ 862 -DC_ARM=$(ASR_C_ARM) \ 863 -DCOMPILER=$(ASR_COMPILER_TYPE) \ 864 -DBUILD_SHIP=$(ASR_BUILD_SHIP) \ 865 -DBUILD_DEBUG=$(ASR_BUILD_DEBUG) \ 866 -DBUILD=$(ASR_BUILD_TYPE) \ 867 868# Include these from Makefile.common 869ASR_GLOBAL_DEFINES += $(ASR_COMMON_DEFINES) $(ASR_WORKAROUND_DEFINES) 870 871# OS specific defines 872ifeq ($(ASR_TARGET_OS),UNIX) 873ASR_GLOBAL_DEFINES += -DPOSIX -D__linux 874endif 875 876 877# BUILD specific defines and flags 878ASR_GLOBAL_CPPFLAGS = 879 880ifeq ($(ASR_BUILD),SHIP) 881ASR_GLOBAL_DEFINES += -DNDEBUG -D_SHIP -DFINAL_RELEASE 882#ASR_GLOBAL_CPPFLAGS += -O3 -fno-strict-aliasing 883endif 884 885ifeq ($(ASR_BUILD),NDEBUG) 886ASR_GLOBAL_DEFINES += -DNDEBUG 887#ASR_GLOBAL_CPPFLAGS += 888endif 889 890ifeq ($(ASR_BUILD),INHOUSE) 891ASR_GLOBAL_DEFINES += -D_INHOUSE 892#ASR_GLOBAL_CPPFLAGS += -g3 893endif 894 895ifeq ($(ASR_BUILD),DEBUGO) 896ASR_GLOBAL_DEFINES += -D_DEBUG 897#ASR_GLOBAL_CPPFLAGS += -g 898endif 899 900ifeq ($(ASR_BUILD),DEBUG) 901ASR_GLOBAL_DEFINES += -D_DEBUG 902#ASR_GLOBAL_CPPFLAGS += -g 903endif 904 905ifneq ($(ASR_OPTIMIZE),$(ASR_OFF)) 906ASR_GLOBAL_DEFINES += -D_OPTIMIZE 907#ASR_GLOBAL_CPPFLAGS += -O3 908endif 909 910ifneq ($(ASR_PROFILE),$(ASR_OFF)) 911ASR_GLOBAL_DEFINES += -D_PROFILE 912#ASR_GLOBAL_CPPFLAGS += -g3 913endif 914 915ifneq ($(ASR_TRACE),$(ASR_OFF)) 916ASR_GLOBAL_DEFINES += -D_TRACE 917#ASR_GLOBAL_CPPFLAGS += 918endif 919