| 1 | # $Id: process.mak,v 1.18 2002-08-20 05:53:26 bird Exp $ | 
|---|
| 2 |  | 
|---|
| 3 | # | 
|---|
| 4 | # Unix-like tools for OS/2 | 
|---|
| 5 | # | 
|---|
| 6 | #   The common build process rules | 
|---|
| 7 | # | 
|---|
| 8 | # Note: this makefile is supposed to be included from the | 
|---|
| 9 | # current source path. | 
|---|
| 10 | # | 
|---|
| 11 |  | 
|---|
| 12 |  | 
|---|
| 13 | # ----------------------------------------------------------------------------- | 
|---|
| 14 | # Assertions. | 
|---|
| 15 | #   This makefile expects setup.mak and the specific setup to be included | 
|---|
| 16 | #   already. | 
|---|
| 17 | #   It also requires the TARGET_NAME to be specified in the makefile. | 
|---|
| 18 | # ----------------------------------------------------------------------------- | 
|---|
| 19 | !if "$(MAKE_SETUP_INCLUDED)"  != "YES" | 
|---|
| 20 | ! ifndef MAKEVER | 
|---|
| 21 | !  if [$(ECHO) $(CLRERR)Fatal error: You must include setup.mak before process.mak in the makefile.$(CLRRST)] | 
|---|
| 22 | !  endif | 
|---|
| 23 | !  error | 
|---|
| 24 | !else | 
|---|
| 25 | !  error $(CLRERR)Fatal error: You must include setup.mak before process.mak in the makefile.$(CLRRST) | 
|---|
| 26 | !endif | 
|---|
| 27 | !endif | 
|---|
| 28 | !if "$(ENV_STATUS)" != "OK" | 
|---|
| 29 | ! ifndef MAKEVER | 
|---|
| 30 | !  if [$(ECHO) $(CLRERR)Fatal error: The environment is not valid. Bad setup.mak?$(CLRRST)] | 
|---|
| 31 | !  endif | 
|---|
| 32 | !  error | 
|---|
| 33 | ! else | 
|---|
| 34 | !  error $(CLRERR)Fatal error: The environment is not valid. Bad setup.mak?$(CLRRST) | 
|---|
| 35 | ! endif | 
|---|
| 36 | !endif | 
|---|
| 37 |  | 
|---|
| 38 | !if "$(TARGET_NAME)" == "" && "$(TARGET_MODE)" != "EMPTY" | 
|---|
| 39 | ! ifndef MAKEVER | 
|---|
| 40 | !  if [$(ECHO) $(CLRERR)Fatal error: TARGET_NAME is not defined! Should be set in the makefile.$(CLRRST)] | 
|---|
| 41 | !  endif | 
|---|
| 42 | !  error | 
|---|
| 43 | ! else | 
|---|
| 44 | !  error $(CLRERR)Fatal error: TARGET_NAME is not defined! Should be set in the makefile.$(CLRRST) | 
|---|
| 45 | ! endif | 
|---|
| 46 | !endif | 
|---|
| 47 |  | 
|---|
| 48 | !ifdef TARGET_MODE | 
|---|
| 49 | # Executable target mode. | 
|---|
| 50 | ! if "$(TARGET_MODE)" != "EXE" | 
|---|
| 51 | # Dynamic Load Library target mode. | 
|---|
| 52 | !  if "$(TARGET_MODE)" != "DLL" | 
|---|
| 53 | # Drive (/ system software) target mode. | 
|---|
| 54 | !   if "$(TARGET_MODE)" != "SYS" | 
|---|
| 55 | # Installable File System Drive target mode. (Also called FSD, File System Driver.) | 
|---|
| 56 | !    if "$(TARGET_MODE)" != "IFS" | 
|---|
| 57 | # Virtual Device Driver target mode. | 
|---|
| 58 | !     if "$(TARGET_MODE)" != "VDD" | 
|---|
| 59 | # Object Library target mode. | 
|---|
| 60 | !      if "$(TARGET_MODE)" != "LIB" | 
|---|
| 61 | # Object Library target mode - Special variant which is to be linked with a SYS target. | 
|---|
| 62 | !       if "$(TARGET_MODE)" != "SYSLIB" | 
|---|
| 63 | # Object Library target mode - Special variant which is to be linked with an IFS target. | 
|---|
| 64 | !        if "$(TARGET_MODE)" != "IFSLIB" | 
|---|
| 65 | # Dummy/Hub/TopLevel empty makefile. This has no target. | 
|---|
| 66 | !         if "$(TARGET_MODE)" != "EMPTY" | 
|---|
| 67 | # Dependency only makefile. (typical for include directories) | 
|---|
| 68 | !          if "$(TARGET_MODE)" != "DEPEND" | 
|---|
| 69 | # Testcase makefile. | 
|---|
| 70 | !           if "$(TARGET_MODE)" != "TESTCASE" | 
|---|
| 71 | # Bad TARGET_MODE complain. | 
|---|
| 72 | !            ifndef MAKEVER | 
|---|
| 73 | !             if [$(ECHO) $(CLRERR)Fatal Error: Bad TARGET_MODE="$(TARGET_MODE)". Valid ones are: EXE, DLL, SYS, IFS, VDD, LIB, SYSLIB, IFSLIB, TESTCASE and EMPTY.$(CLRRST)] | 
|---|
| 74 | !             endif | 
|---|
| 75 | !             error | 
|---|
| 76 | !            else | 
|---|
| 77 | !             error $(CLRERR)Fatal Error: Bad TARGET_MODE="$(TARGET_MODE)". Valid ones are: EXE, DLL, SYS, IFS, VDD, LIB, SYSLIB, IFSLIB, TESTCASE and EMPTY.$(CLRRST) | 
|---|
| 78 | !            endif | 
|---|
| 79 | !           endif | 
|---|
| 80 | !          endif | 
|---|
| 81 | !         endif | 
|---|
| 82 | !        endif | 
|---|
| 83 | !       endif | 
|---|
| 84 | !      endif | 
|---|
| 85 | !     endif | 
|---|
| 86 | !    endif | 
|---|
| 87 | !   endif | 
|---|
| 88 | !  endif | 
|---|
| 89 | ! endif | 
|---|
| 90 | !endif | 
|---|
| 91 |  | 
|---|
| 92 |  | 
|---|
| 93 | # ----------------------------------------------------------------------------- | 
|---|
| 94 | # Provide overridable defaults | 
|---|
| 95 | # ----------------------------------------------------------------------------- | 
|---|
| 96 |  | 
|---|
| 97 | # Default target mode is executable. | 
|---|
| 98 | !ifndef TARGET_MODE | 
|---|
| 99 | TARGET_MODE = EXE | 
|---|
| 100 | !endif | 
|---|
| 101 |  | 
|---|
| 102 | # Default extension corresponds to the target mode. | 
|---|
| 103 | !ifndef TARGET_EXT | 
|---|
| 104 | ! if "$(TARGET_MODE)" == "DLL" | 
|---|
| 105 | TARGET_EXT  = $(EXT_DLL) | 
|---|
| 106 | ! endif | 
|---|
| 107 | ! if "$(TARGET_MODE)" == "SYS" | 
|---|
| 108 | TARGET_EXT  = $(EXT_SYS) | 
|---|
| 109 | ! endif | 
|---|
| 110 | ! if "$(TARGET_MODE)" == "IFS" | 
|---|
| 111 | TARGET_EXT  = $(EXT_IFS) | 
|---|
| 112 | ! endif | 
|---|
| 113 | ! if "$(TARGET_MODE)" == "VDD" | 
|---|
| 114 | TARGET_EXT  = $(EXT_VDD) | 
|---|
| 115 | ! endif | 
|---|
| 116 | ! if "$(TARGET_MODE)" == "EXE" | 
|---|
| 117 | TARGET_EXT  = $(EXT_EXE) | 
|---|
| 118 | ! endif | 
|---|
| 119 | ! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB" | 
|---|
| 120 | TARGET_EXT  = $(EXT_LIB) | 
|---|
| 121 | ! endif | 
|---|
| 122 | ! if "$(TARGET_MODE)" == "EMPTY" | 
|---|
| 123 | TARGET_EXT  = empty | 
|---|
| 124 | ! endif | 
|---|
| 125 | ! if "$(TARGET_MODE)" == "DEPEND" | 
|---|
| 126 | TARGET_EXT  = depend | 
|---|
| 127 | ! endif | 
|---|
| 128 | ! if "$(TARGET_MODE)" == "TESTCASE" | 
|---|
| 129 | TARGET_EXT  = testcase | 
|---|
| 130 | ! endif | 
|---|
| 131 | ! ifndef TARGET_EXT | 
|---|
| 132 | !  ifndef MAKEVER | 
|---|
| 133 | !   if [$(ECHO) $(CLRERR)Internal Error: TARGET_EXT not set. Probably invalid TARGET_MODE. (TARGET_MODE="$(TARGET_MODE)")$(CLRRST)] | 
|---|
| 134 | !   endif | 
|---|
| 135 | !   error | 
|---|
| 136 | !  else | 
|---|
| 137 | !   error $(CLRERR)Internal Error: TARGET_EXT not set. Probably invalid TARGET_MODE. (TARGET_MODE="$(TARGET_MODE)")$(CLRRST) | 
|---|
| 138 | !  endif | 
|---|
| 139 | ! endif | 
|---|
| 140 | !endif | 
|---|
| 141 |  | 
|---|
| 142 | # Default target path. (where all the generated stuff for this target goes) | 
|---|
| 143 | !ifndef PATH_TARGET | 
|---|
| 144 | PATH_TARGET = $(PATH_OBJ)\$(TARGET_NAME).$(TARGET_EXT) | 
|---|
| 145 | !endif | 
|---|
| 146 |  | 
|---|
| 147 | # Default target file. (output) | 
|---|
| 148 | !ifndef TARGET | 
|---|
| 149 | ! if "$(TARGET_MODE)" != "EMPTY" | 
|---|
| 150 | !  if "$(TARGET_MODE)" != "TESTCASE" | 
|---|
| 151 | TARGET      = $(PATH_TARGET)\$(TARGET_NAME).$(TARGET_EXT) | 
|---|
| 152 | !  else | 
|---|
| 153 | TARGET      = testcase | 
|---|
| 154 | !  endif | 
|---|
| 155 | ! endif | 
|---|
| 156 | !endif | 
|---|
| 157 |  | 
|---|
| 158 | # Default target .sym file. (output) | 
|---|
| 159 | !ifndef TARGET_SYM | 
|---|
| 160 | TARGET_SYM  = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_SYM) | 
|---|
| 161 | !endif | 
|---|
| 162 |  | 
|---|
| 163 | # Default object file. (output) | 
|---|
| 164 | !ifndef TARGET_OBJS | 
|---|
| 165 | TARGET_OBJS = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_OBJ) | 
|---|
| 166 | !endif | 
|---|
| 167 |  | 
|---|
| 168 | # Default libraries. (input) | 
|---|
| 169 | !ifndef TARGET_LIBS | 
|---|
| 170 | TARGET_LIBS = $(LIB_C_DLL) $(LIB_OS) $(LIB_C_RTDLL) | 
|---|
| 171 | !endif | 
|---|
| 172 |  | 
|---|
| 173 | # Default definition file. (input) | 
|---|
| 174 | !ifndef TARGET_DEF | 
|---|
| 175 | TARGET_DEF  = $(MAKEDIR)\$(PATH_DEF)\$(TARGET_NAME).def | 
|---|
| 176 | !endif | 
|---|
| 177 |  | 
|---|
| 178 | # Default modified definition filename. (output) | 
|---|
| 179 | !ifndef TARGET_DEF_LINK | 
|---|
| 180 | TARGET_DEF_LINK = $(PATH_TARGET)\$(TARGET_NAME)_link.def | 
|---|
| 181 | !endif | 
|---|
| 182 |  | 
|---|
| 183 | # Default definition file for generating the import library. (input) | 
|---|
| 184 | !ifndef TARGET_IDEF | 
|---|
| 185 | TARGET_IDEF = $(TARGET_DEF) | 
|---|
| 186 | !endif | 
|---|
| 187 |  | 
|---|
| 188 | # Default map file. (output) | 
|---|
| 189 | !ifndef TARGET_MAP | 
|---|
| 190 | TARGET_MAP  = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_MAP) | 
|---|
| 191 | !endif | 
|---|
| 192 |  | 
|---|
| 193 | # Default link file. (output) | 
|---|
| 194 | !ifndef TARGET_LNK | 
|---|
| 195 | TARGET_LNK  = $(PATH_TARGET)\$(TARGET_NAME).lnk | 
|---|
| 196 | !endif | 
|---|
| 197 |  | 
|---|
| 198 | # Default import library file. (output) | 
|---|
| 199 | !ifndef TARGET_ILIB | 
|---|
| 200 | ! if "$(TARGET_MODE)" == "DLL" | 
|---|
| 201 | TARGET_ILIB =$(PATH_LIB)\$(TARGET_NAME).$(EXT_ILIB) | 
|---|
| 202 | ! endif | 
|---|
| 203 | !endif | 
|---|
| 204 |  | 
|---|
| 205 | # Default public name. (output) | 
|---|
| 206 | !ifndef TARGET_PUBNAME | 
|---|
| 207 | TARGET_PUBNAME= | 
|---|
| 208 | ! ifdef TARGET_PUBLIC | 
|---|
| 209 | !  if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB" | 
|---|
| 210 | TARGET_PUBNAME=$(PATH_LIB)\$(TARGET_NAME).$(TARGET_EXT) | 
|---|
| 211 | !  endif | 
|---|
| 212 | !  if "$(TARGET_MODE)" == "EXE" | 
|---|
| 213 | TARGET_PUBNAME=$(PATH_EXE)\$(TARGET_NAME).$(TARGET_EXT) | 
|---|
| 214 | !  endif | 
|---|
| 215 | !  if "$(TARGET_MODE)" == "DLL" | 
|---|
| 216 | TARGET_PUBNAME=$(PATH_DLL)\$(TARGET_NAME).$(TARGET_EXT) | 
|---|
| 217 | !  endif | 
|---|
| 218 | !  if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS" | 
|---|
| 219 | TARGET_PUBNAME=$(PATH_SYS)\$(TARGET_NAME).$(TARGET_EXT) | 
|---|
| 220 | !  endif | 
|---|
| 221 | !  if "$(TARGET_MODE)" == "VDD" | 
|---|
| 222 | TARGET_PUBNAME=$(PATH_VDD)\$(TARGET_NAME).$(TARGET_EXT) | 
|---|
| 223 | !  endif | 
|---|
| 224 | ! endif | 
|---|
| 225 | !endif | 
|---|
| 226 |  | 
|---|
| 227 | # Default depend filename. | 
|---|
| 228 | !ifndef TARGET_DEPEND | 
|---|
| 229 | TARGET_DEPEND = $(PATH_TARGET)\.depend | 
|---|
| 230 | !endif | 
|---|
| 231 |  | 
|---|
| 232 | # Default makefile names. | 
|---|
| 233 | !ifndef BUILD_MAKEFILE | 
|---|
| 234 | BUILD_MAKEFILE = Makefile | 
|---|
| 235 | !endif | 
|---|
| 236 |  | 
|---|
| 237 | # Default makefile name. | 
|---|
| 238 | !ifndef MAKEFILE | 
|---|
| 239 | MAKEFILE = $(BUILD_MAKEFILE) | 
|---|
| 240 | !endif | 
|---|
| 241 |  | 
|---|
| 242 | # Ignore linker warnings for some target modes. | 
|---|
| 243 | !ifndef TARGET_IGNORE_LINKER_WARNINGS | 
|---|
| 244 | ! if "$(TARGET_MODE)" == "DLL" | 
|---|
| 245 | TARGET_IGNORE_LINKER_WARNINGS = 1 | 
|---|
| 246 | ! endif | 
|---|
| 247 | !endif | 
|---|
| 248 |  | 
|---|
| 249 |  | 
|---|
| 250 | # Default stacksize | 
|---|
| 251 | # If 16bit:      8KB | 
|---|
| 252 | # Else (32bit): 64KB | 
|---|
| 253 | !ifndef TARGET_STACKSIZE | 
|---|
| 254 | ! ifdef ENV_16BIT | 
|---|
| 255 | TARGET_STACKSIZE=0x2000 | 
|---|
| 256 | ! else | 
|---|
| 257 | TARGET_STACKSIZE=0x10000 | 
|---|
| 258 | ! endif | 
|---|
| 259 | !endif | 
|---|
| 260 |  | 
|---|
| 261 |  | 
|---|
| 262 |  | 
|---|
| 263 | # ----------------------------------------------------------------------------- | 
|---|
| 264 | # Tell user what we're building. | 
|---|
| 265 | # ----------------------------------------------------------------------------- | 
|---|
| 266 | !ifndef BUILD_QUIET | 
|---|
| 267 | ! if "$(TARGET)" != "" | 
|---|
| 268 | !  ifndef MAKEVER | 
|---|
| 269 | !   if [$(ECHO) Target is $(CLRFIL)$(TARGET)$(CLRRST)] | 
|---|
| 270 | !   endif | 
|---|
| 271 | !  else | 
|---|
| 272 | $(ECHO) Target is $(CLRFIL)$(TARGET)$(CLRRST) | 
|---|
| 273 | !  endif | 
|---|
| 274 | ! endif | 
|---|
| 275 | !endif | 
|---|
| 276 |  | 
|---|
| 277 |  | 
|---|
| 278 | # ----------------------------------------------------------------------------- | 
|---|
| 279 | # Ensure the platform-specific target path exists | 
|---|
| 280 | # ----------------------------------------------------------------------------- | 
|---|
| 281 |  | 
|---|
| 282 | !if "$(TARGET_MODE)" != "EMPTY" | 
|---|
| 283 | ! if "$(PATH_TARGET)" != "" | 
|---|
| 284 | !  ifndef MAKEVER | 
|---|
| 285 | !   if [$(TOOL_EXISTS) $(PATH_TARGET)] != 0 | 
|---|
| 286 | !    ifndef BUILD_QUIET | 
|---|
| 287 | !     if [$(ECHO) Target path $(CLRFIL)$(PATH_TARGET)$(CLRTXT) does NOT exist. Creating. $(CLRRST)] | 
|---|
| 288 | !     endif | 
|---|
| 289 | !    endif | 
|---|
| 290 | !    if [$(TOOL_CREATEPATH) $(PATH_TARGET)] | 
|---|
| 291 | !     if [$(ECHO) $(CLRERR)Error: Could not create $(CLRFIL)$(PATH_TARGET)$(CLRRST)] | 
|---|
| 292 | !     endif | 
|---|
| 293 | !     error | 
|---|
| 294 | !    endif | 
|---|
| 295 | !   endif | 
|---|
| 296 | !  else | 
|---|
| 297 | !   if %exist($(PATH_TARGET)) == 0 | 
|---|
| 298 | !    ifndef BUILD_QUIET | 
|---|
| 299 | $(ECHO) Target path $(CLRFIL)$(PATH_TARGET)$(CLRTXT) does NOT exist. Creating. $(CLRRST) | 
|---|
| 300 | !    endif | 
|---|
| 301 | !   else | 
|---|
| 302 | !    if [$(TOOL_CREATEPATH) $(PATH_TARGET)] | 
|---|
| 303 | !     error $(CLRERR)Error: Could not create $(CLRFIL)$(PATH_TARGET)$(CLRRST) | 
|---|
| 304 | !    endif | 
|---|
| 305 | !   endif | 
|---|
| 306 | !  endif | 
|---|
| 307 | ! endif | 
|---|
| 308 | !endif | 
|---|
| 309 | # not 100% sure about the != EMPTY stuff, but this is way faster. | 
|---|
| 310 |  | 
|---|
| 311 |  | 
|---|
| 312 |  | 
|---|
| 313 | # ----------------------------------------------------------------------------- | 
|---|
| 314 | # Common inference rules | 
|---|
| 315 | # ----------------------------------------------------------------------------- | 
|---|
| 316 | .SUFFIXES: | 
|---|
| 317 | .SUFFIXES: .c .cpp .asm .$(EXT_OBJ) .$(EXT_RES) .rc .ii .s | 
|---|
| 318 |  | 
|---|
| 319 | # | 
|---|
| 320 | # A workaround for SlickEdits inability to find the buggy files.. | 
|---|
| 321 | # This makes the source filenames in the error listing have full path. | 
|---|
| 322 | # See setup.mak for compile command line. | 
|---|
| 323 | # | 
|---|
| 324 | _SRC = $< | 
|---|
| 325 | !ifdef SLKRUNS | 
|---|
| 326 | _SRC = $(PATH_CURRENT)\$< | 
|---|
| 327 | !endif | 
|---|
| 328 |  | 
|---|
| 329 |  | 
|---|
| 330 | # Assembling assembly source. | 
|---|
| 331 | .asm{$(PATH_TARGET)}.$(EXT_OBJ): | 
|---|
| 332 | @$(ECHO) Assembling $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST) | 
|---|
| 333 | \ | 
|---|
| 334 | ! ifndef BUILD_VERBOSE | 
|---|
| 335 | @ \ | 
|---|
| 336 | ! endif | 
|---|
| 337 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB" | 
|---|
| 338 | $(TOOL_JOB_SUB) $(AS) $(AS_FLAGS_SYS) $(_SRC) $(AS_OBJ_OUT)$@ | 
|---|
| 339 | !else | 
|---|
| 340 | $(TOOL_JOB_SUB) $(AS) $(AS_FLAGS) $(_SRC) $(AS_OBJ_OUT)$@ | 
|---|
| 341 | !endif | 
|---|
| 342 |  | 
|---|
| 343 | .asm.$(EXT_OBJ): | 
|---|
| 344 | @$(ECHO) Assembling $(CLRFIL)$(_SRC) $(CLRRST) | 
|---|
| 345 | \ | 
|---|
| 346 | !ifndef BUILD_VERBOSE | 
|---|
| 347 | @ \ | 
|---|
| 348 | !endif | 
|---|
| 349 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB" | 
|---|
| 350 | $(AS) $(AS_FLAGS_SYS) $(_SRC) $(AS_OBJ_OUT)$(PATH_TARGET)\$(@F) | 
|---|
| 351 | !else | 
|---|
| 352 | $(AS) $(AS_FLAGS) $(_SRC) $(AS_OBJ_OUT)$(PATH_TARGET)\$(@F) | 
|---|
| 353 | !endif | 
|---|
| 354 |  | 
|---|
| 355 | # C++ Compiler base line | 
|---|
| 356 | _CXX_BASELINE = $(CXX) \ | 
|---|
| 357 | !if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB" | 
|---|
| 358 | $(CXX_FLAGS_EXE) \ | 
|---|
| 359 | !endif | 
|---|
| 360 | !if "$(TARGET_MODE)" == "DLL" | 
|---|
| 361 | $(CXX_FLAGS_DLL) \ | 
|---|
| 362 | !endif | 
|---|
| 363 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" | 
|---|
| 364 | $(CXX_FLAGS_SYS) \ | 
|---|
| 365 | !endif | 
|---|
| 366 | !if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB" | 
|---|
| 367 | $(CXX_FLAGS_IFS) \ | 
|---|
| 368 | !endif | 
|---|
| 369 |  | 
|---|
| 370 | # Compiling C++ source. | 
|---|
| 371 | .cpp{$(PATH_TARGET)}.$(EXT_OBJ): | 
|---|
| 372 | @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST) | 
|---|
| 373 | \ | 
|---|
| 374 | !ifndef BUILD_VERBOSE | 
|---|
| 375 | @ \ | 
|---|
| 376 | !endif | 
|---|
| 377 | $(TOOL_JOB_SUB) $(_CXX_BASELINE) \ | 
|---|
| 378 | !if "$(CXX_LST_OUT)" != "" | 
|---|
| 379 | $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \ | 
|---|
| 380 | !endif | 
|---|
| 381 | $(CXX_OBJ_OUT)$@ $(_SRC) | 
|---|
| 382 |  | 
|---|
| 383 | .cpp.$(EXT_OBJ): | 
|---|
| 384 | @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRRST) | 
|---|
| 385 | \ | 
|---|
| 386 | !ifndef BUILD_VERBOSE | 
|---|
| 387 | @ \ | 
|---|
| 388 | !endif | 
|---|
| 389 | $(_CXX_BASELINE) \ | 
|---|
| 390 | !if "$(CXX_LST_OUT)" != "" | 
|---|
| 391 | $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \ | 
|---|
| 392 | !endif | 
|---|
| 393 | $(CXX_OBJ_OUT)$(PATH_TARGET)\$(@F) $(_SRC) | 
|---|
| 394 |  | 
|---|
| 395 |  | 
|---|
| 396 | # Pre-Compiling C++ source. | 
|---|
| 397 | .cpp.ii: | 
|---|
| 398 | @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRRST) | 
|---|
| 399 | \ | 
|---|
| 400 | !ifndef BUILD_VERBOSE | 
|---|
| 401 | @ \ | 
|---|
| 402 | !endif | 
|---|
| 403 | $(_CXX_BASELINE) \ | 
|---|
| 404 | $(CXX_PC_2_STDOUT) $(_SRC) > $@ | 
|---|
| 405 |  | 
|---|
| 406 |  | 
|---|
| 407 | # Compiler C++ source to assembly. | 
|---|
| 408 | !if "$(CXX_AS_2_FILE)" != "" | 
|---|
| 409 | .cpp.s: | 
|---|
| 410 | @$(ECHO) C++ To Assembly $(CLRFIL)$(_SRC) $(CLRRST) | 
|---|
| 411 | \ | 
|---|
| 412 | !ifndef BUILD_VERBOSE | 
|---|
| 413 | @ \ | 
|---|
| 414 | !endif | 
|---|
| 415 | $(_CXX_BASELINE) \ | 
|---|
| 416 | $(CXX_AS_2_FILE)$@ $(_SRC) | 
|---|
| 417 | !endif | 
|---|
| 418 |  | 
|---|
| 419 |  | 
|---|
| 420 |  | 
|---|
| 421 | # C Compiler base line | 
|---|
| 422 | _CC_BASELINE = $(CC) \ | 
|---|
| 423 | !if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB" | 
|---|
| 424 | $(CC_FLAGS_EXE) \ | 
|---|
| 425 | !endif | 
|---|
| 426 | !if "$(TARGET_MODE)" == "DLL" | 
|---|
| 427 | $(CC_FLAGS_DLL) \ | 
|---|
| 428 | !endif | 
|---|
| 429 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" | 
|---|
| 430 | $(CC_FLAGS_SYS) \ | 
|---|
| 431 | !endif | 
|---|
| 432 | !if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB" | 
|---|
| 433 | $(CC_FLAGS_IFS) \ | 
|---|
| 434 | !endif | 
|---|
| 435 |  | 
|---|
| 436 | # Compiling C source. | 
|---|
| 437 | .c{$(PATH_TARGET)}.$(EXT_OBJ): | 
|---|
| 438 | @$(ECHO) C Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST) | 
|---|
| 439 | \ | 
|---|
| 440 | !ifndef BUILD_VERBOSE | 
|---|
| 441 | @ \ | 
|---|
| 442 | !endif | 
|---|
| 443 | $(TOOL_JOB_SUB) $(_CC_BASELINE) \ | 
|---|
| 444 | !if "$(CC_LST_OUT)" != "" | 
|---|
| 445 | $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \ | 
|---|
| 446 | !endif | 
|---|
| 447 | $(CC_OBJ_OUT)$@ $(_SRC) | 
|---|
| 448 |  | 
|---|
| 449 | .c.$(EXT_OBJ): | 
|---|
| 450 | @$(ECHO) C Compiler $(CLRFIL)$(_SRC) $(CLRRST) | 
|---|
| 451 | \ | 
|---|
| 452 | !ifndef BUILD_VERBOSE | 
|---|
| 453 | @ \ | 
|---|
| 454 | !endif | 
|---|
| 455 | $(_CC_BASELINE) \ | 
|---|
| 456 | !if "$(CC_LST_OUT)" != "" | 
|---|
| 457 | $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \ | 
|---|
| 458 | !endif | 
|---|
| 459 | $(CC_OBJ_OUT)$(PATH_TARGET)\$(@F) $(_SRC) | 
|---|
| 460 |  | 
|---|
| 461 |  | 
|---|
| 462 | # Pre-Compiling C source. | 
|---|
| 463 | .c.ii: | 
|---|
| 464 | @$(ECHO) C PreCompiler $(CLRFIL)$(_SRC) $(CLRRST) | 
|---|
| 465 | \ | 
|---|
| 466 | !ifndef BUILD_VERBOSE | 
|---|
| 467 | @ \ | 
|---|
| 468 | !endif | 
|---|
| 469 | $(_CC_BASELINE) \ | 
|---|
| 470 | $(CC_PC_2_STDOUT) $(_SRC) > $@ | 
|---|
| 471 |  | 
|---|
| 472 |  | 
|---|
| 473 | # Compiler C source to assembly. | 
|---|
| 474 | !if "$(CC_AS_2_FILE)" != "" | 
|---|
| 475 | .c.s: | 
|---|
| 476 | @$(ECHO) C To Assembly $(CLRFIL)$(_SRC) $(CLRRST) | 
|---|
| 477 | \ | 
|---|
| 478 | !ifndef BUILD_VERBOSE | 
|---|
| 479 | @ \ | 
|---|
| 480 | !endif | 
|---|
| 481 | $(_CC_BASELINE) \ | 
|---|
| 482 | $(CC_AS_2_FILE)$@ $(_SRC) | 
|---|
| 483 | !endif | 
|---|
| 484 |  | 
|---|
| 485 |  | 
|---|
| 486 | # Compiling resources. | 
|---|
| 487 | .rc{$(PATH_TARGET)}.res: | 
|---|
| 488 | @$(ECHO) RC Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG)$(CLRRST) | 
|---|
| 489 | \ | 
|---|
| 490 | !ifndef BUILD_VERBOSE | 
|---|
| 491 | @ \ | 
|---|
| 492 | !endif | 
|---|
| 493 | $(TOOL_JOB_SUB) $(RC) $(RC_FLAGS) $(_SRC) $@ | 
|---|
| 494 |  | 
|---|
| 495 | .rc.res: | 
|---|
| 496 | @$(ECHO) RC Compiler $(CLRFIL)$(_SRC) $(CLRRST) | 
|---|
| 497 | \ | 
|---|
| 498 | !ifndef BUILD_VERBOSE | 
|---|
| 499 | @ \ | 
|---|
| 500 | !endif | 
|---|
| 501 | $(RC) $(RC_FLAGS) $(_SRC) $(PATH_TARGET)\$(@F) | 
|---|
| 502 |  | 
|---|
| 503 |  | 
|---|
| 504 |  | 
|---|
| 505 |  | 
|---|
| 506 |  | 
|---|
| 507 | # ----------------------------------------------------------------------------- | 
|---|
| 508 | # The all rule - The default one, as it's the first rule in the file. | 
|---|
| 509 | # ----------------------------------------------------------------------------- | 
|---|
| 510 | all: build | 
|---|
| 511 |  | 
|---|
| 512 |  | 
|---|
| 513 |  | 
|---|
| 514 | # ----------------------------------------------------------------------------- | 
|---|
| 515 | # The build rule - This runs all passes: | 
|---|
| 516 | #   1. Make Dependencies | 
|---|
| 517 | #   2. Make Libraries (all kinds) | 
|---|
| 518 | #   3. Make Executables | 
|---|
| 519 | #   4. Make Miscellaneous Targets | 
|---|
| 520 | #   5. Make Install | 
|---|
| 521 | # Note: In order to load dependencies we'll do a forwarding after making them. | 
|---|
| 522 | # ----------------------------------------------------------------------------- | 
|---|
| 523 | build: _build | 
|---|
| 524 | !if "$(MAKEFLAGS:I=_)" == "$(MAKEFLAGS)" # this is of course broken in nmake v5.0 for OS/2. | 
|---|
| 525 | @$(ECHO)$(CLRMAK)[Successfully Built Everything!] $(CLRRST) | 
|---|
| 526 | !else | 
|---|
| 527 | @$(ECHO)$(CLRMAK)[Built Everything! (Ignore option specified)] $(CLRRST) | 
|---|
| 528 | !endif | 
|---|
| 529 |  | 
|---|
| 530 | # internal rule shared by rebuild and build. | 
|---|
| 531 | _build:  _build_banner_dep dep | 
|---|
| 532 | !ifndef BUILD_QUIET | 
|---|
| 533 | @$(ECHO) Restarting $(CLRFIL)$(MAKEFILE)$(CLRTXT) with new dependencies. $(CLRRST) | 
|---|
| 534 | !endif | 
|---|
| 535 | \ | 
|---|
| 536 | !ifndef BUILD_VERBOSE | 
|---|
| 537 | @ \ | 
|---|
| 538 | !endif | 
|---|
| 539 | $(TOOL_MAKE) -f $(MAKEFILE) _build_new_dependencies_ | 
|---|
| 540 |  | 
|---|
| 541 | # internal rule used to reload dependencies. | 
|---|
| 542 | _build_new_dependencies_: \ | 
|---|
| 543 | _build_banner_lib           lib \ | 
|---|
| 544 | _build_banner_executable    executable \ | 
|---|
| 545 | _build_banner_miscellaneous miscellaneous \ | 
|---|
| 546 | _build_banner_install       install | 
|---|
| 547 |  | 
|---|
| 548 | # Banners for rebuild and build. | 
|---|
| 549 | _build_banner_clean: | 
|---|
| 550 | @$(ECHO)$(CLRMAK)[Start Pass 0 - Make Clean] $(CLRRST) | 
|---|
| 551 | @SET _BUILD_PASS=0 | 
|---|
| 552 | _build_banner_dep: | 
|---|
| 553 | @$(ECHO)$(CLRMAK)[Start Pass 1 - Make Dependencies] $(CLRRST) | 
|---|
| 554 | @SET _BUILD_PASS=1 | 
|---|
| 555 | _build_banner_lib: | 
|---|
| 556 | @$(ECHO)$(CLRMAK)[Start Pass 2 - Make Libraries] $(CLRRST) | 
|---|
| 557 | @SET _BUILD_PASS=2 | 
|---|
| 558 | _build_banner_executable: | 
|---|
| 559 | @$(ECHO)$(CLRMAK)[Start Pass 3 - Make Executables] $(CLRRST) | 
|---|
| 560 | @SET _BUILD_PASS=3 | 
|---|
| 561 | _build_banner_miscellaneous: | 
|---|
| 562 | @$(ECHO)$(CLRMAK)[Start Pass 4 - Make Miscellaneous Targets] $(CLRRST) | 
|---|
| 563 | @SET _BUILD_PASS=4 | 
|---|
| 564 | _build_banner_install: | 
|---|
| 565 | @$(ECHO)$(CLRMAK)[Start Pass 5 - Make Install] $(CLRRST) | 
|---|
| 566 | @SET _BUILD_PASS=5 | 
|---|
| 567 |  | 
|---|
| 568 |  | 
|---|
| 569 |  | 
|---|
| 570 | # ----------------------------------------------------------------------------- | 
|---|
| 571 | # The rebuild rule - Same as build but does a clean first (as Pass 0). | 
|---|
| 572 | # ----------------------------------------------------------------------------- | 
|---|
| 573 | rebuild: \ | 
|---|
| 574 | _build_banner_clean clean \ | 
|---|
| 575 | _build | 
|---|
| 576 | !if "$(MAKEFLAGS:i=_)" == "$(MAKEFLAGS)" | 
|---|
| 577 | @$(ECHO)$(CLRMAK)[Successfully Rebuilt Everything!] $(CLRRST) | 
|---|
| 578 | !else | 
|---|
| 579 | @$(ECHO)$(CLRMAK)[Rebuilt Everything! (Ignore option specified)] $(CLRRST) | 
|---|
| 580 | !endif | 
|---|
| 581 |  | 
|---|
| 582 |  | 
|---|
| 583 |  | 
|---|
| 584 | # ----------------------------------------------------------------------------- | 
|---|
| 585 | # Pass 0 - The clean rule - Clean up output files. | 
|---|
| 586 | #   The current setup doesn't clean the installed ones. | 
|---|
| 587 | # ----------------------------------------------------------------------------- | 
|---|
| 588 | !if "$(TARGET_MODE)" != "TESTCASE" | 
|---|
| 589 | clean: | 
|---|
| 590 | @$(ECHO) Cleaning... $(CLRRST) | 
|---|
| 591 | !if "$(PATH_TARGET)" != ""              # paranoia | 
|---|
| 592 | \ | 
|---|
| 593 | ! ifndef BUILD_VERBOSE | 
|---|
| 594 | @ \ | 
|---|
| 595 | ! endif | 
|---|
| 596 | $(TOOL_RM) \ | 
|---|
| 597 | "$(PATH_TARGET)\*.$(EXT_OBJ)" \ | 
|---|
| 598 | "$(PATH_TARGET)\*.$(EXT_ILIB)" \ | 
|---|
| 599 | "$(PATH_TARGET)\*.$(EXT_EXE)" \ | 
|---|
| 600 | "$(PATH_TARGET)\*.$(EXT_DLL)" \ | 
|---|
| 601 | "$(PATH_TARGET)\*.$(EXT_RES)" | 
|---|
| 602 | \ | 
|---|
| 603 | ! ifndef BUILD_VERBOSE | 
|---|
| 604 | @ \ | 
|---|
| 605 | ! endif | 
|---|
| 606 | $(TOOL_RM) \ | 
|---|
| 607 | "$(PATH_TARGET)\*.$(EXT_SYS)" \ | 
|---|
| 608 | "$(PATH_TARGET)\*.$(EXT_LIB)" \ | 
|---|
| 609 | "$(PATH_TARGET)\*.$(EXT_IFS)" \ | 
|---|
| 610 | "$(PATH_TARGET)\*.$(EXT_MAP)" \ | 
|---|
| 611 | "$(PATH_TARGET)\*.$(EXT_SYM)" | 
|---|
| 612 | \ | 
|---|
| 613 | ! ifndef BUILD_VERBOSE | 
|---|
| 614 | @ \ | 
|---|
| 615 | ! endif | 
|---|
| 616 | $(TOOL_RM) \ | 
|---|
| 617 | "$(PATH_TARGET)\*.s" \ | 
|---|
| 618 | "$(PATH_TARGET)\*.lst" \ | 
|---|
| 619 | "$(PATH_TARGET)\*.lnk" \ | 
|---|
| 620 | "$(PATH_TARGET)\*.ii" \ | 
|---|
| 621 | "$(PATH_TARGET)\.depend" | 
|---|
| 622 | \ | 
|---|
| 623 | ! ifndef BUILD_VERBOSE | 
|---|
| 624 | @ \ | 
|---|
| 625 | ! endif | 
|---|
| 626 | $(TOOL_RM) \ | 
|---|
| 627 | ".\*.ii" \ | 
|---|
| 628 | ".\*.err" \ | 
|---|
| 629 | ".\.depend" | 
|---|
| 630 | !endif | 
|---|
| 631 | !ifdef SUBDIRS | 
|---|
| 632 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@ | 
|---|
| 633 | !endif | 
|---|
| 634 | !ifdef PREMAKEFILES | 
|---|
| 635 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@ | 
|---|
| 636 | !endif | 
|---|
| 637 | !ifdef POSTMAKEFILES | 
|---|
| 638 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@ | 
|---|
| 639 | !endif | 
|---|
| 640 | !endif #!TESTCASE | 
|---|
| 641 |  | 
|---|
| 642 |  | 
|---|
| 643 |  | 
|---|
| 644 | # ----------------------------------------------------------------------------- | 
|---|
| 645 | # Pass 1 - The dep rule - Make dependencies. | 
|---|
| 646 | # ----------------------------------------------------------------------------- | 
|---|
| 647 | dep: | 
|---|
| 648 | !if "$(TARGET_MODE)" != "EMPTY" && "$(TARGET_MODE)" != "TESTCASE" | 
|---|
| 649 | @$(ECHO) Making dependencies... $(CLRRST) | 
|---|
| 650 | \ | 
|---|
| 651 | ! ifndef BUILD_VERBOSE | 
|---|
| 652 | @ \ | 
|---|
| 653 | ! endif | 
|---|
| 654 | $(TOOL_DEP) $(TOOL_DEP_FLAGS) -o$$(PATH_TARGET) -d$(TARGET_DEPEND)\ | 
|---|
| 655 | ! ifdef TARGET_NO_DEP | 
|---|
| 656 | -x$(TARGET_NO_DEP: =;)\ | 
|---|
| 657 | ! endif | 
|---|
| 658 | $(TOOL_DEP_FILES) | 
|---|
| 659 | !endif | 
|---|
| 660 | !ifdef SUBDIRS | 
|---|
| 661 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@ | 
|---|
| 662 | !endif | 
|---|
| 663 | !ifdef PREMAKEFILES | 
|---|
| 664 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@ | 
|---|
| 665 | !endif | 
|---|
| 666 | !ifdef POSTMAKEFILES | 
|---|
| 667 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@ | 
|---|
| 668 | !endif | 
|---|
| 669 |  | 
|---|
| 670 |  | 
|---|
| 671 |  | 
|---|
| 672 | # ----------------------------------------------------------------------------- | 
|---|
| 673 | # Pass 2 - The lib rule - Make libraries. | 
|---|
| 674 | # ----------------------------------------------------------------------------- | 
|---|
| 675 | !ifdef SUBDIRS | 
|---|
| 676 | SUBDIRS_LIB = _subdir_lib | 
|---|
| 677 | $(SUBDIRS_LIB): | 
|---|
| 678 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) lib | 
|---|
| 679 | !endif | 
|---|
| 680 |  | 
|---|
| 681 | !ifdef PREMAKEFILES | 
|---|
| 682 | PREMAKEFILES_LIB = _premakefiles_lib | 
|---|
| 683 | $(PREMAKEFILES_LIB): | 
|---|
| 684 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) lib | 
|---|
| 685 | !endif | 
|---|
| 686 |  | 
|---|
| 687 | lib:    $(SUBDIRS_LIB) $(PREMAKEFILES_LIB) \ | 
|---|
| 688 | !if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB" | 
|---|
| 689 | $(TARGET) $(TARGET_PUBNAME) \ | 
|---|
| 690 | !endif | 
|---|
| 691 | $(TARGET_ILIB) | 
|---|
| 692 | !ifdef POSTMAKEFILES | 
|---|
| 693 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@ | 
|---|
| 694 | !endif | 
|---|
| 695 |  | 
|---|
| 696 |  | 
|---|
| 697 |  | 
|---|
| 698 | # ----------------------------------------------------------------------------- | 
|---|
| 699 | # Pass 3 - The executable rule - Build the executables. | 
|---|
| 700 | # ----------------------------------------------------------------------------- | 
|---|
| 701 | !ifdef SUBDIRS | 
|---|
| 702 | SUBDIRS_EXECUTABLE = _subdir_executable | 
|---|
| 703 | $(SUBDIRS_EXECUTABLE): | 
|---|
| 704 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) executable | 
|---|
| 705 | !endif | 
|---|
| 706 |  | 
|---|
| 707 | !ifdef PREMAKEFILES | 
|---|
| 708 | PREMAKEFILES_EXECUTABLE = _premakefiles_executable | 
|---|
| 709 | $(PREMAKEFILES_EXECUTABLE): | 
|---|
| 710 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) executable | 
|---|
| 711 | !endif | 
|---|
| 712 |  | 
|---|
| 713 | executable: \ | 
|---|
| 714 | !if "$(TARGET_MODE)" != "LIB" && "$(TARGET_MODE)" != "SYSLIB" && "$(TARGET_MODE)" != "IFSLIB" | 
|---|
| 715 | $(SUBDIRS_EXECUTABLE) $(PREMAKEFILES_EXECUTABLE) $(TARGET) $(TARGET_PUBNAME) | 
|---|
| 716 | ! if "$(TARGET)" != "" | 
|---|
| 717 | @$(ECHO) Successfully Built $(CLRFIL)$(TARGET)$(CLRRST) | 
|---|
| 718 | ! endif | 
|---|
| 719 | !else | 
|---|
| 720 | $(SUBDIRS_EXECUTABLE) $(PREMAKEFILES_EXECUTABLE) | 
|---|
| 721 | !endif | 
|---|
| 722 | !ifdef POSTMAKEFILES | 
|---|
| 723 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@ | 
|---|
| 724 | !endif | 
|---|
| 725 |  | 
|---|
| 726 |  | 
|---|
| 727 |  | 
|---|
| 728 | # ----------------------------------------------------------------------------- | 
|---|
| 729 | # Pass 4 - The miscellaneous rule - Makes other miscellaneous stuff like | 
|---|
| 730 | #   documentations etc. This is experimental for the moment. | 
|---|
| 731 | # ----------------------------------------------------------------------------- | 
|---|
| 732 | !ifdef SUBDIRS | 
|---|
| 733 | SUBDIRS_MISC = _subdir_misc | 
|---|
| 734 | $(SUBDIRS_MISC): | 
|---|
| 735 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) miscellaneous | 
|---|
| 736 | !endif | 
|---|
| 737 |  | 
|---|
| 738 | !ifdef PREMAKEFILES | 
|---|
| 739 | PREMAKEFILES_MISC = _premakefiles_misc | 
|---|
| 740 | $(PREMAKEFILES_MISC): | 
|---|
| 741 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) miscellaneous | 
|---|
| 742 | !endif | 
|---|
| 743 |  | 
|---|
| 744 | miscellaneous:  $(SUBDIRS_MISC) $(PREMAKEFILES_MISC) \ | 
|---|
| 745 | $(TARGET_DOCS) $(TARGET_MISC) | 
|---|
| 746 | !if "$(TARGET_DOCS)$(TARGET_MISC)" != "" | 
|---|
| 747 | @$(ECHO) Successfully Built $(CLRFIL)$(TARGET_DOCS) $(TARGET_MISC)$(CLRRST) | 
|---|
| 748 | !else | 
|---|
| 749 | !endif | 
|---|
| 750 | !ifdef POSTMAKEFILES | 
|---|
| 751 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@ | 
|---|
| 752 | !endif | 
|---|
| 753 |  | 
|---|
| 754 |  | 
|---|
| 755 |  | 
|---|
| 756 | # ----------------------------------------------------------------------------- | 
|---|
| 757 | # Pass 5 - The install rule - Copies target to main binary directory. | 
|---|
| 758 | #   Installation order is not concidered vital, so subdirectories and | 
|---|
| 759 | #   pre-makefiles are processed after this directory. This might be changed. | 
|---|
| 760 | # ----------------------------------------------------------------------------- | 
|---|
| 761 | install: | 
|---|
| 762 | !if "$(TARGET_PUBLIC)" == "" | 
|---|
| 763 | ! if "$(TARGET_MODE)" == "EXE" | 
|---|
| 764 | @$(ECHO) Installing $(CLRFIL)$(TARGET)$(CLRTXT) in directory $(CLRFIL)$(PATH_BIN)$(CLRRST) | 
|---|
| 765 | @if not exist $(TARGET) $(ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST) | 
|---|
| 766 | @if not exist $(PATH_BIN) $(TOOL_CREATEPATH)       $(PATH_BIN) | 
|---|
| 767 | @if exist $(TARGET)     $(TOOL_COPY) $(TARGET)     $(PATH_BIN) | 
|---|
| 768 | @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(PATH_BIN) | 
|---|
| 769 | ! endif | 
|---|
| 770 | ! if "$(TARGET_MODE)" == "DLL" | 
|---|
| 771 | @$(ECHO) Installing $(CLRFIL)$(TARGET)$(CLRTXT) in directory $(CLRFIL)$(PATH_DLL)$(CLRRST) | 
|---|
| 772 | @if not exist $(TARGET) $(ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST) | 
|---|
| 773 | @if not exist $(PATH_DLL) $(TOOL_CREATEPATH)       $(PATH_DLL) | 
|---|
| 774 | @if exist $(TARGET)     $(TOOL_COPY) $(TARGET)     $(PATH_DLL) | 
|---|
| 775 | @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(PATH_DLL) | 
|---|
| 776 | ! endif | 
|---|
| 777 | ! if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS" | 
|---|
| 778 | @$(ECHO) Installing $(CLRFIL)$(TARGET)$(CLRTXT) in directory $(CLRFIL)$(PATH_SYS)$(CLRRST) | 
|---|
| 779 | @if not exist $(TARGET) $(ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST) | 
|---|
| 780 | @if not exist $(PATH_SYS) $(TOOL_CREATEPATH)       $(PATH_SYS) | 
|---|
| 781 | @if exist $(TARGET)     $(TOOL_COPY) $(TARGET)     $(PATH_SYS) | 
|---|
| 782 | @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(PATH_SYS) | 
|---|
| 783 | ! endif | 
|---|
| 784 | !if 0 # these targets are either TARGET_PUBLIC or all private. | 
|---|
| 785 | !  if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB" | 
|---|
| 786 | @$(ECHO) Installing $(CLRFIL)$(TARGET)$(CLRTXT) in directory $(CLRFIL)$(PATH_LIB)$(CLRRST) | 
|---|
| 787 | @if not exist $(TARGET) $(ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST) | 
|---|
| 788 | @if not exist $(PATH_LIB) $(TOOL_CREATEPATH)       $(PATH_LIB) | 
|---|
| 789 | @if exist $(TARGET)     $(TOOL_COPY) $(TARGET)     $(PATH_LIB) | 
|---|
| 790 | @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(PATH_LIB) | 
|---|
| 791 | !  endif | 
|---|
| 792 | ! endif | 
|---|
| 793 | !endif | 
|---|
| 794 | !if "$(TARGET_DOCS)" != "" | 
|---|
| 795 | $(TOOL_COPY) $(TARGET_DOCS) $(PATH_DOC) | 
|---|
| 796 | !endif | 
|---|
| 797 | !ifdef SUBDIRS | 
|---|
| 798 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@ | 
|---|
| 799 | !endif | 
|---|
| 800 | !ifdef PREMAKEFILES | 
|---|
| 801 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@ | 
|---|
| 802 | !endif | 
|---|
| 803 | !ifdef POSTMAKEFILES | 
|---|
| 804 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@ | 
|---|
| 805 | !endif | 
|---|
| 806 |  | 
|---|
| 807 |  | 
|---|
| 808 |  | 
|---|
| 809 | # ----------------------------------------------------------------------------- | 
|---|
| 810 | # Pass x - The testcase rule - Execute testcases when present. | 
|---|
| 811 | #   Testcases are either a testcase.mak file or a testcase subdirectory. | 
|---|
| 812 | # ----------------------------------------------------------------------------- | 
|---|
| 813 | !if "$(TARGET_MODE)" != "TESTCASE" | 
|---|
| 814 | !ifndef BUILD_OWN_TESTCASE_RULE | 
|---|
| 815 | !ifndef MAKEVER | 
|---|
| 816 | _TESTCASE_TST1 = [$(TOOL_EXISTS) testcase] == 0 | 
|---|
| 817 | _TESTCASE_TST2 = [$(TOOL_EXISTS) testcase.mak] == 0 | 
|---|
| 818 | !else | 
|---|
| 819 | _TESTCASE_TST1 = exists(testcase) != 0 | 
|---|
| 820 | _TESTCASE_TST2 = exists(testcase.mak) != 0 | 
|---|
| 821 | !endif | 
|---|
| 822 |  | 
|---|
| 823 | testcase: | 
|---|
| 824 | @$(ECHO) Executing testcases $(CLRRST) | 
|---|
| 825 | !if $(_TESTCASE_TST1) | 
|---|
| 826 | @$(TOOL_DODIRS) "testcase" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@ | 
|---|
| 827 | !endif | 
|---|
| 828 | !if $(_TESTCASE_TST2) | 
|---|
| 829 | @$(TOOL_DOMAKES) "testcase.mak" $(TOOL_MAKE) $@ | 
|---|
| 830 | !endif | 
|---|
| 831 | !ifdef SUBDIRS | 
|---|
| 832 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@ | 
|---|
| 833 | !endif | 
|---|
| 834 | !ifdef PREMAKEFILES | 
|---|
| 835 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@ | 
|---|
| 836 | !endif | 
|---|
| 837 | !ifdef POSTMAKEFILES | 
|---|
| 838 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@ | 
|---|
| 839 | !endif | 
|---|
| 840 | !endif | 
|---|
| 841 | !endif #!TESTCASE | 
|---|
| 842 |  | 
|---|
| 843 |  | 
|---|
| 844 |  | 
|---|
| 845 | # ----------------------------------------------------------------------------- | 
|---|
| 846 | # The target rule - Build the target. | 
|---|
| 847 | #   Note: This also builds libraries in subdirectories and submakefiles. | 
|---|
| 848 | # ----------------------------------------------------------------------------- | 
|---|
| 849 | !ifdef SUBDIRS | 
|---|
| 850 | SUBDIRS_TARGET = _subdir_target | 
|---|
| 851 | $(SUBDIRS_TARGET): | 
|---|
| 852 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) target | 
|---|
| 853 | !endif | 
|---|
| 854 |  | 
|---|
| 855 | !ifdef PREMAKEFILES | 
|---|
| 856 | PREMAKEFILES_TARGET = _premakefiles_target | 
|---|
| 857 | $(PREMAKEFILES_TARGET): | 
|---|
| 858 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) target | 
|---|
| 859 | !endif | 
|---|
| 860 |  | 
|---|
| 861 | target: $(SUBDIRS_TARGET) $(PREMAKEFILES_TARGET) $(TARGET) $(TARGET_ILIB) $(TARGET_PUBNAME) | 
|---|
| 862 | @$(ECHO) Successfully Built $(CLRFIL)$(TARGET) $(TARGET_ILIB)$(CLRRST) | 
|---|
| 863 | !ifdef POSTMAKEFILES | 
|---|
| 864 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@ | 
|---|
| 865 | !endif | 
|---|
| 866 |  | 
|---|
| 867 |  | 
|---|
| 868 |  | 
|---|
| 869 | # ----------------------------------------------------------------------------- | 
|---|
| 870 | # The shell rule - Setup the correcte shell environment and start a shell. | 
|---|
| 871 | # ----------------------------------------------------------------------------- | 
|---|
| 872 | shell: | 
|---|
| 873 | @$(ECHO) Creating work shell $(CLRRST) | 
|---|
| 874 | \ | 
|---|
| 875 | !ifndef BUILD_VERBOSE | 
|---|
| 876 | @ \ | 
|---|
| 877 | !endif | 
|---|
| 878 | -$(TOOL_BUILDENV) $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(ENV_ENVS) \ | 
|---|
| 879 | $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST) * $(COMSPEC) | 
|---|
| 880 |  | 
|---|
| 881 |  | 
|---|
| 882 |  | 
|---|
| 883 | # ----------------------------------------------------------------------------- | 
|---|
| 884 | # The nothing rule - Rule for testing the makefile structure. | 
|---|
| 885 | # ----------------------------------------------------------------------------- | 
|---|
| 886 | nothing: | 
|---|
| 887 | @$(ECHO) Doing nothing in $(MAKEFILE). | 
|---|
| 888 | !ifdef SUBDIRS | 
|---|
| 889 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@ | 
|---|
| 890 | !endif | 
|---|
| 891 | !ifdef PREMAKEFILES | 
|---|
| 892 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@ | 
|---|
| 893 | !endif | 
|---|
| 894 | !ifdef POSTMAKEFILES | 
|---|
| 895 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@ | 
|---|
| 896 | !endif | 
|---|
| 897 | @$(ECHO) Completed nothing in $(MAKEFILE). | 
|---|
| 898 |  | 
|---|
| 899 |  | 
|---|
| 900 |  | 
|---|
| 901 | # ----------------------------------------------------------------------------- | 
|---|
| 902 | # The $(TARGET) rule - For EXE, DLL, SYS and IFS targets | 
|---|
| 903 | # ----------------------------------------------------------------------------- | 
|---|
| 904 | !if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "VDD" | 
|---|
| 905 | $(TARGET): $(TARGET_OBJS) $(TARGET_RES) $(TARGET_DEF_LINK) $(TARGET_LNK) $(TARGET_DEPS) | 
|---|
| 906 | !if "$(TOOL_JOB_WAIT)" != "" | 
|---|
| 907 | ! ifndef BUILD_QUIET | 
|---|
| 908 | @$(ECHO) Waiting for jobs to complete $(CLRRST) | 
|---|
| 909 | ! endif | 
|---|
| 910 | \ | 
|---|
| 911 | ! ifndef BUILD_VERBOSE | 
|---|
| 912 | @ \ | 
|---|
| 913 | ! endif | 
|---|
| 914 | $(TOOL_JOB_WAIT) | 
|---|
| 915 | !endif | 
|---|
| 916 | @$(ECHO) Linking $(TARGET_MODE) $(CLRFIL)$@ $(CLRRST) | 
|---|
| 917 | \ | 
|---|
| 918 | !ifndef BUILD_VERBOSE | 
|---|
| 919 | @ \ | 
|---|
| 920 | !endif | 
|---|
| 921 | !ifdef TARGET_IGNORE_LINKER_WARNINGS | 
|---|
| 922 | -4 \ | 
|---|
| 923 | !endif | 
|---|
| 924 | !if "$(TARGET_MODE)" == "EXE" | 
|---|
| 925 | $(LINK_CMD_EXE) | 
|---|
| 926 | !endif | 
|---|
| 927 | !if "$(TARGET_MODE)" == "DLL" | 
|---|
| 928 | $(LINK_CMD_DLL) | 
|---|
| 929 | !endif | 
|---|
| 930 | !if "$(TARGET_MODE)" == "SYS" | 
|---|
| 931 | $(LINK_CMD_SYS) | 
|---|
| 932 | !endif | 
|---|
| 933 | !if "$(TARGET_MODE)" == "IFS" | 
|---|
| 934 | $(LINK_CMD_IFS) | 
|---|
| 935 | !endif | 
|---|
| 936 | !if "$(TARGET_MODE)" == "VDD" | 
|---|
| 937 | $(LINK_CMD_VDD) | 
|---|
| 938 | !endif | 
|---|
| 939 | !if "$(TARGET_RES)" != "" && "$(RL)" != "" | 
|---|
| 940 | @$(ECHO) Linking Resources $(CLRRST) | 
|---|
| 941 | \ | 
|---|
| 942 | ! ifndef BUILD_VERBOSE | 
|---|
| 943 | @ \ | 
|---|
| 944 | ! endif | 
|---|
| 945 | $(RL) $(RL_FLAGS) $(TARGET_RES) $@ | 
|---|
| 946 | !endif | 
|---|
| 947 | !if "$(TARGET_DLLRNAME)" != "" | 
|---|
| 948 | @$(ECHO) Dll Rename $(TARGET_DLLRNAME) | 
|---|
| 949 | \ | 
|---|
| 950 | ! ifndef BUILD_VERBOSE | 
|---|
| 951 | @ \ | 
|---|
| 952 | ! endif | 
|---|
| 953 | $(TOOL_DLLRNAME) $(TARGET) $(TARGET_DLLRNAME) | 
|---|
| 954 | !endif | 
|---|
| 955 | !if "$(TOOL_MAPSYM)" != "" && "$(TARGET_SYM)" != "" && "$(TARGET_MAP)" != "" | 
|---|
| 956 | \ | 
|---|
| 957 | ! ifndef BUILD_VERBOSE | 
|---|
| 958 | @ \ | 
|---|
| 959 | ! endif | 
|---|
| 960 | $(TOOL_MAPSYM) $(TARGET_MAP) $(TARGET_SYM) | 
|---|
| 961 | !endif | 
|---|
| 962 |  | 
|---|
| 963 |  | 
|---|
| 964 | # | 
|---|
| 965 | # Linker parameter file. | 
|---|
| 966 | # | 
|---|
| 967 | $(TARGET_LNK): $(MAKE_INCLUDE_PROCESS) $(MAKE_INCLUDE_SETUP) $(PATH_MAKE)\setup.mak $(MAKEFILE) | 
|---|
| 968 | !ifndef TOOL_DEFCONV | 
|---|
| 969 | @$(TOOL_ECHO) Creating Linker Input File $(CLRRST)<<$@ | 
|---|
| 970 | $(LINK_LNK1) | 
|---|
| 971 | $(LINK_LNK2) | 
|---|
| 972 | $(LINK_LNK3) | 
|---|
| 973 | $(LINK_LNK4) | 
|---|
| 974 | $(LINK_LNK5) | 
|---|
| 975 | <<KEEP | 
|---|
| 976 | !else | 
|---|
| 977 | @$(ECHO) Creating Linker Input File $(CLRRST) $@ | 
|---|
| 978 | @$(TOOL_RM) "$@" | 
|---|
| 979 | \ | 
|---|
| 980 | ! ifdef BUILD_VERBOSE | 
|---|
| 981 | @ \ | 
|---|
| 982 | ! endif | 
|---|
| 983 | $(TOOL_DEFCONV) $(TARGET_DEF_LINK) $@ <<$(TARGET_LNK)2 | 
|---|
| 984 | # | 
|---|
| 985 | # LINK_LNK[1-5]: | 
|---|
| 986 | # | 
|---|
| 987 | $(LINK_LNK1) | 
|---|
| 988 | $(LINK_LNK2) | 
|---|
| 989 | $(LINK_LNK3) | 
|---|
| 990 | $(LINK_LNK4) | 
|---|
| 991 | $(LINK_LNK5) | 
|---|
| 992 | <<keep | 
|---|
| 993 | !endif | 
|---|
| 994 | !ifdef BUILD_VERBOSE | 
|---|
| 995 | @type $@ | 
|---|
| 996 | !endif | 
|---|
| 997 |  | 
|---|
| 998 |  | 
|---|
| 999 | # | 
|---|
| 1000 | # Builddef modified definition file. | 
|---|
| 1001 | # | 
|---|
| 1002 | !if "$(TARGET_DEF_LINK)" != "$(TARGET_DEF)" | 
|---|
| 1003 | $(TARGET_DEF_LINK): $(TARGET_DEF) | 
|---|
| 1004 | ! ifndef BUILD_QUIET | 
|---|
| 1005 | @$(ECHO) Stamping deffile with build level info.$(CLRRST) | 
|---|
| 1006 | ! endif | 
|---|
| 1007 | \ | 
|---|
| 1008 | ! ifndef BUILD_VERBOSE | 
|---|
| 1009 | @ \ | 
|---|
| 1010 | ! endif | 
|---|
| 1011 | $(TOOL_BLDLEVEL) $(BUILD_BLDLEVEL_FLAGS) $(TARGET_BLDLEVEL_FLAGS) -R$** $** $@ | 
|---|
| 1012 | !endif | 
|---|
| 1013 |  | 
|---|
| 1014 | !endif | 
|---|
| 1015 |  | 
|---|
| 1016 |  | 
|---|
| 1017 | # ----------------------------------------------------------------------------- | 
|---|
| 1018 | # The $(TARGET) rule - For LIB, SYSLIB, and IFSLIB targets. | 
|---|
| 1019 | # ----------------------------------------------------------------------------- | 
|---|
| 1020 | !if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB" | 
|---|
| 1021 | $(TARGET): $(TARGET_OBJS) $(TARGET_LNK) $(TARGET_DEPS) | 
|---|
| 1022 | !if "$(TOOL_JOB_WAIT)" != "" | 
|---|
| 1023 | ! ifndef BUILD_QUIET | 
|---|
| 1024 | @$(ECHO) Waiting for jobs to complete $(CLRRST) | 
|---|
| 1025 | ! endif | 
|---|
| 1026 | \ | 
|---|
| 1027 | ! ifndef BUILD_VERBOSE | 
|---|
| 1028 | @ \ | 
|---|
| 1029 | ! endif | 
|---|
| 1030 | $(TOOL_JOB_WAIT) | 
|---|
| 1031 | !endif | 
|---|
| 1032 | @$(ECHO) Creating Library $(CLRFIL)$@ $(CLRRST) | 
|---|
| 1033 | !ifndef BUILD_VERBOSE | 
|---|
| 1034 | @$(TOOL_RM) "$@" | 
|---|
| 1035 | @$(AR_CMD) | 
|---|
| 1036 | !else | 
|---|
| 1037 | $(TOOL_RM) "$@" | 
|---|
| 1038 | $(AR_CMD) | 
|---|
| 1039 | !endif | 
|---|
| 1040 |  | 
|---|
| 1041 |  | 
|---|
| 1042 | # | 
|---|
| 1043 | # Lib parameter file. | 
|---|
| 1044 | # | 
|---|
| 1045 | $(TARGET_LNK): $(MAKE_INCLUDE_PROCESS) $(MAKE_INCLUDE_SETUP) $(PATH_MAKE)\setup.mak $(MAKEFILE) | 
|---|
| 1046 | @$(TOOL_ECHO) Creating Lib Input File $(CLRRST)<<$@ | 
|---|
| 1047 | $(AR_LNK1) | 
|---|
| 1048 | $(AR_LNK2) | 
|---|
| 1049 | $(AR_LNK3) | 
|---|
| 1050 | $(AR_LNK4) | 
|---|
| 1051 | $(AR_LNK5) | 
|---|
| 1052 | <<KEEP | 
|---|
| 1053 | !ifdef BUILD_VERBOSE | 
|---|
| 1054 | @type $@ | 
|---|
| 1055 | !endif | 
|---|
| 1056 | !endif | 
|---|
| 1057 |  | 
|---|
| 1058 |  | 
|---|
| 1059 | # ----------------------------------------------------------------------------- | 
|---|
| 1060 | # Copy rule for public targets. | 
|---|
| 1061 | #   Normally used for public libraries, but may be used for other purposes... | 
|---|
| 1062 | # ----------------------------------------------------------------------------- | 
|---|
| 1063 | !if "$(TARGET_PUBNAME)" != "" | 
|---|
| 1064 | $(TARGET_PUBNAME): $(TARGET) | 
|---|
| 1065 | @$(ECHO) Copying $(CLRFIL)$(TARGET)$(CLRTXT) to $(CLRFIL)$(@D)$(CLRRST) | 
|---|
| 1066 | \ | 
|---|
| 1067 | !ifndef BUILD_VERBOSE | 
|---|
| 1068 | @if not exist $(@D) $(ECHO) Target public path $(CLRFIL)$(@D)$(CLRTXT) does NOT exist. Creating. $(CLRRST) | 
|---|
| 1069 | !endif | 
|---|
| 1070 | @if not exist $(@D) $(TOOL_CREATEPATH) $(@D) | 
|---|
| 1071 | \ | 
|---|
| 1072 | !ifndef BUILD_VERBOSE | 
|---|
| 1073 | @ \ | 
|---|
| 1074 | !endif | 
|---|
| 1075 | $(TOOL_COPY) $** $@ | 
|---|
| 1076 | @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(@R).sym | 
|---|
| 1077 | !endif | 
|---|
| 1078 |  | 
|---|
| 1079 |  | 
|---|
| 1080 |  | 
|---|
| 1081 | # ----------------------------------------------------------------------------- | 
|---|
| 1082 | # The $(TARGET) rule - For DEPEND targets. | 
|---|
| 1083 | # ----------------------------------------------------------------------------- | 
|---|
| 1084 | !if "$(TARGET_MODE)" == "DEPEND" | 
|---|
| 1085 | $(TARGET): | 
|---|
| 1086 | @$(ECHO) . | 
|---|
| 1087 | !endif | 
|---|
| 1088 |  | 
|---|
| 1089 |  | 
|---|
| 1090 |  | 
|---|
| 1091 | # ----------------------------------------------------------------------------- | 
|---|
| 1092 | # The $(TARGET_ILIB) rule - Make import library. | 
|---|
| 1093 | # ----------------------------------------------------------------------------- | 
|---|
| 1094 | !ifdef TARGET_ILIB | 
|---|
| 1095 | $(TARGET_ILIB): $(TARGET_IDEF) | 
|---|
| 1096 | @$(ECHO) Creating Import Library $(CLRFIL)$@ $(CLRRST) | 
|---|
| 1097 | \ | 
|---|
| 1098 | !ifndef BUILD_VERBOSE | 
|---|
| 1099 | @ \ | 
|---|
| 1100 | !endif | 
|---|
| 1101 | $(IMPLIB) $(IMPLIB_FLAGS) $@ $(TARGET_IDEF) | 
|---|
| 1102 | !endif | 
|---|
| 1103 |  | 
|---|
| 1104 |  | 
|---|
| 1105 |  | 
|---|
| 1106 | # ----------------------------------------------------------------------------- | 
|---|
| 1107 | # The .force rule - Force a remake of something everytime. | 
|---|
| 1108 | # ----------------------------------------------------------------------------- | 
|---|
| 1109 | .force: | 
|---|
| 1110 | !ifndef BUILD_VERBOSE | 
|---|
| 1111 | @$(ECHO) . | 
|---|
| 1112 | !else | 
|---|
| 1113 | @$(ECHO) . (force) . | 
|---|
| 1114 | !endif | 
|---|
| 1115 |  | 
|---|
| 1116 |  | 
|---|
| 1117 |  | 
|---|
| 1118 | # ----------------------------------------------------------------------------- | 
|---|
| 1119 | # Read Dependencies. | 
|---|
| 1120 | # ----------------------------------------------------------------------------- | 
|---|
| 1121 | !if "$(TARGET_MODE)" != "TESTCASE" && "$(TARGET_MODE)" != "DEPEND" | 
|---|
| 1122 | !if "$(TARGET_MODE)" != "EMPTY" && "$(NODEP)" == "" | 
|---|
| 1123 |  | 
|---|
| 1124 | # | 
|---|
| 1125 | # Read dependency file for current directory | 
|---|
| 1126 | # | 
|---|
| 1127 | !ifndef MAKEVER | 
|---|
| 1128 | ! if [$(TOOL_EXISTS) $(TARGET_DEPEND)] == 0 | 
|---|
| 1129 | !  ifdef BUILD_VERBOSE | 
|---|
| 1130 | !   if [$(ECHO) Including dependency $(CLRFIL)$(TARGET_DEPEND)$(CLRRST)] | 
|---|
| 1131 | !   endif | 
|---|
| 1132 | !  endif | 
|---|
| 1133 | !  include $(TARGET_DEPEND) | 
|---|
| 1134 | ! else | 
|---|
| 1135 | !  ifndef NODEP | 
|---|
| 1136 | !   if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(TARGET_DEPEND) is missing.$(CLRRST)] | 
|---|
| 1137 | !   endif | 
|---|
| 1138 | !  endif | 
|---|
| 1139 | ! endif | 
|---|
| 1140 | !else | 
|---|
| 1141 | ! if %exists($(TARGET_DEPEND)) != 0 | 
|---|
| 1142 | !  ifdef BUILD_VERBOSE | 
|---|
| 1143 | $(ECHO) Including dependency $(CLRFIL)$(TARGET_DEPEND)$(CLRRST) | 
|---|
| 1144 | !  endif | 
|---|
| 1145 | !  include $(TARGET_DEPEND) | 
|---|
| 1146 | ! else | 
|---|
| 1147 | !  ifndef NODEP | 
|---|
| 1148 | $(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(TARGET_DEPEND) is missing.$(CLRRST) | 
|---|
| 1149 | !  endif | 
|---|
| 1150 | ! endif | 
|---|
| 1151 | !endif | 
|---|
| 1152 |  | 
|---|
| 1153 |  | 
|---|
| 1154 | # | 
|---|
| 1155 | # Read global dependency files. | 
|---|
| 1156 | # | 
|---|
| 1157 | !ifdef BUILD_DEPEND1 | 
|---|
| 1158 | ! ifndef MAKEVER | 
|---|
| 1159 | !  if [$(TOOL_EXISTS) $(BUILD_DEPEND1)] == 0 | 
|---|
| 1160 | !   ifdef BUILD_VERBOSE | 
|---|
| 1161 | !    if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND1)$(CLRRST)] | 
|---|
| 1162 | !    endif | 
|---|
| 1163 | !   endif | 
|---|
| 1164 | !   include $(BUILD_DEPEND1) | 
|---|
| 1165 | !  else | 
|---|
| 1166 | !   ifndef NODEP | 
|---|
| 1167 | !    if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND1) is missing.$(CLRRST)] | 
|---|
| 1168 | !    endif | 
|---|
| 1169 | !   endif | 
|---|
| 1170 | !  endif | 
|---|
| 1171 | ! else | 
|---|
| 1172 | !  if %exists($(BUILD_DEPEND1)) != 0 | 
|---|
| 1173 | !   ifdef BUILD_VERBOSE | 
|---|
| 1174 | $(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND1)$(CLRRST) | 
|---|
| 1175 | !   endif | 
|---|
| 1176 | !   include $(BUILD_DEPEND1) | 
|---|
| 1177 | !  else | 
|---|
| 1178 | !   ifndef NODEP | 
|---|
| 1179 | $(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND1) is missing.$(CLRRST) | 
|---|
| 1180 | !   endif | 
|---|
| 1181 | !  endif | 
|---|
| 1182 | ! endif | 
|---|
| 1183 | !endif | 
|---|
| 1184 |  | 
|---|
| 1185 |  | 
|---|
| 1186 | !ifdef BUILD_DEPEND2 | 
|---|
| 1187 | ! ifndef MAKEVER | 
|---|
| 1188 | !  if [$(TOOL_EXISTS) $(BUILD_DEPEND2)] == 0 | 
|---|
| 1189 | !   ifdef BUILD_VERBOSE | 
|---|
| 1190 | !    if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND2)$(CLRRST)] | 
|---|
| 1191 | !    endif | 
|---|
| 1192 | !   endif | 
|---|
| 1193 | !   include $(BUILD_DEPEND2) | 
|---|
| 1194 | !  else | 
|---|
| 1195 | !   ifndef NODEP | 
|---|
| 1196 | !    if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND2) is missing.$(CLRRST)] | 
|---|
| 1197 | !    endif | 
|---|
| 1198 | !   endif | 
|---|
| 1199 | !  endif | 
|---|
| 1200 | ! else | 
|---|
| 1201 | !  if %exists($(BUILD_DEPEND2)) != 0 | 
|---|
| 1202 | !   ifdef BUILD_VERBOSE | 
|---|
| 1203 | $(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND2)$(CLRRST) | 
|---|
| 1204 | !   endif | 
|---|
| 1205 | !   include $(BUILD_DEPEND2) | 
|---|
| 1206 | !  else | 
|---|
| 1207 | !   ifndef NODEP | 
|---|
| 1208 | $(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND2) is missing.$(CLRRST) | 
|---|
| 1209 | !   endif | 
|---|
| 1210 | !  endif | 
|---|
| 1211 | ! endif | 
|---|
| 1212 | !endif | 
|---|
| 1213 |  | 
|---|
| 1214 |  | 
|---|
| 1215 | !ifdef BUILD_DEPEND3 | 
|---|
| 1216 | ! ifndef MAKEVER | 
|---|
| 1217 | !  if [$(TOOL_EXISTS) $(BUILD_DEPEND3)] == 0 | 
|---|
| 1218 | !   ifdef BUILD_VERBOSE | 
|---|
| 1219 | !    if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND3)$(CLRRST)] | 
|---|
| 1220 | !    endif | 
|---|
| 1221 | !   endif | 
|---|
| 1222 | !   include $(BUILD_DEPEND3) | 
|---|
| 1223 | !  else | 
|---|
| 1224 | !   ifndef NODEP | 
|---|
| 1225 | !    if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND3) is missing.$(CLRRST)] | 
|---|
| 1226 | !    endif | 
|---|
| 1227 | !   endif | 
|---|
| 1228 | !  endif | 
|---|
| 1229 | ! else | 
|---|
| 1230 | !  if %exists($(BUILD_DEPEND3)) != 0 | 
|---|
| 1231 | !   ifdef BUILD_VERBOSE | 
|---|
| 1232 | $(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND3)$(CLRRST) | 
|---|
| 1233 | !   endif | 
|---|
| 1234 | !   include $(BUILD_DEPEND3) | 
|---|
| 1235 | !  else | 
|---|
| 1236 | !   ifndef NODEP | 
|---|
| 1237 | $(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND3) is missing.$(CLRRST) | 
|---|
| 1238 | !   endif | 
|---|
| 1239 | !  endif | 
|---|
| 1240 | ! endif | 
|---|
| 1241 | !endif | 
|---|
| 1242 |  | 
|---|
| 1243 |  | 
|---|
| 1244 | !endif | 
|---|
| 1245 |  | 
|---|
| 1246 |  | 
|---|
| 1247 | # | 
|---|
| 1248 | # If BUILD_MULTIJOBS is nonempty make sure the job daemon is up running. | 
|---|
| 1249 | # | 
|---|
| 1250 | !if "$(BUILD_MULTIJOBS)" != "" | 
|---|
| 1251 | ! if [$(TOOL_JOB_UP)] != 0 | 
|---|
| 1252 | !  if "$(BUILD_QUITE)" == "" | 
|---|
| 1253 | !   ifndef MAKEVER | 
|---|
| 1254 | !    if [$(ECHO) Starting Job Daemon With $(TOOL_JOB_WORKERS) Workers...$(CLRRST)] | 
|---|
| 1255 | !    endif | 
|---|
| 1256 | !   else | 
|---|
| 1257 | $(ECHO) Starting Job Daemon With $(TOOL_JOB_WORKERS) Workers...$(CLRRST) | 
|---|
| 1258 | !   endif | 
|---|
| 1259 | !  endif | 
|---|
| 1260 | !  if [$(TOOL_JOB_INIT) $(TOOL_JOB_WORKERS)] != 0 | 
|---|
| 1261 | !   ifndef MAKEVER | 
|---|
| 1262 | !    if [$(ECHO) $(CLRERR)Fatal error: Failed to start job daemon.$(CLRRST)] | 
|---|
| 1263 | !    endif | 
|---|
| 1264 | !    error | 
|---|
| 1265 | !else | 
|---|
| 1266 | !    error $(CLRERR)Fatal error: Failed to start job daemon.$(CLRRST) | 
|---|
| 1267 | !endif | 
|---|
| 1268 | !  endif | 
|---|
| 1269 | ! endif | 
|---|
| 1270 | !endif | 
|---|
| 1271 |  | 
|---|
| 1272 | !endif #!TESTCASE | 
|---|