Home | History | Annotate | Download | only in asr
      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!
     98 include $(ASR_MAKE_DIR)/Makefile.config
     99 
    100 # Makefile.common contains settings available to all ASR modules
    101 include $(ASR_MAKE_DIR)/Makefile.common
    102 
    103 # Define $(ASR_OS_*), $(ASR_CPU_*), $(ASR_COMPILER_*), $(ASR_BUILD_*) & $(ASR_UI_*) values.
    104 
    105 # OS
    106 
    107 ASR_OS_MSDOS = 1
    108 ASR_OS_WIN32 = 2
    109 ASR_OS_MAC = 4
    110 ASR_OS_UNIX = 8
    111 ASR_OS_EMBEDDED = 16
    112 ASR_OS_VXWORKS = 32
    113 ASR_OS_PSOS = 64
    114 ASR_OS_WINCE = 128
    115 ASR_OS_PALM = 256
    116 ASR_OS_JAVA = 512
    117 ASR_OS_QNX = 1024
    118 
    119 # CPU
    120 
    121 ASR_CPU_I86 = 1
    122 ASR_CPU_68K = 2
    123 ASR_CPU_MIPS = 4
    124 ASR_CPU_ALPHA = 8
    125 ASR_CPU_PPC = 16
    126 ASR_CPU_SPARC = 32
    127 ASR_CPU_ARM = 64
    128 ASR_CPU_STRONGARM = 128
    129 ASR_CPU_TMS320X = 256
    130 ASR_CPU_SH3 = 512
    131 ASR_CPU_SH4 = 1024
    132 
    133 # Used only by TFLAGS.MAK.
    134 
    135 ASR_CPU_FAMILY_TMS320C30 = 1
    136 ASR_CPU_FAMILY_TMS320C40 = 2
    137 ASR_CPU_FAMILY_TMS320C2XX = 4
    138 ASR_CPU_FAMILY_TMS320C54X = 8
    139 
    140 # COMPILER
    141 
    142 ASR_C_BORLAND = 1
    143 ASR_C_MICROSOFT = 2
    144 ASR_C_INTEL = 4
    145 ASR_C_HIGH = 8
    146 ASR_C_ZORTECH = 16
    147 ASR_C_WATCOM = 32
    148 ASR_C_GNU = 64
    149 ASR_C_SUNPRO = 128
    150 ASR_C_DECCXX = 256
    151 ASR_C_METROWERKS = 512
    152 ASR_C_GHS = 1024
    153 ASR_C_TICXC = 2048
    154 ASR_C_ARM = 4096
    155 ASR_C_DIABDATA = 8192
    156 
    157 # BUILD (must be synchronized with vcc_helper.h included by buildopt.h)
    158 
    159 ASR_BUILD_SHIP = 1
    160 ASR_BUILD_INHOUSE = 2
    161 ASR_BUILD_DEBUGO = 4
    162 ASR_BUILD_DEBUG = 8
    163 ASR_BUILD_PROFILE = 16
    164 ASR_BUILD_TRACE = 32
    165 
    166 ASR_OFF = 0
    167 
    168 # UI
    169 
    170 ASR_UI_NONE = 1
    171 ASR_UI_TTY = 2
    172 ASR_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 
    181 ifeq ("$(ASR_OS)","MSDOS")
    182 ASR_OS_TYPE = $(ASR_OS_MSDOS)
    183 
    184 else								# same as OS = "Windows_NT"
    185 ifeq ("$(ASR_OS)","WIN32")
    186 ASR_OS_TYPE = $(ASR_OS_WIN32)
    187 
    188 else								# same as OS = "WIN32"
    189 ifeq ("$(ASR_OS)","Windows_NT")
    190 ASR_OS_TYPE = $(ASR_OS_WIN32)
    191 
    192 else
    193 ifeq ("$(ASR_OS)","MAC")
    194 ASR_OS_TYPE = $(ASR_OS_MAC)
    195 
    196 else
    197 ifeq ("$(ASR_OS)","UNIX")
    198 ASR_OS_TYPE = $(ASR_OS_UNIX)
    199 
    200 else
    201 ifeq ("$(ASR_OS)","EMBEDDED")
    202 ASR_OS_TYPE = $(ASR_OS_EMBEDDED)
    203 
    204 else
    205 ifeq ("$(ASR_OS)","VXWORKS")
    206 ASR_OS_TYPE = $(ASR_OS_VXWORKS)
    207 
    208 else
    209 ifeq ("$(ASR_OS)","PSOS")
    210 ASR_OS_TYPE = $(ASR_OS_PSOS)
    211 
    212 else
    213 ifeq ("$(ASR_OS)","Wince")
    214 ASR_OS_TYPE = $(ASR_OS_WINCE)
    215 
    216 else
    217 ifeq ("$(ASR_OS)","PALM")
    218 ASR_OS_TYPE = $(ASR_OS_PALM)
    219 
    220 else
    221 ifeq ("$(ASR_OS)","JAVA")
    222 ASR_OS_TYPE = $(ASR_OS_JAVA)
    223 
    224 else
    225 ifeq ("$(ASR_OS)","QNX")
    226 ASR_OS_TYPE = $(ASR_OS_QNX)
    227 
    228 else
    229 ERROR += \
    230 $(subst $(space),|,'Failed to select operating system with $$(ASR_OS) == "$(ASR_$(ASR_OS))"')
    231 ASR_OS_TYPE = ASR_BAD_OS
    232 endif
    233 endif
    234 endif
    235 endif
    236 endif
    237 endif
    238 endif
    239 endif
    240 endif
    241 endif
    242 endif
    243 endif
    244 
    245 
    246 ################################## HOST_OS ##################################
    247 
    248 ifeq ("$(ASR_HOST_OS)","MSDOS")
    249 ASR_HOST_OS_TYPE = $(ASR_OS_MSDOS)
    250 
    251 else								# same as OS = "Windows_NT"
    252 ifeq ("$(ASR_HOST_OS)","WIN32")
    253 ASR_HOST_OS_TYPE = $(ASR_OS_WIN32)
    254 
    255 else								# same as OS = "WIN32"
    256 ifeq ("$(ASR_HOST_OS)","Windows_NT")
    257 ASR_HOST_OS_TYPE = $(ASR_OS_WIN32)
    258 
    259 else
    260 ifeq ("$(ASR_HOST_OS)","MAC")
    261 ASR_HOST_OS_TYPE = $(ASR_OS_MAC)
    262 
    263 else
    264 ifeq ("$(ASR_HOST_OS)","UNIX")
    265 ASR_HOST_OS_TYPE = $(ASR_OS_UNIX)
    266 
    267 else
    268 ifeq ("$(ASR_HOST_OS)","EMBEDDED")
    269 ASR_HOST_OS_TYPE = $(ASR_OS_EMBEDDED)
    270 
    271 else
    272 ifeq ("$(ASR_HOST_OS)","VXWORKS")
    273 ASR_HOST_OS_TYPE = $(ASR_OS_VXWORKS)
    274 
    275 else
    276 ifeq ("$(ASR_HOST_OS)","PSOS")
    277 ASR_HOST_OS_TYPE = $(ASR_OS_PSOS)
    278 
    279 else
    280 ifeq ("$(ASR_HOST_OS)","Wince")
    281 ASR_HOST_OS_TYPE = $(ASR_OS_WINCE)
    282 
    283 else
    284 ifeq ("$(ASR_HOST_OS)","PALM")
    285 ASR_HOST_OS_TYPE = $(ASR_OS_PALM)
    286 
    287 else
    288 ifeq ("$(ASR_HOST_OS)","JAVA")
    289 ASR_HOST_OS_TYPE = $(ASR_OS_JAVA)
    290 
    291 else
    292 ifeq ("$(ASR_HOST_OS)","QNX")
    293 ASR_HOST_OS_TYPE = $(ASR_OS_QNX)
    294 
    295 else
    296 ERROR += \
    297 $(subst $(space),|,'Failed to select operating system with $$(ASR_HOST_OS) == "$(ASR_HOST_OS)"')
    298 ASR_HOST_OS_TYPE = ASR_BAD_OS
    299 endif
    300 endif
    301 endif
    302 endif
    303 endif
    304 endif
    305 endif
    306 endif
    307 endif
    308 endif
    309 endif
    310 endif
    311 
    312 ################################## TARGET_OS ##################################
    313 
    314 ifeq ("$(ASR_TARGET_OS)","MSDOS")
    315 ASR_TARGET_OS_TYPE = $(ASR_OS_MSDOS)
    316 
    317 else								# same as OS = "Windows_NT"
    318 ifeq ("$(ASR_TARGET_OS)","WIN32")
    319 ASR_TARGET_OS_TYPE = $(ASR_OS_WIN32)
    320 
    321 else								# same as OS = "WIN32"
    322 ifeq ("$(ASR_TARGET_OS)","Windows_NT")
    323 ASR_TARGET_OS_TYPE = $(ASR_OS_WIN32)
    324 
    325 else
    326 ifeq ("$(ASR_TARGET_OS)","MAC")
    327 ASR_TARGET_OS_TYPE = $(ASR_OS_MAC)
    328 
    329 else
    330 ifeq ("$(ASR_TARGET_OS)","UNIX")
    331 ASR_TARGET_OS_TYPE = $(ASR_OS_UNIX)
    332 
    333 else
    334 ifeq ("$(ASR_TARGET_OS)","EMBEDDED")
    335 ASR_TARGET_OS_TYPE = $(ASR_OS_EMBEDDED)
    336 
    337 else
    338 ifeq ("$(ASR_TARGET_OS)","VXWORKS")
    339 ASR_TARGET_OS_TYPE = $(ASR_OS_VXWORKS)
    340 
    341 else
    342 ifeq ("$(ASR_TARGET_OS)","PSOS")
    343 ASR_TARGET_OS_TYPE = $(ASR_OS_PSOS)
    344 
    345 else
    346 ifeq ("$(ASR_TARGET_OS)","Wince")
    347 ASR_TARGET_OS_TYPE = $(ASR_OS_WINCE)
    348 
    349 else
    350 ifeq ("$(ASR_TARGET_OS)","PALM")
    351 ASR_TARGET_OS_TYPE = $(ASR_OS_PALM)
    352 
    353 else
    354 ifeq ("$(ASR_TARGET_OS)","JAVA")
    355 ASR_TARGET_OS_TYPE = $(ASR_OS_JAVA)
    356 
    357 else
    358 ifeq ("$(ASR_TARGET_OS)","QNX")
    359 ASR_TARGET_OS_TYPE = $(ASR_OS_QNX)
    360 
    361 else
    362 ERROR += \
    363 $(subst $(space),|,'Failed to select operating system with $$(ASR_TARGET_OS) == "$(ASR_TARGET_OS)"')
    364 ASR_TARGET_OS_TYPE = ASR_BAD_OS
    365 endif
    366 endif
    367 endif
    368 endif
    369 endif
    370 endif
    371 endif
    372 endif
    373 endif
    374 endif
    375 endif
    376 endif
    377 
    378 ################################## CPU #################################
    379 
    380 ifeq ("$(ASR_CPU)","I86")
    381 ASR_CPU_TYPE = $(ASR_CPU_I86)
    382 ASR_CPU_CHARS = in
    383 
    384 else
    385 ifeq ("$(ASR_CPU)", "SIMNT")
    386 ASR_CPU_TYPE = $(ASR_CPU_I86)
    387 ASR_CPU_CHARS = in
    388 
    389 else
    390 ifeq ("$(ASR_CPU)","68K")
    391 ASR_CPU_TYPE = $(ASR_CPU_68K)
    392 ASR_CPU_CHARS = mo
    393 
    394 else
    395 ifeq ("$(ASR_CPU)","MIPS")
    396 ASR_CPU_TYPE = $(ASR_CPU_MIPS)
    397 ASR_CPU_CHARS = mi
    398 
    399 else
    400 ifeq ("$(ASR_CPU)","ALPHA")
    401 ASR_CPU_TYPE = $(ASR_CPU_ALPHA)
    402 ASR_CPU_CHARS = al
    403 
    404 else
    405 ifeq ("$(ASR_CPU)","PPC")
    406 ASR_CPU_TYPE = $(ASR_CPU_PPC)
    407 ASR_CPU_CHARS = pp
    408 
    409 else
    410 ifeq ("$(ASR_CPU)","SPARC")
    411 ASR_CPU_TYPE = $(ASR_CPU_SPARC)
    412 ASR_CPU_CHARS = pp
    413 
    414 else
    415 ifeq ("$(ASR_CPU)","ARM")
    416 ASR_CPU_TYPE = $(ASR_CPU_ARM)
    417 ASR_CPU_CHARS = ar
    418 
    419 else
    420 ifeq ("$(ASR_CPU)","STRONGARM")
    421 ASR_CPU_TYPE = $(ASR_CPU_STRONGARM)
    422 ASR_CPU_CHARS = sa
    423 
    424 else
    425 ifeq ("$(ASR_CPU)","TMS320X")
    426 ASR_CPU_TYPE = $(ASR_CPU_TMS320X)
    427 ASR_CPU_CHARS = ti
    428 
    429 ifndef CPU_FAMILY
    430 CPU_FAMILY_TYPE = 0
    431 MESSAGE += \
    432 $(subst $(space),|,'$$(ASR_CPU_FAMILY_TYPE) defaulted to "$(ASR_CPU_FAMILY_TYPE)"')
    433 
    434 else
    435 ASR_CPU_CHARS = T$(ASR_CPU_FAMILY)
    436 
    437 ifeq ("$(ASR_CPU_FAMILY)","3")
    438 ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C30)
    439 
    440 else
    441 ifeq ("$(ASR_CPU_FAMILY)","4")
    442 ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C40)
    443 
    444 else
    445 ifeq ("$(ASR_CPU_FAMILY)","2")
    446 ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C2XX)
    447 
    448 else
    449 ifeq ("$(ASR_CPU_FAMILY)","5")
    450 ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C54X)
    451 
    452 else
    453 ERROR += \
    454 $(subst $(space),|,\
    455 'Failed to select CPU family with $$(ASR_CPU_FAMILY) == "$(ASR_CPU_FAMILY)"')
    456 ASR_CPU_FAMILY_TYPE=ASR_BAD_CPU_FAMILY
    457 endif
    458 endif
    459 endif
    460 endif
    461 endif
    462 
    463 else
    464 ifeq ("$(ASR_CPU)","SH3")
    465 ASR_CPU_TYPE = $(ASR_CPU_SH3)
    466 ASR_CPU_CHARS = hi
    467 
    468 else
    469 ifeq ("$(ASR_CPU)","SH4")
    470 ASR_CPU_TYPE = $(ASR_CPU_SH4)
    471 ASR_CPU_CHARS = hi
    472 
    473 else
    474 ERROR += \
    475 $(subst $(space),|,\
    476 'Failed to select CPU architecture with $$(ASR_CPU) == "$(ASR_$(ASR_CPU))"')
    477 ASR_CPU_TYPE = ASR_BAD_CPU
    478 ASR_CPU_CHARS = ASR_BAD_CPU
    479 endif
    480 endif
    481 endif
    482 endif
    483 endif
    484 endif
    485 endif
    486 endif
    487 endif
    488 endif
    489 endif
    490 endif
    491 
    492 ################################## HOST_CPU #################################
    493 
    494 ifeq ("$(ASR_HOST_CPU)","I86")
    495 ASR_HOST_CPU_TYPE = $(ASR_CPU_I86)
    496 
    497 else
    498 ifeq ("$(ASR_HOST_CPU)","68K")
    499 ASR_HOST_CPU_TYPE = $(ASR_CPU_68K)
    500 
    501 else
    502 ifeq ("$(ASR_HOST_CPU)","MIPS")
    503 ASR_HOST_CPU_TYPE = $(ASR_CPU_MIPS)
    504 
    505 else
    506 ifeq ("$(ASR_HOST_CPU)","ALPHA")
    507 ASR_HOST_CPU_TYPE = $(ASR_CPU_ALPHA)
    508 
    509 else
    510 ifeq ("$(ASR_HOST_CPU)","PPC")
    511 ASR_HOST_CPU_TYPE = $(ASR_CPU_PPC)
    512 
    513 else
    514 ifeq ("$(ASR_HOST_CPU)","SPARC")
    515 ASR_HOST_CPU_TYPE = $(ASR_CPU_SPARC)
    516 
    517 else
    518 ifeq ("$(ASR_HOST_CPU)","ARM")
    519 ASR_HOST_CPU_TYPE = $(ASR_CPU_ARM)
    520 
    521 else
    522 ifeq ("$(ASR_HOST_CPU)","STRONGARM")
    523 ASR_HOST_CPU_TYPE = $(ASR_CPU_STRONGARM)
    524 
    525 else
    526 ifeq ("$(ASR_HOST_CPU)","TMS320X")
    527 ASR_HOST_CPU_TYPE = $(ASR_CPU_TMS320X)
    528 
    529 ifndef CPU_FAMILY
    530 ASR_CPU_FAMILY_TYPE = 0
    531 MESSAGE += \
    532 $(subst $(space),|,'$$(ASR_CPU_FAMILY_TYPE) defaulted to "$(ASR_CPU_FAMILY_TYPE)"')
    533 
    534 else
    535 
    536 ifeq ("$(ASR_CPU_FAMILY)","3")
    537 ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C30)
    538 
    539 else
    540 ifeq ("$(ASR_CPU_FAMILY)","4")
    541 ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C40)
    542 
    543 else
    544 ifeq ("$(ASR_CPU_FAMILY)","2")
    545 ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C2XX)
    546 
    547 else
    548 ifeq ("$(ASR_CPU_FAMILY)","5")
    549 ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C54X)
    550 
    551 else
    552 ERROR += \
    553 $(subst $(space),|,\
    554 'Failed to select CPU family with $$(ASR_CPU_FAMILY) == "$(ASR_CPU_FAMILY)"')
    555 ASR_CPU_FAMILY_TYPE=ASR_BAD_CPU_FAMILY
    556 endif
    557 endif
    558 endif
    559 endif
    560 endif
    561 
    562 else
    563 ifeq ("$(ASR_HOST_CPU)","SH3")
    564 ASR_HOST_CPU_TYPE = $(ASR_CPU_SH3)
    565 
    566 else
    567 ifeq ("$(ASR_HOST_CPU)","SH4")
    568 ASR_HOST_CPU_TYPE = $(ASR_CPU_SH4)
    569 
    570 
    571 else
    572 ERROR += \
    573 $(subst $(space),|,\
    574 'Failed to select CPU architecture with $$(ASR_HOST_CPU) == "$(ASR_HOST_CPU)"')
    575 ASR_HOST_CPU_TYPE = ASR_BAD_CPU
    576 endif
    577 endif
    578 endif
    579 endif
    580 endif
    581 endif
    582 endif
    583 endif
    584 endif
    585 endif
    586 endif
    587 
    588 ################################## TARGET_CPU #################################
    589 
    590 ifeq ("$(ASR_TARGET_CPU)","I86")
    591 ASR_TARGET_CPU_TYPE = $(ASR_CPU_I86)
    592 
    593 else
    594 ifeq ("$(ASR_TARGET_CPU)","68K")
    595 ASR_TARGET_CPU_TYPE = $(ASR_CPU_68K)
    596 
    597 else
    598 ifeq ("$(ASR_TARGET_CPU)","MIPS")
    599 ASR_TARGET_CPU_TYPE = $(ASR_CPU_MIPS)
    600 
    601 else
    602 ifeq ("$(ASR_TARGET_CPU)","ALPHA")
    603 ASR_TARGET_CPU_TYPE = $(ASR_CPU_ALPHA)
    604 
    605 else
    606 ifeq ("$(ASR_TARGET_CPU)","PPC")
    607 ASR_TARGET_CPU_TYPE = $(ASR_CPU_PPC)
    608 
    609 else
    610 ifeq ("$(ASR_TARGET_CPU)","SPARC")
    611 ASR_TARGET_CPU_TYPE = $(ASR_CPU_SPARC)
    612 
    613 else
    614 ifeq ("$(ASR_TARGET_CPU)","ARM")
    615 ASR_TARGET_CPU_TYPE = $(ASR_CPU_ARM)
    616 
    617 else
    618 ifeq ("$(ASR_TARGET_CPU)","STRONGARM")
    619 ASR_TARGET_CPU_TYPE = $(ASR_CPU_STRONGARM)
    620 
    621 else
    622 ifeq ("$(ASR_TARGET_CPU)","TMS320X")
    623 ASR_TARGET_CPU_TYPE = $(ASR_CPU_TMS320X)
    624 
    625 ifndef CPU_FAMILY
    626 ASR_CPU_FAMILY_TYPE = 0
    627 MESSAGE += \
    628 $(subst $(space),|,'$$(ASR_CPU_FAMILY_TYPE) defaulted to "$(ASR_CPU_FAMILY_TYPE)"')
    629 
    630 else
    631 
    632 ifeq ("$(ASR_CPU_FAMILY)","3")
    633 ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C30)
    634 
    635 else
    636 ifeq ("$(ASR_CPU_FAMILY)","4")
    637 ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C40)
    638 
    639 else
    640 ifeq ("$(ASR_CPU_FAMILY)","2")
    641 ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C2XX)
    642 
    643 else
    644 ifeq ("$(ASR_CPU_FAMILY)","5")
    645 ASR_CPU_FAMILY_TYPE = $(ASR_CPU_FAMILY_TMS320C54X)
    646 
    647 else
    648 ERROR += \
    649 $(subst $(space),|,\
    650 'Failed to select CPU family with $$(ASR_CPU_FAMILY) == "$(ASR_CPU_FAMILY)"')
    651 ASR_CPU_FAMILY_TYPE=ASR_BAD_CPU_FAMILY
    652 endif
    653 endif
    654 endif
    655 endif
    656 endif
    657 
    658 else
    659 ifeq ("$(ASR_TARGET_CPU)","SH3")
    660 ASR_TARGET_CPU_TYPE = $(ASR_CPU_SH3)
    661 
    662 else
    663 ifeq ("$(ASR_TARGET_CPU)","SH4")
    664 ASR_TARGET_CPU_TYPE = $(ASR_CPU_SH4)
    665 
    666 else
    667 
    668 ERROR += \
    669 $(subst $(space),|,\
    670 'Failed to select CPU architecture with $$(ASR_TARGET_CPU) == "$(ASR_TARGET_CPU)"')
    671 ASR_TARGET_CPU_TYPE = ASR_BAD_CPU
    672 endif
    673 endif
    674 endif
    675 endif
    676 endif
    677 endif
    678 endif
    679 endif
    680 endif
    681 endif
    682 endif
    683 
    684 
    685 ############################### COMPILER ###############################
    686 #
    687 # $(ASR_COMPILER_CHAR) is also used to select which flags makefile to include.
    688 
    689 ifeq ("$(ASR_COMPILER)","BORLAND")		# !!! NOT SURE WHAT STRING TO USE !!!
    690 ASR_COMPILER_TYPE = $(ASR_C_BORLAND)
    691 
    692 else								# same as COMPILER = "M$$"
    693 ifeq ("$(ASR_COMPILER)","MS")
    694 ASR_COMPILER_TYPE = $(ASR_C_MICROSOFT)
    695 
    696 else
    697 ifeq ("$(ASR_COMPILER)","INTEL")		# !!! NOT SURE WHAT STRING TO USE !!!
    698 ASR_COMPILER_TYPE = $(ASR_C_INTEL)
    699 
    700 else
    701 ifeq ("$(ASR_COMPILER)","HIGH")			# !!! NOT SURE WHAT STRING TO USE !!!
    702 ASR_COMPILER_TYPE = $(ASR_C_HIGH)
    703 
    704 else
    705 ifeq ("$(ASR_COMPILER)","ZORTECH")		# !!! NOT SURE WHAT STRING TO USE !!!
    706 ASR_COMPILER_TYPE = $(ASR_C_ZORTECH)
    707 
    708 else
    709 ifeq ("$(ASR_COMPILER)","WATCOM")		# !!! NOT SURE WHAT STRING TO USE !!!
    710 ASR_COMPILER_TYPE = $(ASR_C_WATCOM)
    711 
    712 else
    713 ifeq ("$(ASR_COMPILER)","GNU")			# !!! NOT SURE WHAT STRING TO USE !!!
    714 ASR_COMPILER_TYPE = $(ASR_C_GNU)
    715 
    716 else
    717 ifeq ("$(ASR_COMPILER)","SUNPRO")		# !!! NOT SURE WHAT STRING TO USE !!!
    718 ASR_COMPILER_TYPE = $(ASR_C_SUNPRO)
    719 
    720 else
    721 ifeq ("$(ASR_COMPILER)","DECCXX")		# !!! NOT SURE WHAT STRING TO USE !!!
    722 ASR_COMPILER_TYPE = $(ASR_C_DECCXX)
    723 
    724 else
    725 ifeq ("$(ASR_COMPILER)","METROWERKS")	# !!! NOT SURE WHAT STRING TO USE !!!
    726 ASR_COMPILER_TYPE = $(ASR_C_METROWERKS)
    727 
    728 else
    729 ifeq ("$(ASR_COMPILER)","GHS")			# !!! NOT SURE WHAT STRING TO USE !!!
    730 ASR_COMPILER_TYPE = $(ASR_C_GHS)
    731 
    732 else
    733 ifeq ("$(ASR_COMPILER)","TICXC")		# !!! NOT SURE WHAT STRING TO USE !!!
    734 ASR_COMPILER_TYPE = $(ASR_C_TICXC)
    735 
    736 else
    737 ifeq ("$(ASR_COMPILER)","ARM")			# !!! NOT ANY PARTICULAR COMPILER !!!
    738 ASR_COMPILER_TYPE = $(ASR_C_ARM)
    739 
    740 else
    741 ifeq ("$(ASR_COMPILER)","DIABDATA")			# !!! NOT ANY PARTICULAR COMPILER !!!
    742 ASR_COMPILER_TYPE = $(ASR_C_DIABDATA)
    743 
    744 else
    745 ERROR += \
    746 $(subst $(space),|,\
    747 'Failed to select compiler with $$(ASR_COMPILER) == "$(ASR_COMPILER)"')
    748 ASR_COMPILER_TYPE = ASR_BAD_COMPILER
    749 ASR_COMPILER_CHAR = ASR_BAD_COMPILER
    750 endif
    751 endif
    752 endif
    753 endif
    754 endif
    755 endif
    756 endif
    757 endif
    758 endif
    759 endif
    760 endif
    761 endif
    762 endif
    763 endif
    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 
    770 ASR_OPTIMIZE = $(ASR_OFF)
    771 ASR_PROFILE = $(ASR_OFF)
    772 ASR_TRACE = $(ASR_OFF)
    773 
    774 #									# BUILD  CHAR  OPTIMIZE  PROFILE  TRACE
    775 #									  ----   ----  --------  -------  -----
    776 ifeq ("$(ASR_BUILD)","SHIP")			# SHIP    `S'  OPTIMIZE
    777 ASR_BUILD_TYPE = $(ASR_BUILD_SHIP)
    778 ASR_BUILD_CHAR = s
    779 ASR_OPTIMIZE = $(ASR_BUILD_TYPE)
    780 
    781 else
    782 ifeq ("$(ASR_BUILD)","NDEBUG")			# SHIP    `S'  OPTIMIZE
    783 ASR_BUILD_TYPE = $(ASR_BUILD_SHIP)
    784 ASR_BUILD_CHAR = s
    785 ASR_OPTIMIZE = $(ASR_BUILD_TYPE)
    786 
    787 else
    788 ifeq ("$(ASR_BUILD)","INHOUSE")			# INHOUSE `I'  OPTIMIZE
    789 ASR_BUILD_TYPE = $(ASR_BUILD_INHOUSE)
    790 ASR_BUILD_CHAR = i
    791 ASR_OPTIMIZE = $(ASR_BUILD_TYPE)
    792 
    793 else
    794 ifeq ("$(ASR_BUILD)","DEBUGO")			# DEBUG   `G'  OPTIMIZE
    795 ASR_BUILD_TYPE = $(ASR_BUILD_DEBUGO)
    796 ASR_BUILD_CHAR = g
    797 ASR_OPTIMIZE = $(ASR_BUILD_TYPE)
    798 
    799 else
    800 ifeq ("$(ASR_BUILD)","DEBUG")			# DEBUG   `X'
    801 ASR_BUILD_TYPE = $(ASR_BUILD_DEBUG)
    802 ASR_BUILD_CHAR = x
    803 
    804 else
    805 ifeq ("$(ASR_BUILD)","PROFILE")			# INHOUSE `P'  OPTIMIZE  PROFILE
    806 ASR_BUILD_TYPE = $(ASR_BUILD_PROFILE)
    807 ASR_BUILD_CHAR = p
    808 ASR_OPTIMIZE = $(ASR_BUILD_TYPE)
    809 ASR_PROFILE = $(ASR_BUILD_TYPE)
    810 
    811 else
    812 ifeq ("$(ASR_BUILD)","TRACE")			# INHOUSE `L'  OPTIMIZE           TRACE
    813 ASR_BUILD_TYPE = $(ASR_BUILD_TRACE)
    814 ASR_BUILD_CHAR = l
    815 ASR_OPTIMIZE = $(ASR_BUILD_TYPE)
    816 ASR_TRACE = $(ASR_BUILD_TYPE)
    817 
    818 else
    819 ERROR += \
    820 $(subst $(space),|,'Failed to select build type with $$(ASR_BUILD) == "$(ASR_BUILD)"')
    821 ASR_BUILD_TYPE = ASR_BAD_BUILD
    822 ASR_BUILD_CHAR = ASR_BAD_BUILD
    823 endif
    824 endif
    825 endif
    826 endif
    827 endif
    828 endif
    829 endif
    830 
    831 ################################# UI #################################
    832 #
    833 # !!! NOT USED !!!
    834 
    835 ######################################################################
    836 #
    837 # Finally define the macros of interest.
    838 
    839 ASR_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
    869 ASR_GLOBAL_DEFINES += $(ASR_COMMON_DEFINES) $(ASR_WORKAROUND_DEFINES)
    870 
    871 # OS specific defines
    872 ifeq ($(ASR_TARGET_OS),UNIX)
    873 ASR_GLOBAL_DEFINES += -DPOSIX -D__linux
    874 endif
    875 
    876 
    877 # BUILD specific defines and flags
    878 ASR_GLOBAL_CPPFLAGS =
    879 
    880 ifeq ($(ASR_BUILD),SHIP)
    881 ASR_GLOBAL_DEFINES += -DNDEBUG -D_SHIP -DFINAL_RELEASE
    882 #ASR_GLOBAL_CPPFLAGS += -O3 -fno-strict-aliasing
    883 endif
    884 
    885 ifeq ($(ASR_BUILD),NDEBUG)
    886 ASR_GLOBAL_DEFINES += -DNDEBUG
    887 #ASR_GLOBAL_CPPFLAGS +=
    888 endif
    889 
    890 ifeq ($(ASR_BUILD),INHOUSE)
    891 ASR_GLOBAL_DEFINES += -D_INHOUSE
    892 #ASR_GLOBAL_CPPFLAGS += -g3
    893 endif
    894 
    895 ifeq ($(ASR_BUILD),DEBUGO)
    896 ASR_GLOBAL_DEFINES += -D_DEBUG
    897 #ASR_GLOBAL_CPPFLAGS += -g
    898 endif
    899 
    900 ifeq ($(ASR_BUILD),DEBUG)
    901 ASR_GLOBAL_DEFINES += -D_DEBUG
    902 #ASR_GLOBAL_CPPFLAGS += -g
    903 endif
    904 
    905 ifneq ($(ASR_OPTIMIZE),$(ASR_OFF))
    906 ASR_GLOBAL_DEFINES += -D_OPTIMIZE
    907 #ASR_GLOBAL_CPPFLAGS += -O3
    908 endif
    909 
    910 ifneq ($(ASR_PROFILE),$(ASR_OFF))
    911 ASR_GLOBAL_DEFINES += -D_PROFILE
    912 #ASR_GLOBAL_CPPFLAGS += -g3
    913 endif
    914 
    915 ifneq ($(ASR_TRACE),$(ASR_OFF))
    916 ASR_GLOBAL_DEFINES += -D_TRACE
    917 #ASR_GLOBAL_CPPFLAGS +=
    918 endif
    919