Ignore:
Timestamp:
Jul 21, 2006, 9:03:13 PM (19 years ago)
Author:
bird
Message:

win and nt targets and platforms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/header.kmk

    r472 r478  
    7575# @param    $1   String 1.
    7676# @param    $2   String 2
    77 STRCMP = $(
     77STRCMP = $( todo )
    7878
    7979#
     
    100100# Assert build platform.
    101101#
    102 _BUILD_PLATFORM_OK  := 0
    103 # OS/2 (have uppercase legacy)
    104 ifeq ($(BUILD_PLATFORM),OS2)
    105 override BUILD_PLATFORM := os2
    106 endif
    107 ifeq ($(BUILD_PLATFORM),os2)
    108 _BUILD_PLATFORM_OK  := 1
    109 endif
    110 
    111 # Linux
    112 ifeq ($(BUILD_PLATFORM),LINUX)
    113 $(error kBuild: BUILD_PLATFORM must be all lowercase!)
    114 endif
    115 ifeq ($(BUILD_PLATFORM),linux)
    116 _BUILD_PLATFORM_OK  := 1
    117 endif
    118 
    119 # Win32
    120 ifeq ($(BUILD_PLATFORM),WIN32)
    121 $(error kBuild: BUILD_PLATFORM must be all lowercase!)
    122 endif
    123 ifeq ($(BUILD_PLATFORM),win32)
    124 _BUILD_PLATFORM_OK  := 1
    125 endif
    126 
    127 # Win64
    128 ifeq ($(BUILD_PLATFORM),WIN64)
    129 $(error kBuild: BUILD_PLATFORM must be all lowercase!)
    130 endif
    131 ifeq ($(BUILD_PLATFORM),win64)
    132 _BUILD_PLATFORM_OK  := 1
    133 endif
    134 
    135 # L4
    136 ifeq ($(BUILD_PLATFORM),L4)
    137 $(error kBuild: BUILD_PLATFORM must be all lowercase!)
    138 endif
    139 ifeq ($(BUILD_PLATFORM),l4)
    140 _BUILD_PLATFORM_OK  := 1
    141 endif
    142 
    143 # FreeBSD
    144 ifeq ($(BUILD_PLATFORM),FreeBSD)
    145 $(error kBuild: BUILD_PLATFORM must be all lowercase!)
    146 endif
    147 ifeq ($(BUILD_PLATFORM),freebsd)
    148 _BUILD_PLATFORM_OK  := 1
    149 endif
    150 
    151 ifeq ($(_BUILD_PLATFORM_OK),0)
    152 $(error kBuild: BUILD_PLATFORM value '$(BUILD_PLATFORM)' was not recongized!)
     102ifndef BUILD_PLATFORM
     103 $(error kBuild: BUILD_PLATFORM is undefined!)
     104else
     105 BUILD_PLATFORM     := $(strip $(BUILD_PLATFORM))
     106 ifneq ($(words $(BUILD_PLATFORM))$(filter-out freebsd l4 linux nt os2 win win32 win64,$(BUILD_PLATFORM)),1)
     107  # OS/2 (have uppercase legacy)
     108  ifeq ($(BUILD_PLATFORM),OS2)
     109   $(error kBuild: BUILD_PLATFORM must be all lowercase!)
     110  endif
     111  $(error kBuild: BUILD_PLATFORM value '$(BUILD_PLATFORM)' was not recognized!)
     112 endif
    153113endif
    154114
    155115# Fill in defaults if needed.
    156116ifndef BUILD_PLATFORM_ARCH
    157 ifeq ($(filter-out win64,$(BUILD_PLATFORM)),)
    158 BUILD_PLATFORM_ARCH  := amd64
    159 else
    160 BUILD_PLATFORM_ARCH  := x86
    161 endif
     117 ifeq ($(filter-out win64,$(BUILD_PLATFORM)),)
     118  BUILD_PLATFORM_ARCH := amd64
     119 else
     120  BUILD_PLATFORM_ARCH := x86
     121 endif
    162122endif
    163123ifndef BUILD_PLATFORM_CPU
    164 ifeq ($(filter-out amd64,$(BUILD_PLATFORM_ARCH)),)
    165 BUILD_PLATFORM_CPU    := k8
    166 else
    167 BUILD_PLATFORM_CPU    := i586
    168 endif
     124 ifeq ($(filter-out amd64,$(BUILD_PLATFORM_ARCH)),)
     125  BUILD_PLATFORM_CPU:= k8
     126 else
     127  BUILD_PLATFORM_CPU:= i586
     128 endif
    169129endif
    170130
     
    177137BUILD_TARGET        := $(BUILD_PLATFORM)
    178138else
    179 _BUILD_TARGET_OK    := 0
    180 # OS/2
    181 ifeq ($(BUILD_TARGET),OS2)
    182 $(error kBuild: BUILD_TARGET must be all lowercase!)
    183 endif
    184 ifeq ($(BUILD_TARGET),os2)
    185 _BUILD_TARGET_OK    := 1
    186 endif
    187 
    188 # Linux
    189 ifeq ($(BUILD_TARGET),LINUX)
    190 $(error kBuild: BUILD_TARGET must be all lowercase!)
    191 endif
    192 ifeq ($(BUILD_TARGET),linux)
    193 _BUILD_TARGET_OK    := 1
    194 endif
    195 
    196 # Win32
    197 ifeq ($(BUILD_TARGET),WIN32)
    198 $(error kBuild: BUILD_TARGET must be all lowercase!)
    199 endif
    200 ifeq ($(BUILD_TARGET),win32)
    201 _BUILD_TARGET_OK    := 1
    202 endif
    203 
    204 # Win64
    205 ifeq ($(BUILD_TARGET),WIN64)
    206 $(error kBuild: BUILD_TARGET must be all lowercase!)
    207 endif
    208 ifeq ($(BUILD_TARGET),win64)
    209 _BUILD_TARGET_OK    := 1
    210 endif
    211 
    212 # L4
    213 ifeq ($(BUILD_TARGET),L4)
    214 $(error kBuild: BUILD_TARGET must be all lowercase!)
    215 endif
    216 ifeq ($(BUILD_TARGET),l4)
    217 _BUILD_TARGET_OK    := 1
    218 endif
    219 
    220 # FreeBSD
    221 ifeq ($(BUILD_TARGET),FreeBSD)
    222 $(error kBuild: BUILD_TARGET must be all lowercase!)
    223 endif
    224 ifeq ($(BUILD_TARGET),freebsd)
    225 _BUILD_TARGET_OK    := 1
    226 endif
    227 
    228 ifeq ($(_BUILD_TARGET_OK),0)
    229 $(error kBuild: BUILD_TARGET value '$(BUILD_TARGET)' was not recongized!)
    230 endif
     139 BUILD_TARGET       := $(strip $(BUILD_TARGET))
     140 ifneq ($(words $(BUILD_TARGET))$(filter-out freebsd l4 linux nt os2 win win32 win64,$(BUILD_TARGET)),1)
     141  # OS/2 (have uppercase legacy)
     142  ifeq ($(BUILD_TARGET),OS2)
     143   $(error kBuild: BUILD_TARGET must be all lowercase!)
     144  endif
     145  $(error kBuild: BUILD_TARGET value '$(BUILD_TARGET)' was not recognized!)
     146 endif
    231147endif
    232148
    233149# Fill in defaults if needed.
    234150ifndef BUILD_TARGET_ARCH
    235 BUILD_TARGET_ARCH   := x86
     151 BUILD_TARGET_ARCH  := x86
    236152endif
    237153ifndef BUILD_TARGET_CPU
    238 BUILD_TARGET_CPU    := i586
     154 BUILD_TARGET_CPU   := i586
    239155endif
    240156
     
    326242# Build platform setup.
    327243#
    328 PATH_TOOLS          := $(PATH_KBUILD)/bin/$(BUILD_PLATFORM_ARCH).$(BUILD_PLATFORM)
    329 
    330244# OS/2
    331245ifeq ($(BUILD_PLATFORM),os2)
     
    350264EXEC_X86_WIN32      := wine
    351265HOSTSUFF_EXE        :=
     266endif
     267
     268PATH_TOOLS          := $(PATH_KBUILD)/bin/$(BUILD_PLATFORM_ARCH).$(BUILD_PLATFORM)
     269ifeq ($(wildcard $(PATH_TOOLS)/kmk_ash$(HOSTSUFF_EXE)),)
     270 ifeq ($(BUILD_TARGET_ARCH),amd64)
     271  PATH_TOOLS        := $(PATH_KBUILD)/bin/x86.$(BUILD_PLATFORM)
     272 endif
     273 ifeq ($(wildcard $(PATH_TOOLS)/kmk_ash$(HOSTSUFF_EXE)),)
     274  ifeq ($(filter-out win64 nt,$(BUILD_PLATFORM)),)
     275   PATH_TOOLS       := $(PATH_KBUILD)/bin/x86.win32
     276  endif
     277 endif
     278 ifeq ($(wildcard $(PATH_TOOLS)/kmk_ash$(HOSTSUFF_EXE)),)
     279  # give up
     280  PATH_TOOLS        := $(PATH_KBUILD)/bin/$(BUILD_PLATFORM_ARCH).$(BUILD_PLATFORM)
     281 endif
    352282endif
    353283
Note: See TracChangeset for help on using the changeset viewer.