| 1 | # $Id: process.mak,v 1.31 2002-09-14 23:27:04 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, DEPEND, 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, DEPEND, 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 | # stuff which has changed behavior.
|
|---|
| 93 | !if 1
|
|---|
| 94 |
|
|---|
| 95 | ! ifdef TARGET_PUBNAME
|
|---|
| 96 | ! if [$(ECHO) $(CLRERR)Fatal error: TARGET_PUBNAME isn't supported. The pubname stuff has changed!$(CLRRST)]
|
|---|
| 97 | ! endif
|
|---|
| 98 | ! error
|
|---|
| 99 | ! endif
|
|---|
| 100 |
|
|---|
| 101 | ! ifdef PATH_INCLUDE
|
|---|
| 102 | ! if [$(ECHO) $(CLRERR)Fatal error: PATH_INCLUDE has changed name to PATH_INCLUDES!$(CLRRST)]
|
|---|
| 103 | ! endif
|
|---|
| 104 | ! error
|
|---|
| 105 | ! endif
|
|---|
| 106 |
|
|---|
| 107 | !endif
|
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 | # -----------------------------------------------------------------------------
|
|---|
| 112 | # Provide overridable defaults
|
|---|
| 113 | # -----------------------------------------------------------------------------
|
|---|
| 114 |
|
|---|
| 115 | # Default target mode is executable.
|
|---|
| 116 | !ifndef TARGET_MODE
|
|---|
| 117 | ! if "$(_BUILD_PROJECT)" != "Odin32"
|
|---|
| 118 | TARGET_MODE = EXE
|
|---|
| 119 | ! else
|
|---|
| 120 | # Odin32 defaults.
|
|---|
| 121 | ! ifndef CUSTOMBUILD
|
|---|
| 122 | TARGET_MODE = DLL
|
|---|
| 123 | ! else
|
|---|
| 124 | TARGET_MODE = LIB
|
|---|
| 125 | ! endif
|
|---|
| 126 | ! endif
|
|---|
| 127 | !endif
|
|---|
| 128 |
|
|---|
| 129 | # Default extension corresponds to the target mode.
|
|---|
| 130 | !ifndef TARGET_EXT
|
|---|
| 131 | ! if "$(TARGET_MODE)" == "DLL"
|
|---|
| 132 | TARGET_EXT = $(EXT_DLL)
|
|---|
| 133 | ! endif
|
|---|
| 134 | ! if "$(TARGET_MODE)" == "SYS"
|
|---|
| 135 | TARGET_EXT = $(EXT_SYS)
|
|---|
| 136 | ! endif
|
|---|
| 137 | ! if "$(TARGET_MODE)" == "IFS"
|
|---|
| 138 | TARGET_EXT = $(EXT_IFS)
|
|---|
| 139 | ! endif
|
|---|
| 140 | ! if "$(TARGET_MODE)" == "VDD"
|
|---|
| 141 | TARGET_EXT = $(EXT_VDD)
|
|---|
| 142 | ! endif
|
|---|
| 143 | ! if "$(TARGET_MODE)" == "EXE"
|
|---|
| 144 | TARGET_EXT = $(EXT_EXE)
|
|---|
| 145 | ! endif
|
|---|
| 146 | ! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
|
|---|
| 147 | TARGET_EXT = $(EXT_LIB)
|
|---|
| 148 | ! endif
|
|---|
| 149 | ! if "$(TARGET_MODE)" == "EMPTY"
|
|---|
| 150 | TARGET_EXT = empty
|
|---|
| 151 | ! endif
|
|---|
| 152 | ! if "$(TARGET_MODE)" == "DEPEND"
|
|---|
| 153 | TARGET_EXT = depend
|
|---|
| 154 | ! endif
|
|---|
| 155 | ! if "$(TARGET_MODE)" == "TESTCASE"
|
|---|
| 156 | TARGET_EXT = testcase
|
|---|
| 157 | ! endif
|
|---|
| 158 | ! ifndef TARGET_EXT
|
|---|
| 159 | ! ifndef MAKEVER
|
|---|
| 160 | ! if [$(ECHO) $(CLRERR)Internal Error: TARGET_EXT not set. Probably invalid TARGET_MODE. (TARGET_MODE="$(TARGET_MODE)")$(CLRRST)]
|
|---|
| 161 | ! endif
|
|---|
| 162 | ! error
|
|---|
| 163 | ! else
|
|---|
| 164 | ! error $(CLRERR)Internal Error: TARGET_EXT not set. Probably invalid TARGET_MODE. (TARGET_MODE="$(TARGET_MODE)")$(CLRRST)
|
|---|
| 165 | ! endif
|
|---|
| 166 | ! endif
|
|---|
| 167 | !endif
|
|---|
| 168 |
|
|---|
| 169 | # Default target path. (where all the generated stuff for this target goes)
|
|---|
| 170 | !ifndef PATH_TARGET
|
|---|
| 171 | !if "$(TARGET_SUB)" != ""
|
|---|
| 172 | PATH_TARGET = $(PATH_OBJ)\$(TARGET_SUB)\$(TARGET_NAME).$(TARGET_EXT)
|
|---|
| 173 | !else
|
|---|
| 174 | PATH_TARGET = $(PATH_OBJ)\$(TARGET_NAME).$(TARGET_EXT)
|
|---|
| 175 | !endif
|
|---|
| 176 | !endif
|
|---|
| 177 |
|
|---|
| 178 | # Default target file. (output)
|
|---|
| 179 | !ifndef TARGET
|
|---|
| 180 | ! if "$(TARGET_MODE)" != "EMPTY"
|
|---|
| 181 | ! if "$(TARGET_MODE)" != "TESTCASE"
|
|---|
| 182 | TARGET = $(PATH_TARGET)\$(TARGET_NAME).$(TARGET_EXT)
|
|---|
| 183 | ! else
|
|---|
| 184 | TARGET = testcase
|
|---|
| 185 | ! endif
|
|---|
| 186 | ! endif
|
|---|
| 187 | !endif
|
|---|
| 188 |
|
|---|
| 189 | # Default target .sym file. (output)
|
|---|
| 190 | !ifndef TARGET_SYM
|
|---|
| 191 | TARGET_SYM = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_SYM)
|
|---|
| 192 | !endif
|
|---|
| 193 |
|
|---|
| 194 | # Default object file. (output)
|
|---|
| 195 | !ifndef TARGET_OBJS
|
|---|
| 196 | TARGET_OBJS = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_OBJ)
|
|---|
| 197 | !endif
|
|---|
| 198 |
|
|---|
| 199 | # Default libraries. (input)
|
|---|
| 200 | !ifndef TARGET_LIBS
|
|---|
| 201 | TARGET_LIBS = $(LIB_C_DLL) $(LIB_OS) $(LIB_C_RTDLL)
|
|---|
| 202 | !endif
|
|---|
| 203 |
|
|---|
| 204 | # Default definition file. (input)
|
|---|
| 205 | !ifndef TARGET_DEF
|
|---|
| 206 | TARGET_DEF = $(MAKEDIR)\$(PATH_DEF)\$(TARGET_NAME).def
|
|---|
| 207 | !endif
|
|---|
| 208 |
|
|---|
| 209 | # Default modified definition filename. (output)
|
|---|
| 210 | !ifndef TARGET_DEF_LINK
|
|---|
| 211 | TARGET_DEF_LINK = $(PATH_TARGET)\$(TARGET_NAME)_link.def
|
|---|
| 212 | !endif
|
|---|
| 213 |
|
|---|
| 214 | # Default definition file for generating the import library. (input)
|
|---|
| 215 | !ifndef TARGET_IDEF
|
|---|
| 216 | ! if "$(_BUILD_PROJECT)" != "Odin32"
|
|---|
| 217 | TARGET_IDEF = $(TARGET_DEF)
|
|---|
| 218 | ! else
|
|---|
| 219 | ! if defined(TARGET_IDEF_CONV) || "$(TARGET_IDEF_ORG)" != ""
|
|---|
| 220 | TARGET_IDEF = $(PATH_TARGET)\$(TARGET_NAME)_implib.def
|
|---|
| 221 | ! ifndef TARGET_IDEF_ORG
|
|---|
| 222 | TARGET_IDEF_ORG = $(TARGET_DEF)
|
|---|
| 223 | ! endif
|
|---|
| 224 | ! else
|
|---|
| 225 | TARGET_IDEF = $(TARGET_DEF)
|
|---|
| 226 | TARGET_IDEF_ORG = $(TARGET_DEF)
|
|---|
| 227 | ! endif
|
|---|
| 228 | ! endif
|
|---|
| 229 |
|
|---|
| 230 | !endif
|
|---|
| 231 |
|
|---|
| 232 | # Default map file. (output)
|
|---|
| 233 | !ifndef TARGET_MAP
|
|---|
| 234 | TARGET_MAP = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_MAP)
|
|---|
| 235 | !endif
|
|---|
| 236 |
|
|---|
| 237 | # Default link file. (output)
|
|---|
| 238 | !ifndef TARGET_LNK
|
|---|
| 239 | TARGET_LNK = $(PATH_TARGET)\$(TARGET_NAME).lnk
|
|---|
| 240 | !endif
|
|---|
| 241 |
|
|---|
| 242 | # Default import library file. (output)
|
|---|
| 243 | !ifndef TARGET_ILIB
|
|---|
| 244 | ! if "$(TARGET_MODE)" == "DLL" || "$(TARGET_ILIB_YES)" != ""
|
|---|
| 245 | TARGET_ILIB = $(PATH_LIB)\$(TARGET_NAME).$(EXT_ILIB)
|
|---|
| 246 | ! endif
|
|---|
| 247 | !endif
|
|---|
| 248 |
|
|---|
| 249 | # Default public base directory. (publish)
|
|---|
| 250 | !ifndef TARGET_PUB_BASE
|
|---|
| 251 | ! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
|
|---|
| 252 | TARGET_PUB_BASE = $(PATH_LIB)
|
|---|
| 253 | ! else
|
|---|
| 254 | TARGET_PUB_BASE = $(PATH_PUB)
|
|---|
| 255 | !endif
|
|---|
| 256 | !endif
|
|---|
| 257 |
|
|---|
| 258 | # Default public base directory for unstripped release version.
|
|---|
| 259 | !ifndef TARGET_PUB_BASE_DEB
|
|---|
| 260 | ! if "$(BUILD_MODE)" == "RELEASE" && "$(TARGET_MODE:LIB=...)" == "$(TARGET_MODE)"
|
|---|
| 261 | ! if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "VDD"
|
|---|
| 262 | TARGET_PUB_BASE_DEB = $(PATH_PUB_DEB)
|
|---|
| 263 | ! endif
|
|---|
| 264 | ! endif
|
|---|
| 265 | !endif
|
|---|
| 266 |
|
|---|
| 267 | # Default sub directory.
|
|---|
| 268 | !ifndef TARGET_PUB_SUB
|
|---|
| 269 | ! if "$(TARGET_SUB)" != ""
|
|---|
| 270 | TARGET_PUB_SUB = $(TARGET_SUB)
|
|---|
| 271 | ! else
|
|---|
| 272 | ! if "$(TARGET_MODE)" == "EXE"
|
|---|
| 273 | TARGET_PUB_SUB = $(PATH_SUB_BIN)
|
|---|
| 274 | ! endif
|
|---|
| 275 | ! if "$(TARGET_MODE)" == "DLL"
|
|---|
| 276 | TARGET_PUB_SUB = $(PATH_SUB_DLL)
|
|---|
| 277 | ! endif
|
|---|
| 278 | ! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
|
|---|
| 279 | TARGET_PUB_SUB = .
|
|---|
| 280 | ! endif
|
|---|
| 281 | ! if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS"
|
|---|
| 282 | TARGET_PUB_SUB = $(PATH_SUB_SYS)
|
|---|
| 283 | ! endif
|
|---|
| 284 | ! if "$(TARGET_MODE)" == "VDD"
|
|---|
| 285 | TARGET_PUB_SUB = $(PATH_SUB_VDD)
|
|---|
| 286 | ! endif
|
|---|
| 287 | ! endif
|
|---|
| 288 | !endif
|
|---|
| 289 |
|
|---|
| 290 | # Default public directory.
|
|---|
| 291 | !ifndef TARGET_PUB_DIR
|
|---|
| 292 | TARGET_PUB_DIR = $(TARGET_PUB_BASE)\$(TARGET_PUB_SUB)
|
|---|
| 293 | !endif
|
|---|
| 294 |
|
|---|
| 295 | # Default unstripped public directory.
|
|---|
| 296 | !if !defined(TARGET_PUB_DIR_DEB) && "$(TARGET_PUB_BASE_DEB)" != ""
|
|---|
| 297 | TARGET_PUB_DIR_DEB = $(TARGET_PUB_BASE_DEB)\$(TARGET_PUB_SUB)
|
|---|
| 298 | !endif
|
|---|
| 299 |
|
|---|
| 300 | # Default public name.
|
|---|
| 301 | !ifndef TARGET_PUB_NAME
|
|---|
| 302 | TARGET_PUB_NAME = $(TARGET_NAME)
|
|---|
| 303 | !endif
|
|---|
| 304 |
|
|---|
| 305 | # Default public ext.
|
|---|
| 306 | !ifndef TARGET_PUB_EXT
|
|---|
| 307 | TARGET_PUB_EXT = $(TARGET_EXT)
|
|---|
| 308 | !endif
|
|---|
| 309 |
|
|---|
| 310 | # Default public full name.
|
|---|
| 311 | !ifndef TARGET_PUB
|
|---|
| 312 | TARGET_PUB = $(TARGET_PUB_DIR)\$(TARGET_PUB_NAME).$(TARGET_PUB_EXT)
|
|---|
| 313 | !endif
|
|---|
| 314 |
|
|---|
| 315 | # Default public full name of unstripped version.
|
|---|
| 316 | !if !defined(TARGET_PUB_DEB) && "$(TARGET_PUB_DIR_DEB)" != ""
|
|---|
| 317 | TARGET_PUB_DEB = $(TARGET_PUB_DIR_DEB)\$(TARGET_PUB_NAME).$(TARGET_PUB_EXT)
|
|---|
| 318 | !endif
|
|---|
| 319 |
|
|---|
| 320 | # Default depend filename.
|
|---|
| 321 | !ifndef TARGET_DEPEND
|
|---|
| 322 | TARGET_DEPEND = $(PATH_TARGET)\.depend
|
|---|
| 323 | !endif
|
|---|
| 324 |
|
|---|
| 325 | # Default makefile names.
|
|---|
| 326 | !ifndef BUILD_MAKEFILE
|
|---|
| 327 | BUILD_MAKEFILE = Makefile
|
|---|
| 328 | !endif
|
|---|
| 329 |
|
|---|
| 330 | # Default makefile name.
|
|---|
| 331 | !ifndef MAKEFILE
|
|---|
| 332 | MAKEFILE = $(BUILD_MAKEFILE)
|
|---|
| 333 | !endif
|
|---|
| 334 |
|
|---|
| 335 | # Ignore linker warnings for some target modes.
|
|---|
| 336 | !ifndef TARGET_IGNORE_LINKER_WARNINGS
|
|---|
| 337 | ! if "$(TARGET_MODE)" == "DLL"
|
|---|
| 338 | TARGET_IGNORE_LINKER_WARNINGS = 1
|
|---|
| 339 | ! endif
|
|---|
| 340 | !endif
|
|---|
| 341 |
|
|---|
| 342 |
|
|---|
| 343 | # Default stacksize
|
|---|
| 344 | # If 16bit: 8KB
|
|---|
| 345 | # Else (32bit): 64KB
|
|---|
| 346 | !ifndef TARGET_STACKSIZE
|
|---|
| 347 | ! ifdef ENV_16BIT
|
|---|
| 348 | TARGET_STACKSIZE=0x2000
|
|---|
| 349 | ! else
|
|---|
| 350 | TARGET_STACKSIZE=0x10000
|
|---|
| 351 | ! endif
|
|---|
| 352 | !endif
|
|---|
| 353 |
|
|---|
| 354 |
|
|---|
| 355 |
|
|---|
| 356 | # -----------------------------------------------------------------------------
|
|---|
| 357 | # Internal helper macros - don't mess!
|
|---|
| 358 | # -----------------------------------------------------------------------------
|
|---|
| 359 |
|
|---|
| 360 | # Helper for doing early publish of a target.
|
|---|
| 361 | !if defined(TARGET_NEEDED) || defined(TARGET_PUBLIC)
|
|---|
| 362 | _TARGET_EARLY_PUBLISH = publish_target
|
|---|
| 363 | !else
|
|---|
| 364 | _TARGET_EARLY_PUBLISH =
|
|---|
| 365 | !endif
|
|---|
| 366 |
|
|---|
| 367 | # The unstripped release name (internal!)
|
|---|
| 368 | _TARGET_DEB = $(TARGET).unstripped
|
|---|
| 369 |
|
|---|
| 370 |
|
|---|
| 371 |
|
|---|
| 372 | # -----------------------------------------------------------------------------
|
|---|
| 373 | # Tell user what we're building.
|
|---|
| 374 | # -----------------------------------------------------------------------------
|
|---|
| 375 | !ifndef BUILD_QUIET
|
|---|
| 376 | ! if "$(TARGET)" != ""
|
|---|
| 377 | ! ifndef MAKEVER
|
|---|
| 378 | ! if [$(ECHO) Target is $(CLRFIL)$(TARGET)$(CLRRST)]
|
|---|
| 379 | ! endif
|
|---|
| 380 | ! else
|
|---|
| 381 | $(ECHO) Target is $(CLRFIL)$(TARGET)$(CLRRST)
|
|---|
| 382 | ! endif
|
|---|
| 383 | ! endif
|
|---|
| 384 | !endif
|
|---|
| 385 |
|
|---|
| 386 |
|
|---|
| 387 | # -----------------------------------------------------------------------------
|
|---|
| 388 | # Ensure the platform-specific target path exists
|
|---|
| 389 | # -----------------------------------------------------------------------------
|
|---|
| 390 |
|
|---|
| 391 | !if "$(TARGET_MODE)" != "EMPTY"
|
|---|
| 392 | ! if "$(PATH_TARGET)" != ""
|
|---|
| 393 | ! ifndef MAKEVER
|
|---|
| 394 | ! if [$(TOOL_EXISTS) $(PATH_TARGET)] != 0
|
|---|
| 395 | ! ifndef BUILD_QUIET
|
|---|
| 396 | ! if [$(ECHO) Target path $(CLRFIL)$(PATH_TARGET)$(CLRTXT) does NOT exist. Creating. $(CLRRST)]
|
|---|
| 397 | ! endif
|
|---|
| 398 | ! endif
|
|---|
| 399 | ! if [$(TOOL_CREATEPATH) $(PATH_TARGET)]
|
|---|
| 400 | ! if [$(ECHO) $(CLRERR)Error: Could not create $(CLRFIL)$(PATH_TARGET)$(CLRRST)]
|
|---|
| 401 | ! endif
|
|---|
| 402 | ! error
|
|---|
| 403 | ! endif
|
|---|
| 404 | ! endif
|
|---|
| 405 | ! else
|
|---|
| 406 | ! if %exist($(PATH_TARGET)) == 0
|
|---|
| 407 | ! ifndef BUILD_QUIET
|
|---|
| 408 | $(ECHO) Target path $(CLRFIL)$(PATH_TARGET)$(CLRTXT) does NOT exist. Creating. $(CLRRST)
|
|---|
| 409 | ! endif
|
|---|
| 410 | ! else
|
|---|
| 411 | ! if [$(TOOL_CREATEPATH) $(PATH_TARGET)]
|
|---|
| 412 | ! error $(CLRERR)Error: Could not create $(CLRFIL)$(PATH_TARGET)$(CLRRST)
|
|---|
| 413 | ! endif
|
|---|
| 414 | ! endif
|
|---|
| 415 | ! endif
|
|---|
| 416 | ! endif
|
|---|
| 417 | !endif
|
|---|
| 418 | # not 100% sure about the != EMPTY stuff, but this is way faster.
|
|---|
| 419 |
|
|---|
| 420 |
|
|---|
| 421 | # -----------------------------------------------------------------------------
|
|---|
| 422 | # Make all targets 'unprecious'. (works only on nmake5)
|
|---|
| 423 | # -----------------------------------------------------------------------------
|
|---|
| 424 | .PRECIOUS: .force
|
|---|
| 425 |
|
|---|
| 426 |
|
|---|
| 427 | # -----------------------------------------------------------------------------
|
|---|
| 428 | # Common inference rules
|
|---|
| 429 | # -----------------------------------------------------------------------------
|
|---|
| 430 | .SUFFIXES:
|
|---|
| 431 | .SUFFIXES: .c .cpp .orc .asm .$(EXT_OBJ) .$(EXT_RES) .rc .ii .s
|
|---|
| 432 |
|
|---|
| 433 | #
|
|---|
| 434 | # A workaround for SlickEdits inability to find the buggy files..
|
|---|
| 435 | # This makes the source filenames in the error listing have full path.
|
|---|
| 436 | # See setup.mak for compile command line.
|
|---|
| 437 | #
|
|---|
| 438 | _SRC = $<
|
|---|
| 439 | !ifdef SLKRUNS
|
|---|
| 440 | _SRC = $(PATH_CURRENT)\$<
|
|---|
| 441 | !endif
|
|---|
| 442 | _DST = $(PATH_TARGET)\$(@F)
|
|---|
| 443 |
|
|---|
| 444 |
|
|---|
| 445 | # Assembling assembly source.
|
|---|
| 446 | .asm{$(PATH_TARGET)}.$(EXT_OBJ):
|
|---|
| 447 | @$(ECHO) Assembling $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST)
|
|---|
| 448 | \
|
|---|
| 449 | ! ifndef BUILD_VERBOSE
|
|---|
| 450 | @ \
|
|---|
| 451 | ! endif
|
|---|
| 452 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
|
|---|
| 453 | ! ifdef AS_CMD_SYS
|
|---|
| 454 | $(TOOL_JOB_SUB) $(AS_CMD_SYS)
|
|---|
| 455 | ! else
|
|---|
| 456 | $(TOOL_JOB_SUB) $(AS) $(AS_FLAGS_SYS) $(_SRC) $(AS_OBJ_OUT)$(_DST)
|
|---|
| 457 | ! endif
|
|---|
| 458 | !else
|
|---|
| 459 | ! ifdef AS_CMD
|
|---|
| 460 | $(TOOL_JOB_SUB) $(AS_CMD)
|
|---|
| 461 | ! else
|
|---|
| 462 | $(TOOL_JOB_SUB) $(AS) $(AS_FLAGS) $(_SRC) $(AS_OBJ_OUT)$(_DST)
|
|---|
| 463 | ! endif
|
|---|
| 464 | !endif
|
|---|
| 465 |
|
|---|
| 466 | .asm.$(EXT_OBJ):
|
|---|
| 467 | @$(ECHO) Assembling $(CLRFIL)$(_SRC) $(CLRRST)
|
|---|
| 468 | \
|
|---|
| 469 | !ifndef BUILD_VERBOSE
|
|---|
| 470 | @ \
|
|---|
| 471 | !endif
|
|---|
| 472 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
|
|---|
| 473 | ! ifdef AS_CMD_SYS
|
|---|
| 474 | $(AS_CMD_SYS)
|
|---|
| 475 | ! else
|
|---|
| 476 | $(AS) $(AS_FLAGS_SYS) $(_SRC) $(AS_OBJ_OUT)$(_DST)
|
|---|
| 477 | ! endif
|
|---|
| 478 | !else
|
|---|
| 479 | ! ifdef AS_CMD
|
|---|
| 480 | $(AS_CMD)
|
|---|
| 481 | ! else
|
|---|
| 482 | $(AS) $(AS_FLAGS) $(_SRC) $(AS_OBJ_OUT)$(_DST)
|
|---|
| 483 | ! endif
|
|---|
| 484 | !endif
|
|---|
| 485 |
|
|---|
| 486 | # C++ Compiler base line
|
|---|
| 487 | _CXX_BASELINE = $(CXX) \
|
|---|
| 488 | !if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB"
|
|---|
| 489 | $(CXX_FLAGS_EXE) \
|
|---|
| 490 | !endif
|
|---|
| 491 | !if "$(TARGET_MODE)" == "DLL"
|
|---|
| 492 | $(CXX_FLAGS_DLL) \
|
|---|
| 493 | !endif
|
|---|
| 494 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
|
|---|
| 495 | $(CXX_FLAGS_SYS) \
|
|---|
| 496 | !endif
|
|---|
| 497 | !if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
|
|---|
| 498 | $(CXX_FLAGS_IFS) \
|
|---|
| 499 | !endif
|
|---|
| 500 |
|
|---|
| 501 | # Compiling C++ source.
|
|---|
| 502 | .cpp{$(PATH_TARGET)}.$(EXT_OBJ):
|
|---|
| 503 | @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST)
|
|---|
| 504 | \
|
|---|
| 505 | !ifndef BUILD_VERBOSE
|
|---|
| 506 | @ \
|
|---|
| 507 | !endif
|
|---|
| 508 | $(TOOL_JOB_SUB) $(_CXX_BASELINE) \
|
|---|
| 509 | !if "$(CXX_LST_OUT)" != ""
|
|---|
| 510 | $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \
|
|---|
| 511 | !endif
|
|---|
| 512 | $(CXX_OBJ_OUT)$(_DST) $(_SRC)
|
|---|
| 513 |
|
|---|
| 514 | .cpp.$(EXT_OBJ):
|
|---|
| 515 | @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRRST)
|
|---|
| 516 | \
|
|---|
| 517 | !ifndef BUILD_VERBOSE
|
|---|
| 518 | @ \
|
|---|
| 519 | !endif
|
|---|
| 520 | $(_CXX_BASELINE) \
|
|---|
| 521 | !if "$(CXX_LST_OUT)" != ""
|
|---|
| 522 | $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \
|
|---|
| 523 | !endif
|
|---|
| 524 | $(CXX_OBJ_OUT)$(_DST) $(_SRC)
|
|---|
| 525 |
|
|---|
| 526 |
|
|---|
| 527 | # Pre-Compiling C++ source.
|
|---|
| 528 | .cpp.ii:
|
|---|
| 529 | @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRRST)
|
|---|
| 530 | \
|
|---|
| 531 | !ifndef BUILD_VERBOSE
|
|---|
| 532 | @ \
|
|---|
| 533 | !endif
|
|---|
| 534 | $(_CXX_BASELINE) \
|
|---|
| 535 | $(CXX_PC_2_STDOUT) $(_SRC) > $@
|
|---|
| 536 |
|
|---|
| 537 |
|
|---|
| 538 | # Compiler C++ source to assembly.
|
|---|
| 539 | !if "$(CXX_AS_2_FILE)" != ""
|
|---|
| 540 | .cpp.s:
|
|---|
| 541 | @$(ECHO) C++ To Assembly $(CLRFIL)$(_SRC) $(CLRRST)
|
|---|
| 542 | \
|
|---|
| 543 | !ifndef BUILD_VERBOSE
|
|---|
| 544 | @ \
|
|---|
| 545 | !endif
|
|---|
| 546 | $(_CXX_BASELINE) \
|
|---|
| 547 | $(CXX_AS_2_FILE)$@ $(_SRC)
|
|---|
| 548 | !endif
|
|---|
| 549 |
|
|---|
| 550 |
|
|---|
| 551 |
|
|---|
| 552 | # C Compiler base line
|
|---|
| 553 | _CC_BASELINE = $(CC) \
|
|---|
| 554 | !if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB"
|
|---|
| 555 | $(CC_FLAGS_EXE) \
|
|---|
| 556 | !endif
|
|---|
| 557 | !if "$(TARGET_MODE)" == "DLL"
|
|---|
| 558 | $(CC_FLAGS_DLL) \
|
|---|
| 559 | !endif
|
|---|
| 560 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
|
|---|
| 561 | $(CC_FLAGS_SYS) \
|
|---|
| 562 | !endif
|
|---|
| 563 | !if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
|
|---|
| 564 | $(CC_FLAGS_IFS) \
|
|---|
| 565 | !endif
|
|---|
| 566 |
|
|---|
| 567 | # Compiling C source.
|
|---|
| 568 | .c{$(PATH_TARGET)}.$(EXT_OBJ):
|
|---|
| 569 | @$(ECHO) C Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST)
|
|---|
| 570 | \
|
|---|
| 571 | !ifndef BUILD_VERBOSE
|
|---|
| 572 | @ \
|
|---|
| 573 | !endif
|
|---|
| 574 | $(TOOL_JOB_SUB) $(_CC_BASELINE) \
|
|---|
| 575 | !if "$(CC_LST_OUT)" != ""
|
|---|
| 576 | $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \
|
|---|
| 577 | !endif
|
|---|
| 578 | $(CC_OBJ_OUT)$(_DST) $(_SRC)
|
|---|
| 579 |
|
|---|
| 580 | .c.$(EXT_OBJ):
|
|---|
| 581 | @$(ECHO) C Compiler $(CLRFIL)$(_SRC) $(CLRRST)
|
|---|
| 582 | \
|
|---|
| 583 | !ifndef BUILD_VERBOSE
|
|---|
| 584 | @ \
|
|---|
| 585 | !endif
|
|---|
| 586 | $(_CC_BASELINE) \
|
|---|
| 587 | !if "$(CC_LST_OUT)" != ""
|
|---|
| 588 | $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \
|
|---|
| 589 | !endif
|
|---|
| 590 | $(CC_OBJ_OUT)$(_DST) $(_SRC)
|
|---|
| 591 |
|
|---|
| 592 |
|
|---|
| 593 | # Pre-Compiling C source.
|
|---|
| 594 | .c.ii:
|
|---|
| 595 | @$(ECHO) C PreCompiler $(CLRFIL)$(_SRC) $(CLRRST)
|
|---|
| 596 | \
|
|---|
| 597 | !ifndef BUILD_VERBOSE
|
|---|
| 598 | @ \
|
|---|
| 599 | !endif
|
|---|
| 600 | $(_CC_BASELINE) \
|
|---|
| 601 | $(CC_PC_2_STDOUT) $(_SRC) > $@
|
|---|
| 602 |
|
|---|
| 603 |
|
|---|
| 604 | # Compiler C source to assembly.
|
|---|
| 605 | !if "$(CC_AS_2_FILE)" != ""
|
|---|
| 606 | .c.s:
|
|---|
| 607 | @$(ECHO) C To Assembly $(CLRFIL)$(_SRC) $(CLRRST)
|
|---|
| 608 | \
|
|---|
| 609 | !ifndef BUILD_VERBOSE
|
|---|
| 610 | @ \
|
|---|
| 611 | !endif
|
|---|
| 612 | $(_CC_BASELINE) \
|
|---|
| 613 | $(CC_AS_2_FILE)$@ $(_SRC)
|
|---|
| 614 | !endif
|
|---|
| 615 |
|
|---|
| 616 |
|
|---|
| 617 | # Compiling resources.
|
|---|
| 618 | .rc{$(PATH_TARGET)}.res:
|
|---|
| 619 | @$(ECHO) RC Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG)$(CLRRST)
|
|---|
| 620 | \
|
|---|
| 621 | !ifndef BUILD_VERBOSE
|
|---|
| 622 | @ \
|
|---|
| 623 | !endif
|
|---|
| 624 | $(TOOL_JOB_SUB) $(RC) $(RC_FLAGS) $(_SRC) $(_DST)
|
|---|
| 625 |
|
|---|
| 626 | .rc.res:
|
|---|
| 627 | @$(ECHO) RC Compiler $(CLRFIL)$(_SRC) $(CLRRST)
|
|---|
| 628 | \
|
|---|
| 629 | !ifndef BUILD_VERBOSE
|
|---|
| 630 | @ \
|
|---|
| 631 | !endif
|
|---|
| 632 | $(RC) $(RC_FLAGS) $(_SRC) $(_DST)
|
|---|
| 633 |
|
|---|
| 634 |
|
|---|
| 635 | # Compiling Odin32 resources.
|
|---|
| 636 | .orc{$(PATH_TARGET)}.obj:
|
|---|
| 637 | @$(ECHO) ORC Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG)$(CLRRST)
|
|---|
| 638 | \
|
|---|
| 639 | !ifndef BUILD_VERBOSE
|
|---|
| 640 | @ \
|
|---|
| 641 | !endif
|
|---|
| 642 | $(ORC) $(ORC_FLAGS) $(ORC_ASM_OUT)$(PATH_TARGET)\$(@B).asm $(_SRC)
|
|---|
| 643 | \
|
|---|
| 644 | !ifndef BUILD_VERBOSE
|
|---|
| 645 | @ \
|
|---|
| 646 | !endif
|
|---|
| 647 | $(AS) $(AS_FLAGS) $(PATH_TARGET)\$(@B).asm $(AS_OBJ_OUT)$(_DST)
|
|---|
| 648 |
|
|---|
| 649 | .orc.obj:
|
|---|
| 650 | @$(ECHO) ORC Compiler $(CLRFIL)$(_SRC) $(CLRRST)
|
|---|
| 651 | \
|
|---|
| 652 | !ifndef BUILD_VERBOSE
|
|---|
| 653 | @ \
|
|---|
| 654 | !endif
|
|---|
| 655 | $(ORC) $(ORC_FLAGS) $(ORC_ASM_OUT)$(PATH_TARGET)\$(@B).asm $(_SRC)
|
|---|
| 656 | \
|
|---|
| 657 | !ifndef BUILD_VERBOSE
|
|---|
| 658 | @ \
|
|---|
| 659 | !endif
|
|---|
| 660 | $(AS) $(AS_FLAGS) $(PATH_TARGET)\$(@B).asm $(AS_OBJ_OUT)$(_DST)
|
|---|
| 661 |
|
|---|
| 662 |
|
|---|
| 663 |
|
|---|
| 664 |
|
|---|
| 665 |
|
|---|
| 666 | # -----------------------------------------------------------------------------
|
|---|
| 667 | # The all rule - The default one, as it's the first rule in the file.
|
|---|
| 668 | # -----------------------------------------------------------------------------
|
|---|
| 669 | all: build
|
|---|
| 670 |
|
|---|
| 671 |
|
|---|
| 672 |
|
|---|
| 673 | # -----------------------------------------------------------------------------
|
|---|
| 674 | # The build rule - This runs all passes:
|
|---|
| 675 | # 1. Make Dependencies
|
|---|
| 676 | # 2. Make Needed Tools (stuff required in the next steps)
|
|---|
| 677 | # 3. Make Libraries (all kinds)
|
|---|
| 678 | # 4. Make Executables
|
|---|
| 679 | # 5. Make Miscellaneous Targets
|
|---|
| 680 | # 6. Make Install
|
|---|
| 681 | # Note: In order to load dependencies we'll do a forwarding after making them.
|
|---|
| 682 | # -----------------------------------------------------------------------------
|
|---|
| 683 | build: _build
|
|---|
| 684 | !if "$(MAKEFLAGS:I=_)" == "$(MAKEFLAGS)" # this is of course broken in nmake v5.0 for OS/2.
|
|---|
| 685 | @$(ECHO)$(CLRMAK)[Successfully Built Everything!] $(CLRRST)
|
|---|
| 686 | !else
|
|---|
| 687 | @$(ECHO)$(CLRMAK)[Built Everything! (Ignore option specified)] $(CLRRST)
|
|---|
| 688 | !endif
|
|---|
| 689 |
|
|---|
| 690 | # internal rule shared by rebuild and build.
|
|---|
| 691 | _build: _build_banner_dep dep
|
|---|
| 692 | !ifndef BUILD_QUIET
|
|---|
| 693 | @$(ECHO) Restarting $(CLRFIL)$(MAKEFILE)$(CLRTXT) with new dependencies. $(CLRRST)
|
|---|
| 694 | !endif
|
|---|
| 695 | \
|
|---|
| 696 | !ifndef BUILD_VERBOSE
|
|---|
| 697 | @ \
|
|---|
| 698 | !endif
|
|---|
| 699 | $(TOOL_MAKE) -f $(MAKEFILE) _build_new_dependencies_
|
|---|
| 700 |
|
|---|
| 701 | # internal rule used to reload dependencies.
|
|---|
| 702 | _build_new_dependencies_: \
|
|---|
| 703 | _build_banner_needed needed \
|
|---|
| 704 | _build_banner_lib lib \
|
|---|
| 705 | _build_banner_executable executable \
|
|---|
| 706 | _build_banner_miscellaneous miscellaneous \
|
|---|
| 707 | _build_banner_publish publish
|
|---|
| 708 |
|
|---|
| 709 |
|
|---|
| 710 | # Banners for rebuild and build.
|
|---|
| 711 | _build_banner_clean:
|
|---|
| 712 | @$(ECHO)$(CLRMAK)[Start Pass 0 - Make Clean] $(CLRRST)
|
|---|
| 713 | @SET _BUILD_PASS=0
|
|---|
| 714 | _build_banner_dep:
|
|---|
| 715 | @$(ECHO)$(CLRMAK)[Start Pass 1 - Make Dependencies] $(CLRRST)
|
|---|
| 716 | @SET _BUILD_PASS=1
|
|---|
| 717 | _build_banner_needed:
|
|---|
| 718 | @$(ECHO)$(CLRMAK)[Start Pass 2 - Make Needed Tools] $(CLRRST)
|
|---|
| 719 | @SET _BUILD_PASS=2
|
|---|
| 720 | _build_banner_lib:
|
|---|
| 721 | @$(ECHO)$(CLRMAK)[Start Pass 3 - Make Libraries] $(CLRRST)
|
|---|
| 722 | @SET _BUILD_PASS=3
|
|---|
| 723 | _build_banner_executable:
|
|---|
| 724 | @$(ECHO)$(CLRMAK)[Start Pass 4 - Make Executables] $(CLRRST)
|
|---|
| 725 | @SET _BUILD_PASS=4
|
|---|
| 726 | _build_banner_miscellaneous:
|
|---|
| 727 | @$(ECHO)$(CLRMAK)[Start Pass 5 - Make Miscellaneous Targets] $(CLRRST)
|
|---|
| 728 | @SET _BUILD_PASS=5
|
|---|
| 729 | _build_banner_publish:
|
|---|
| 730 | @$(ECHO)$(CLRMAK)[Start Pass 6 - Make Public (i.e. Publish)] $(CLRRST)
|
|---|
| 731 | @SET _BUILD_PASS=6
|
|---|
| 732 |
|
|---|
| 733 |
|
|---|
| 734 |
|
|---|
| 735 | # -----------------------------------------------------------------------------
|
|---|
| 736 | # The rebuild rule - Same as build but does a clean first (as Pass 0).
|
|---|
| 737 | # -----------------------------------------------------------------------------
|
|---|
| 738 | rebuild: \
|
|---|
| 739 | _build_banner_clean clean \
|
|---|
| 740 | _build
|
|---|
| 741 | !if "$(MAKEFLAGS:i=_)" == "$(MAKEFLAGS)"
|
|---|
| 742 | @$(ECHO)$(CLRMAK)[Successfully Rebuilt Everything!] $(CLRRST)
|
|---|
| 743 | !else
|
|---|
| 744 | @$(ECHO)$(CLRMAK)[Rebuilt Everything! (Ignore option specified)] $(CLRRST)
|
|---|
| 745 | !endif
|
|---|
| 746 |
|
|---|
| 747 |
|
|---|
| 748 |
|
|---|
| 749 | # -----------------------------------------------------------------------------
|
|---|
| 750 | # A number of shortcuts for lazy programmers.
|
|---|
| 751 | # -----------------------------------------------------------------------------
|
|---|
| 752 | pass1: build
|
|---|
| 753 |
|
|---|
| 754 | pass2: _build_new_dependencies_
|
|---|
| 755 |
|
|---|
| 756 | pass3: _build_banner_lib lib \
|
|---|
| 757 | _build_banner_executable executable \
|
|---|
| 758 | _build_banner_miscellaneous miscellaneous \
|
|---|
| 759 | _build_banner_publish publish
|
|---|
| 760 |
|
|---|
| 761 | pass4: _build_banner_executable executable \
|
|---|
| 762 | _build_banner_miscellaneous miscellaneous \
|
|---|
| 763 | _build_banner_publish publish
|
|---|
| 764 |
|
|---|
| 765 | pass5: _build_banner_miscellaneous miscellaneous \
|
|---|
| 766 | _build_banner_publish publish
|
|---|
| 767 |
|
|---|
| 768 | pass6: _build_banner_publish publish
|
|---|
| 769 |
|
|---|
| 770 | quick: _build_banner_lib lib \
|
|---|
| 771 | _build_banner_executable executable \
|
|---|
| 772 | _build_banner_publish publish
|
|---|
| 773 |
|
|---|
| 774 |
|
|---|
| 775 |
|
|---|
| 776 | # -----------------------------------------------------------------------------
|
|---|
| 777 | # Pass 0 - The clean rule - Clean up output files.
|
|---|
| 778 | # The current setup doesn't clean the published ones.
|
|---|
| 779 | # -----------------------------------------------------------------------------
|
|---|
| 780 | !if "$(TARGET_MODE)" != "TESTCASE"
|
|---|
| 781 | clean:
|
|---|
| 782 | @$(ECHO) Cleaning... $(CLRRST)
|
|---|
| 783 | \
|
|---|
| 784 | ! ifndef BUILD_VERBOSE
|
|---|
| 785 | @ \
|
|---|
| 786 | ! endif
|
|---|
| 787 | $(TOOL_RM) @<<
|
|---|
| 788 | "$(PATH_TARGET)\*.$(EXT_OBJ)"
|
|---|
| 789 | "$(PATH_TARGET)\*.$(EXT_ILIB)"
|
|---|
| 790 | "$(PATH_TARGET)\*.$(EXT_EXE)"
|
|---|
| 791 | "$(PATH_TARGET)\*.$(EXT_DLL)"
|
|---|
| 792 | "$(PATH_TARGET)\*.$(EXT_RES)"
|
|---|
| 793 | "$(PATH_TARGET)\*.$(EXT_SYS)"
|
|---|
| 794 | "$(PATH_TARGET)\*.$(EXT_LIB)"
|
|---|
| 795 | "$(PATH_TARGET)\*.$(EXT_IFS)"
|
|---|
| 796 | "$(PATH_TARGET)\*.$(EXT_MAP)"
|
|---|
| 797 | "$(PATH_TARGET)\*.$(EXT_SYM)"
|
|---|
| 798 | "$(PATH_TARGET)\*.$(EXT_DEF)"
|
|---|
| 799 | "$(PATH_TARGET)\*.s"
|
|---|
| 800 | "$(PATH_TARGET)\*.lst"
|
|---|
| 801 | "$(PATH_TARGET)\*.lnk"
|
|---|
| 802 | "$(PATH_TARGET)\*.ii"
|
|---|
| 803 | "$(PATH_TARGET)\.depend"
|
|---|
| 804 | "$(TARGET_DEPEND)"
|
|---|
| 805 | .\*.ii
|
|---|
| 806 | .\*.err
|
|---|
| 807 | .\.depend
|
|---|
| 808 | <<
|
|---|
| 809 | !ifdef SUBDIRS_CLEAN
|
|---|
| 810 | @$(TOOL_DODIRS) "$(SUBDIRS_CLEAN)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@
|
|---|
| 811 | !else
|
|---|
| 812 | ! if "$(SUBDIRS)$(SUBDIRS_NEEDED)$(SUBDIRS_LIB)$(SUBDIRS_EXECUTABLES)$(SUBDIRS_MISC)" != ""
|
|---|
| 813 | @$(TOOL_DODIRS) "$(SUBDIRS) $(SUBDIRS_NEEDED) $(SUBDIRS_LIB) $(SUBDIRS_EXECUTABLES) $(SUBDIRS_MISC)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@
|
|---|
| 814 | ! endif
|
|---|
| 815 | !endif
|
|---|
| 816 | !ifdef PREMAKEFILES_CLEAN
|
|---|
| 817 | @$(TOOL_DOMAKES) "$(PREMAKEFILES_CLEAN)" $(TOOL_MAKE) NODEP=1 $@
|
|---|
| 818 | !else
|
|---|
| 819 | ! if "$(PREMAKEFILES)$(PREMAKEFILES_NEEDED)$(PREMAKEFILES_LIB)$(PREMAKEFILES_EXECUTABLES)$(PREMAKEFILES_MISC)" != ""
|
|---|
| 820 | @$(TOOL_DOMAKES) "$(PREMAKEFILES) $(PREMAKEFILES_NEEDED) $(PREMAKEFILES_LIB) $(PREMAKEFILES_EXECUTABLES) $(PREMAKEFILES_MISC)" $(TOOL_MAKE) NODEP=1 $@
|
|---|
| 821 | ! endif
|
|---|
| 822 | !endif
|
|---|
| 823 | !ifdef POSTMAKEFILES_CLEAN
|
|---|
| 824 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES_CLEAN)" $(TOOL_MAKE) NODEP=1 $@
|
|---|
| 825 | !else
|
|---|
| 826 | ! if "$(POSTMAKEFILES)$(POSTMAKEFILES_NEEDED)$(POSTMAKEFILES_LIB)$(POSTMAKEFILES_EXECUTABLES)$(POSTMAKEFILES_MISC)" != ""
|
|---|
| 827 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES) $(POSTMAKEFILES_NEEDED) $(POSTMAKEFILES_LIB) $(POSTMAKEFILES_EXECUTABLES) $(POSTMAKEFILES_MISC)" $(TOOL_MAKE) NODEP=1 $@
|
|---|
| 828 | ! endif
|
|---|
| 829 | !endif
|
|---|
| 830 |
|
|---|
| 831 | !endif #!TESTCASE
|
|---|
| 832 |
|
|---|
| 833 |
|
|---|
| 834 |
|
|---|
| 835 | # -----------------------------------------------------------------------------
|
|---|
| 836 | # Pass 1 - The dep rule - Make dependencies.
|
|---|
| 837 | # -----------------------------------------------------------------------------
|
|---|
| 838 | dep:
|
|---|
| 839 | !if "$(TARGET_MODE)" != "EMPTY" && "$(TARGET_MODE)" != "TESTCASE"
|
|---|
| 840 | @$(ECHO) Making dependencies... $(CLRRST)
|
|---|
| 841 | \
|
|---|
| 842 | ! ifndef BUILD_VERBOSE
|
|---|
| 843 | @ \
|
|---|
| 844 | ! endif
|
|---|
| 845 | $(TOOL_DEP) \
|
|---|
| 846 | ! ifdef TARGET_NO_DEP
|
|---|
| 847 | -x$(TARGET_NO_DEP: =;)\
|
|---|
| 848 | ! endif
|
|---|
| 849 | @<<
|
|---|
| 850 | $(TOOL_DEP_FLAGS)
|
|---|
| 851 | -o$$(PATH_TARGET)
|
|---|
| 852 | -d$(TARGET_DEPEND)
|
|---|
| 853 | -srcadd AS:$$(MAKE_INCLUDE_AS_SETUP)
|
|---|
| 854 | -srcadd AS:$$(MAKE_INCLUDE_AS_OPT)
|
|---|
| 855 | -srcadd RC:$$(MAKE_INCLUDE_RC_SETUP)
|
|---|
| 856 | -srcadd ORC:$$(MAKE_INCLUDE_ORC_SETUP)
|
|---|
| 857 | -srcadd CX:$$(MAKE_INCLUDE_SETUP)
|
|---|
| 858 | -srcadd CX:$$(MAKE_INCLUDE_CX_OPT)
|
|---|
| 859 | $(TOOL_DEP_FILES)
|
|---|
| 860 | <<
|
|---|
| 861 | !endif
|
|---|
| 862 | !ifdef SUBDIRS_DEP
|
|---|
| 863 | @$(TOOL_DODIRS) "$(SUBDIRS_DEP)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@
|
|---|
| 864 | !else
|
|---|
| 865 | ! if "$(SUBDIRS)$(SUBDIRS_NEEDED)$(SUBDIRS_LIB)$(SUBDIRS_EXECUTABLES)$(SUBDIRS_MISC)" != ""
|
|---|
| 866 | @$(TOOL_DODIRS) "$(SUBDIRS) $(SUBDIRS_NEEDED) $(SUBDIRS_LIB) $(SUBDIRS_EXECUTABLES) $(SUBDIRS_MISC)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@
|
|---|
| 867 | ! endif
|
|---|
| 868 | !endif
|
|---|
| 869 | !ifdef PREMAKEFILES_DEP
|
|---|
| 870 | @$(TOOL_DOMAKES) "$(PREMAKEFILES_DEP)" $(TOOL_MAKE) NODEP=1 $@
|
|---|
| 871 | !else
|
|---|
| 872 | ! if "$(PREMAKEFILES)$(PREMAKEFILES_NEEDED)$(PREMAKEFILES_LIB)$(PREMAKEFILES_EXECUTABLES)$(PREMAKEFILES_MISC)" != ""
|
|---|
| 873 | @$(TOOL_DOMAKES) "$(PREMAKEFILES) $(PREMAKEFILES_NEEDED) $(PREMAKEFILES_LIB) $(PREMAKEFILES_EXECUTABLES) $(PREMAKEFILES_MISC)" $(TOOL_MAKE) NODEP=1 $@
|
|---|
| 874 | ! endif
|
|---|
| 875 | !endif
|
|---|
| 876 | !ifdef POSTMAKEFILES_DEP
|
|---|
| 877 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES_DEP)" $(TOOL_MAKE) NODEP=1 $@
|
|---|
| 878 | !else
|
|---|
| 879 | ! if "$(POSTMAKEFILES)$(POSTMAKEFILES_NEEDED)$(POSTMAKEFILES_LIB)$(POSTMAKEFILES_EXECUTABLES)$(POSTMAKEFILES_MISC)" != ""
|
|---|
| 880 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES) $(POSTMAKEFILES_NEEDED) $(POSTMAKEFILES_LIB) $(POSTMAKEFILES_EXECUTABLES) $(POSTMAKEFILES_MISC)" $(TOOL_MAKE) NODEP=1 $@
|
|---|
| 881 | ! endif
|
|---|
| 882 | !endif
|
|---|
| 883 |
|
|---|
| 884 |
|
|---|
| 885 |
|
|---|
| 886 | # -----------------------------------------------------------------------------
|
|---|
| 887 | # Pass 2 - The needed rule - Make need tools.
|
|---|
| 888 | # That is tools and stuff that is required for the next passes.
|
|---|
| 889 | # WARNING! These tools and stuff shouldn't rely on libraries and other
|
|---|
| 890 | # results of later passes.
|
|---|
| 891 | # -----------------------------------------------------------------------------
|
|---|
| 892 | !ifdef SUBDIRS_NEEDED
|
|---|
| 893 | _SUBDIRS_NEEDED = _subdir_needed
|
|---|
| 894 | $(_SUBDIRS_NEEDED):
|
|---|
| 895 | @$(TOOL_DODIRS) "$(SUBDIRS_NEEDED)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) needed
|
|---|
| 896 | !else
|
|---|
| 897 | ! ifdef SUBDIRS
|
|---|
| 898 | _SUBDIRS_NEEDED = _subdir_needed
|
|---|
| 899 | $(_SUBDIRS_NEEDED):
|
|---|
| 900 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) needed
|
|---|
| 901 | ! endif
|
|---|
| 902 | !endif
|
|---|
| 903 |
|
|---|
| 904 | !ifdef PREMAKEFILES_NEEDED
|
|---|
| 905 | _PREMAKEFILES_NEEDED = _premakefiles_needed
|
|---|
| 906 | $(_PREMAKEFILES_NEEDED):
|
|---|
| 907 | @$(TOOL_DOMAKES) "$(PREMAKEFILES_NEEDED)" $(TOOL_MAKE) needed
|
|---|
| 908 | !else
|
|---|
| 909 | ! ifdef PREMAKEFILES
|
|---|
| 910 | _PREMAKEFILES_NEEDED = _premakefiles_needed
|
|---|
| 911 | $(_PREMAKEFILES_NEEDED):
|
|---|
| 912 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) needed
|
|---|
| 913 | ! endif
|
|---|
| 914 | !endif
|
|---|
| 915 |
|
|---|
| 916 | !ifdef TARGET_NEEDED
|
|---|
| 917 | needed: $(_SUBDIRS_NEEDED) $(_PREMAKEFILES_NEEDED) target
|
|---|
| 918 | !else
|
|---|
| 919 | needed: $(_SUBDIRS_NEEDED) $(_PREMAKEFILES_NEEDED)
|
|---|
| 920 | !endif
|
|---|
| 921 | !ifdef POSTMAKEFILES_NEEDED
|
|---|
| 922 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES_NEEDED)" $(TOOL_MAKE) $@
|
|---|
| 923 | !else
|
|---|
| 924 | ! ifdef POSTMAKEFILES
|
|---|
| 925 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
|
|---|
| 926 | ! endif
|
|---|
| 927 | !endif
|
|---|
| 928 |
|
|---|
| 929 |
|
|---|
| 930 |
|
|---|
| 931 | # -----------------------------------------------------------------------------
|
|---|
| 932 | # Pass 3 - The lib rule - Make libraries.
|
|---|
| 933 | # -----------------------------------------------------------------------------
|
|---|
| 934 | !ifdef SUBDIRS_LIB
|
|---|
| 935 | _SUBDIRS_LIB = _subdir_lib
|
|---|
| 936 | $(_SUBDIRS_LIB):
|
|---|
| 937 | @$(TOOL_DODIRS) "$(SUBDIRS_LIB)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) lib
|
|---|
| 938 | !else
|
|---|
| 939 | ! ifdef SUBDIRS
|
|---|
| 940 | _SUBDIRS_LIB = _subdir_lib
|
|---|
| 941 | $(_SUBDIRS_LIB):
|
|---|
| 942 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) lib
|
|---|
| 943 | ! endif
|
|---|
| 944 | !endif
|
|---|
| 945 |
|
|---|
| 946 | !ifdef PREMAKEFILES_LIB
|
|---|
| 947 | _PREMAKEFILES_LIB = _premakefiles_lib
|
|---|
| 948 | $(_PREMAKEFILES_LIB):
|
|---|
| 949 | @$(TOOL_DOMAKES) "$(PREMAKEFILES_LIB)" $(TOOL_MAKE) lib
|
|---|
| 950 | !else
|
|---|
| 951 | ! ifdef PREMAKEFILES
|
|---|
| 952 | _PREMAKEFILES_LIB = _premakefiles_lib
|
|---|
| 953 | $(_PREMAKEFILES_LIB):
|
|---|
| 954 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) lib
|
|---|
| 955 | ! endif
|
|---|
| 956 | !endif
|
|---|
| 957 |
|
|---|
| 958 | lib: $(_SUBDIRS_LIB) $(_PREMAKEFILES_LIB) \
|
|---|
| 959 | !if !defined(TARGET_NEEDED) && ("$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB")
|
|---|
| 960 | $(TARGET) $(_TARGET_EARLY_PUBLISH) \
|
|---|
| 961 | !endif
|
|---|
| 962 | $(TARGET_ILIB)
|
|---|
| 963 | !ifdef POSTMAKEFILES_LIB
|
|---|
| 964 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES_LIB)" $(TOOL_MAKE) $@
|
|---|
| 965 | !else
|
|---|
| 966 | ! ifdef POSTMAKEFILES
|
|---|
| 967 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
|
|---|
| 968 | ! endif
|
|---|
| 969 | !endif
|
|---|
| 970 |
|
|---|
| 971 |
|
|---|
| 972 |
|
|---|
| 973 | # -----------------------------------------------------------------------------
|
|---|
| 974 | # Pass 4 - The executable rule - Build the executables.
|
|---|
| 975 | # -----------------------------------------------------------------------------
|
|---|
| 976 | !ifdef SUBDIRS_EXECUTABLE
|
|---|
| 977 | _SUBDIRS_EXECUTABLE = _subdir_executable
|
|---|
| 978 | $(_SUBDIRS_EXECUTABLE):
|
|---|
| 979 | @$(TOOL_DODIRS) "$(SUBDIRS_EXECUTABLE)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) executable
|
|---|
| 980 | !else
|
|---|
| 981 | ! ifdef SUBDIRS
|
|---|
| 982 | _SUBDIRS_EXECUTABLE = _subdir_executable
|
|---|
| 983 | $(_SUBDIRS_EXECUTABLE):
|
|---|
| 984 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) executable
|
|---|
| 985 | ! endif
|
|---|
| 986 | !endif
|
|---|
| 987 |
|
|---|
| 988 | !ifdef PREMAKEFILES_EXECUTABLE
|
|---|
| 989 | _PREMAKEFILES_EXECUTABLE = _premakefiles_executable
|
|---|
| 990 | $(_PREMAKEFILES_EXECUTABLE):
|
|---|
| 991 | @$(TOOL_DOMAKES) "$(PREMAKEFILES_EXECUTABLE)" $(TOOL_MAKE) executable
|
|---|
| 992 | !else
|
|---|
| 993 | ! ifdef PREMAKEFILES
|
|---|
| 994 | _PREMAKEFILES_EXECUTABLE = _premakefiles_executable
|
|---|
| 995 | $(_PREMAKEFILES_EXECUTABLE):
|
|---|
| 996 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) executable
|
|---|
| 997 | ! endif
|
|---|
| 998 | !endif
|
|---|
| 999 |
|
|---|
| 1000 | executable: \
|
|---|
| 1001 | !if "$(TARGET_MODE)" != "LIB" && "$(TARGET_MODE)" != "SYSLIB" && "$(TARGET_MODE)" != "IFSLIB" && !defined(TARGET_NEEDED)
|
|---|
| 1002 | $(_SUBDIRS_EXECUTABLE) $(_PREMAKEFILES_EXECUTABLE) $(TARGET) $(_TARGET_EARLY_PUBLISH)
|
|---|
| 1003 | !else
|
|---|
| 1004 | $(_SUBDIRS_EXECUTABLE) $(_PREMAKEFILES_EXECUTABLE)
|
|---|
| 1005 | !endif
|
|---|
| 1006 | !ifdef POSTMAKEFILES_EXECUTABLE
|
|---|
| 1007 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES_EXECUTABLE)" $(TOOL_MAKE) $@
|
|---|
| 1008 | !else
|
|---|
| 1009 | ! ifdef POSTMAKEFILES
|
|---|
| 1010 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
|
|---|
| 1011 | ! endif
|
|---|
| 1012 | !endif
|
|---|
| 1013 |
|
|---|
| 1014 |
|
|---|
| 1015 |
|
|---|
| 1016 | # -----------------------------------------------------------------------------
|
|---|
| 1017 | # Pass 5 - The miscellaneous rule - Makes other miscellaneous stuff like
|
|---|
| 1018 | # documentations etc. This is experimental for the moment.
|
|---|
| 1019 | # -----------------------------------------------------------------------------
|
|---|
| 1020 | !ifdef SUBDIRS_MISC
|
|---|
| 1021 | _SUBDIRS_MISC = _subdir_misc
|
|---|
| 1022 | $(_SUBDIRS_MISC):
|
|---|
| 1023 | @$(TOOL_DODIRS) "$(SUBDIRS_MISC)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) miscellaneous
|
|---|
| 1024 | !else
|
|---|
| 1025 | ! ifdef SUBDIRS
|
|---|
| 1026 | _SUBDIRS_MISC = _subdir_misc
|
|---|
| 1027 | $(_SUBDIRS_MISC):
|
|---|
| 1028 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) miscellaneous
|
|---|
| 1029 | ! endif
|
|---|
| 1030 | !endif
|
|---|
| 1031 |
|
|---|
| 1032 | !ifdef PREMAKEFILES_MISC
|
|---|
| 1033 | _PREMAKEFILES_MISC = _premakefiles_misc
|
|---|
| 1034 | $(PREMAKEFILES_MISC):
|
|---|
| 1035 | @$(TOOL_DOMAKES) "$(PREMAKEFILES_MISC)" $(TOOL_MAKE) miscellaneous
|
|---|
| 1036 | !else
|
|---|
| 1037 | ! ifdef PREMAKEFILES
|
|---|
| 1038 | _PREMAKEFILES_MISC = _premakefiles_misc
|
|---|
| 1039 | $(_PREMAKEFILES_MISC):
|
|---|
| 1040 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) miscellaneous
|
|---|
| 1041 | ! endif
|
|---|
| 1042 | !endif
|
|---|
| 1043 |
|
|---|
| 1044 | miscellaneous: $(_SUBDIRS_MISC) $(_PREMAKEFILES_MISC) \
|
|---|
| 1045 | $(TARGET_DOCS) $(TARGET_MISC)
|
|---|
| 1046 | !if "$(TARGET_DOCS)$(TARGET_MISC)" != ""
|
|---|
| 1047 | @$(ECHO) Successfully Built $(CLRFIL)$(TARGET_DOCS) $(TARGET_MISC)$(CLRRST)
|
|---|
| 1048 | !endif
|
|---|
| 1049 | !ifdef POSTMAKEFILES_MISC
|
|---|
| 1050 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES_MISC)" $(TOOL_MAKE) $@
|
|---|
| 1051 | !else
|
|---|
| 1052 | ! ifdef POSTMAKEFILES
|
|---|
| 1053 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
|
|---|
| 1054 | ! endif
|
|---|
| 1055 | !endif
|
|---|
| 1056 |
|
|---|
| 1057 |
|
|---|
| 1058 |
|
|---|
| 1059 | # -----------------------------------------------------------------------------
|
|---|
| 1060 | # Pass 6 - The publish rule - Copies target to main binary directory.
|
|---|
| 1061 | # Installation order is not concidered vital, so subdirectories and
|
|---|
| 1062 | # pre-makefiles are processed after this directory.
|
|---|
| 1063 | # However, this order might be changed!
|
|---|
| 1064 | # -----------------------------------------------------------------------------
|
|---|
| 1065 | !if "$(_TARGET_EARLY_PUBLISH)" != ""
|
|---|
| 1066 | publish:
|
|---|
| 1067 | !else
|
|---|
| 1068 | publish: publish_target
|
|---|
| 1069 | !endif
|
|---|
| 1070 | !ifdef SUBDIRS_PUBLISH
|
|---|
| 1071 | @$(TOOL_DODIRS) "$(SUBDIRS_PUBLISH)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
|
|---|
| 1072 | !else
|
|---|
| 1073 | ! ifdef SUBDIRS
|
|---|
| 1074 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
|
|---|
| 1075 | ! endif
|
|---|
| 1076 | !endif
|
|---|
| 1077 | !ifdef PREMAKEFILES_PUBLISH
|
|---|
| 1078 | @$(TOOL_DOMAKES) "$(PREMAKEFILES_PUBLISH)" $(TOOL_MAKE) $@
|
|---|
| 1079 | !else
|
|---|
| 1080 | ! ifdef PREMAKEFILES
|
|---|
| 1081 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
|
|---|
| 1082 | ! endif
|
|---|
| 1083 | !endif
|
|---|
| 1084 | !ifdef POSTMAKEFILES_PUBLISH
|
|---|
| 1085 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES_PUBLISH)" $(TOOL_MAKE) $@
|
|---|
| 1086 | !else
|
|---|
| 1087 | ! ifdef POSTMAKEFILES
|
|---|
| 1088 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
|
|---|
| 1089 | ! endif
|
|---|
| 1090 | !endif
|
|---|
| 1091 |
|
|---|
| 1092 |
|
|---|
| 1093 | #
|
|---|
| 1094 | # Publish rule which doesn't go down into subdirs and submakes.
|
|---|
| 1095 | # This one is invoked when a target is 'needed' or early published.
|
|---|
| 1096 | #
|
|---|
| 1097 | publish_target:
|
|---|
| 1098 | !if "$(_TARGET_EARLY_PUBLISH)" != "" || "$(TARGET_MODE:LIB=cute)" == "$(TARGET_MODE)"
|
|---|
| 1099 | ! if "$(TARGET_MODE)" != "EMPTY" && "$(TARGET_MODE)" != "TESTCASE" && "$(TARGET_MODE)" != "DEPEND"
|
|---|
| 1100 | @$(ECHO) Publishing $(CLRFIL)$(TARGET)$(CLRTXT) to directory $(CLRFIL)$(TARGET_PUB_DIR)\$(TARGET_PUB_SUB)$(CLRRST)
|
|---|
| 1101 | @if not exist "$(TARGET)" $(TOOL_ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST)
|
|---|
| 1102 | @if not exist "$(TARGET_PUB_DIR)" $(TOOL_CREATEPATH) $(TARGET_PUB_DIR)
|
|---|
| 1103 | @if exist "$(TARGET)" $(TOOL_COPY) "$(TARGET)" "$(TARGET_PUB)"
|
|---|
| 1104 | @if exist "$(TARGET_SYM)" $(TOOL_COPY) "$(TARGET_SYM)" "$(TARGET_PUB_DIR)"
|
|---|
| 1105 | ! if "$(TARGET_PUB_DEB)" != ""
|
|---|
| 1106 | @$(ECHO) Publishing unstripped $(CLRFIL)$(TARGET)$(CLRTXT) to directory $(CLRFIL)$(TARGET_PUB_DIR_DEB)$(CLRRST)
|
|---|
| 1107 | @if not exist "$(_TARGET_DEB)" $(TOOL_ECHO) $(CLRERR)WARNING: $(CLRFIL)$(_TARGET)$(CLRERR) doesn't exist. $(CLRRST)
|
|---|
| 1108 | @if not exist "$(TARGET_PUB_DIR_DEB)" $(TOOL_CREATEPATH) $(TARGET_PUB_DIR_DEB)
|
|---|
| 1109 | @if exist "$(_TARGET_DEB)" $(TOOL_COPY) "$(_TARGET_DEB)" "$(TARGET_PUB_DEB)"
|
|---|
| 1110 | @if exist "$(TARGET_SYM)" $(TOOL_COPY) "$(TARGET_SYM)" "$(TARGET_PUB_DIR_DEB)"
|
|---|
| 1111 | ! endif
|
|---|
| 1112 | ! endif
|
|---|
| 1113 | !endif
|
|---|
| 1114 | !if "$(TARGET_DOCS)" != ""
|
|---|
| 1115 | $(TOOL_COPY) $(TARGET_DOCS) $(PATH_DOC)
|
|---|
| 1116 | !endif
|
|---|
| 1117 |
|
|---|
| 1118 |
|
|---|
| 1119 |
|
|---|
| 1120 | # -----------------------------------------------------------------------------
|
|---|
| 1121 | # Pass x - The testcase rule - Execute testcases when present.
|
|---|
| 1122 | # Testcases are either a testcase.mak file or a testcase subdirectory.
|
|---|
| 1123 | # -----------------------------------------------------------------------------
|
|---|
| 1124 | !if "$(TARGET_MODE)" != "TESTCASE"
|
|---|
| 1125 | !ifndef BUILD_OWN_TESTCASE_RULE
|
|---|
| 1126 |
|
|---|
| 1127 | !ifndef MAKEVER
|
|---|
| 1128 | _TESTCASE_TST1 = [$(TOOL_EXISTS) testcase] == 0
|
|---|
| 1129 | _TESTCASE_TST2 = [$(TOOL_EXISTS) testcase.mak] == 0
|
|---|
| 1130 | !else
|
|---|
| 1131 | _TESTCASE_TST1 = exists(testcase) != 0
|
|---|
| 1132 | _TESTCASE_TST2 = exists(testcase.mak) != 0
|
|---|
| 1133 | !endif
|
|---|
| 1134 |
|
|---|
| 1135 | testcase:
|
|---|
| 1136 | @$(ECHO) Executing testcases $(CLRRST)
|
|---|
| 1137 | !if $(_TESTCASE_TST1)
|
|---|
| 1138 | @$(TOOL_DODIRS) "testcase" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
|
|---|
| 1139 | !endif
|
|---|
| 1140 | !if $(_TESTCASE_TST2)
|
|---|
| 1141 | @$(TOOL_DOMAKES) "testcase.mak" $(TOOL_MAKE) $@
|
|---|
| 1142 | !endif
|
|---|
| 1143 | !ifdef SUBDIRS_TESTCASE
|
|---|
| 1144 | @$(TOOL_DODIRS) "$(SUBDIRS_TESTCASE)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
|
|---|
| 1145 | !else
|
|---|
| 1146 | ! ifdef SUBDIRS
|
|---|
| 1147 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
|
|---|
| 1148 | ! endif
|
|---|
| 1149 | !endif
|
|---|
| 1150 | !ifdef PREMAKEFILES_TESTCASE
|
|---|
| 1151 | @$(TOOL_DOMAKES) "$(PREMAKEFILES_TESTCASE)" $(TOOL_MAKE) $@
|
|---|
| 1152 | !else
|
|---|
| 1153 | ! ifdef PREMAKEFILES
|
|---|
| 1154 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
|
|---|
| 1155 | ! endif
|
|---|
| 1156 | !endif
|
|---|
| 1157 | !ifdef POSTMAKEFILES_TESTCASE
|
|---|
| 1158 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES_TESTCASE)" $(TOOL_MAKE) $@
|
|---|
| 1159 | !else
|
|---|
| 1160 | ! ifdef POSTMAKEFILES
|
|---|
| 1161 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
|
|---|
| 1162 | ! endif
|
|---|
| 1163 | !endif
|
|---|
| 1164 |
|
|---|
| 1165 | !endif # BUILD_OWN_TESTCASE_RULE
|
|---|
| 1166 | !endif #!TESTCASE
|
|---|
| 1167 |
|
|---|
| 1168 |
|
|---|
| 1169 | # -----------------------------------------------------------------------------
|
|---|
| 1170 | # Pass x - The packing rule - traverse subdirs etc.
|
|---|
| 1171 | # -----------------------------------------------------------------------------
|
|---|
| 1172 | !ifdef SUBDIRS_PACKING
|
|---|
| 1173 | _SUBDIRS_PACKING = _subdir_packing
|
|---|
| 1174 | $(_SUBDIRS_PACKING):
|
|---|
| 1175 | @$(TOOL_DODIRS) "$(SUBDIRS_PACKING)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) packing
|
|---|
| 1176 | !else
|
|---|
| 1177 | ! ifdef SUBDIRS
|
|---|
| 1178 | _SUBDIRS_PACKING = _subdir_packing
|
|---|
| 1179 | $(_SUBDIRS_PACKING):
|
|---|
| 1180 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) packing
|
|---|
| 1181 | ! endif
|
|---|
| 1182 | !endif
|
|---|
| 1183 |
|
|---|
| 1184 | !ifdef PREMAKEFILES_PACKING
|
|---|
| 1185 | _PREMAKEFILES_PACKING = _premakefiles_packing
|
|---|
| 1186 | $(PREMAKEFILES_PACKING):
|
|---|
| 1187 | @$(TOOL_DOMAKES) "$(PREMAKEFILES_PACKING)" $(TOOL_MAKE) packing
|
|---|
| 1188 | !else
|
|---|
| 1189 | ! ifdef PREMAKEFILES
|
|---|
| 1190 | _PREMAKEFILES_PACKING = _premakefiles_packing
|
|---|
| 1191 | $(_PREMAKEFILES_PACKING):
|
|---|
| 1192 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) packing
|
|---|
| 1193 | ! endif
|
|---|
| 1194 | !endif
|
|---|
| 1195 |
|
|---|
| 1196 | !if "$(RULE_PACKING)" == "packing"
|
|---|
| 1197 | _packing: \
|
|---|
| 1198 | !else
|
|---|
| 1199 | packing: \
|
|---|
| 1200 | !endif
|
|---|
| 1201 | $(_SUBDIRS_PACKING) $(_PREMAKEFILES_PACKING) $(RULE_PACKING)
|
|---|
| 1202 | !ifdef POSTMAKEFILES_PACKING
|
|---|
| 1203 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES_PACKING)" $(TOOL_MAKE) $@
|
|---|
| 1204 | !else
|
|---|
| 1205 | ! ifdef POSTMAKEFILES
|
|---|
| 1206 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
|
|---|
| 1207 | ! endif
|
|---|
| 1208 | !endif
|
|---|
| 1209 | $(ECHO) .$(CLRRST)
|
|---|
| 1210 |
|
|---|
| 1211 |
|
|---|
| 1212 |
|
|---|
| 1213 | # -----------------------------------------------------------------------------
|
|---|
| 1214 | # The target rule - Build the target.
|
|---|
| 1215 | # NOTE! NO SUBDIRS OR POST/PREMAKED INVOLVED!
|
|---|
| 1216 | # -----------------------------------------------------------------------------
|
|---|
| 1217 | target: $(TARGET) $(TARGET_ILIB) $(_TARGET_EARLY_PUBLISH)
|
|---|
| 1218 | !if "$(TARGET)$(TARGET_ILIB)" != ""
|
|---|
| 1219 | @$(ECHO) Successfully Built $(CLRFIL)$(TARGET) $(TARGET_ILIB)$(CLRRST)
|
|---|
| 1220 | !else
|
|---|
| 1221 | @$(ECHO) .$(CLRRST)
|
|---|
| 1222 | !endif
|
|---|
| 1223 |
|
|---|
| 1224 |
|
|---|
| 1225 |
|
|---|
| 1226 | # -----------------------------------------------------------------------------
|
|---|
| 1227 | # The shell rule - Setup the correcte shell environment and start a shell.
|
|---|
| 1228 | # -----------------------------------------------------------------------------
|
|---|
| 1229 | shell:
|
|---|
| 1230 | @$(ECHO) Creating work shell $(CLRRST)
|
|---|
| 1231 | \
|
|---|
| 1232 | !ifndef BUILD_VERBOSE
|
|---|
| 1233 | @ \
|
|---|
| 1234 | !endif
|
|---|
| 1235 | -$(TOOL_BUILDENV) $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(ENV_ENVS) \
|
|---|
| 1236 | $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST) * $(COMSPEC)
|
|---|
| 1237 |
|
|---|
| 1238 |
|
|---|
| 1239 |
|
|---|
| 1240 | # -----------------------------------------------------------------------------
|
|---|
| 1241 | # The nothing rule - Rule for testing the makefile structure.
|
|---|
| 1242 | # -----------------------------------------------------------------------------
|
|---|
| 1243 | nothing:
|
|---|
| 1244 | @$(ECHO) Doing nothing in $(MAKEFILE).
|
|---|
| 1245 | !ifdef SUBDIRS
|
|---|
| 1246 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
|
|---|
| 1247 | !endif
|
|---|
| 1248 | !ifdef PREMAKEFILES
|
|---|
| 1249 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
|
|---|
| 1250 | !endif
|
|---|
| 1251 | !ifdef POSTMAKEFILES
|
|---|
| 1252 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
|
|---|
| 1253 | !endif
|
|---|
| 1254 | @$(ECHO) Completed nothing in $(MAKEFILE).
|
|---|
| 1255 |
|
|---|
| 1256 |
|
|---|
| 1257 |
|
|---|
| 1258 | # -----------------------------------------------------------------------------
|
|---|
| 1259 | # The $(TARGET) rule - For EXE, DLL, SYS and IFS targets
|
|---|
| 1260 | # -----------------------------------------------------------------------------
|
|---|
| 1261 | !if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "VDD"
|
|---|
| 1262 | $(TARGET): $(TARGET_OBJS) $(TARGET_RES) $(TARGET_DEF) $(TARGET_DEPS) $(TARGET_LIBS) \
|
|---|
| 1263 | $(MAKEFILE) $(MAKE_INCLUDE_SETUP) $(MAKE_INCLUDE_LD_SETUP) $(MAKE_INCLUDE_LD_OPT) $(PATH_ROOT)\$(BUILD_SETUP_MAK) $(MAKE_INCLUDE_PROCESS) $(PATH_MAKE)\setup.tools.mk
|
|---|
| 1264 | !if "$(TOOL_JOB_WAIT)" != ""
|
|---|
| 1265 | ! ifndef BUILD_QUIET
|
|---|
| 1266 | @$(ECHO) Waiting for jobs to complete $(CLRRST)
|
|---|
| 1267 | ! endif
|
|---|
| 1268 | \
|
|---|
| 1269 | ! ifndef BUILD_VERBOSE
|
|---|
| 1270 | @ \
|
|---|
| 1271 | ! endif
|
|---|
| 1272 | $(TOOL_JOB_WAIT)
|
|---|
| 1273 | !endif
|
|---|
| 1274 | !if "$(TARGET_DEF_LINK)" != "$(TARGET_DEF)"
|
|---|
| 1275 | ! ifndef BUILD_QUIET
|
|---|
| 1276 | @$(ECHO) Stamping deffile with build level info.$(CLRRST)
|
|---|
| 1277 | ! endif
|
|---|
| 1278 | \
|
|---|
| 1279 | ! ifndef BUILD_VERBOSE
|
|---|
| 1280 | @ \
|
|---|
| 1281 | ! endif
|
|---|
| 1282 | $(TOOL_BLDLEVEL) $(BUILD_BLDLEVEL_FLAGS) $(TARGET_BLDLEVEL_FLAGS) -R$(TARGET_DEF) $(TARGET_DEF) $(TARGET_DEF_LINK)
|
|---|
| 1283 | !endif
|
|---|
| 1284 | !ifndef TOOL_DEFCONV
|
|---|
| 1285 | @$(TOOL_ECHOTXT) Creating Linker Input File $(CLRRST)<<$(TARGET_LNK)
|
|---|
| 1286 | $(LINK_LNK1)
|
|---|
| 1287 | $(LINK_LNK2)
|
|---|
| 1288 | $(LINK_LNK3)
|
|---|
| 1289 | $(LINK_LNK4)
|
|---|
| 1290 | $(LINK_LNK5)
|
|---|
| 1291 | <<KEEP
|
|---|
| 1292 | !else
|
|---|
| 1293 | @$(ECHO) Creating Linker Input File $(CLRRST) $(TARGET_LNK)
|
|---|
| 1294 | @$(TOOL_RM) "$(TARGET_LNK)"
|
|---|
| 1295 | \
|
|---|
| 1296 | ! ifndef BUILD_VERBOSE
|
|---|
| 1297 | @ \
|
|---|
| 1298 | ! endif
|
|---|
| 1299 | $(TOOL_DEFCONV) $(TARGET_DEF_LINK) $(TARGET_LNK) <<$(TARGET_LNK)2
|
|---|
| 1300 | $(LINK_LNK1)
|
|---|
| 1301 | $(LINK_LNK2)
|
|---|
| 1302 | $(LINK_LNK3)
|
|---|
| 1303 | $(LINK_LNK4)
|
|---|
| 1304 | $(LINK_LNK5)
|
|---|
| 1305 | <<keep
|
|---|
| 1306 | !endif
|
|---|
| 1307 | !ifdef BUILD_VERBOSE
|
|---|
| 1308 | @type $(TARGET_LNK)
|
|---|
| 1309 | !endif
|
|---|
| 1310 | @$(ECHO) Linking $(TARGET_MODE) $(CLRFIL)$@ $(CLRRST)
|
|---|
| 1311 | \
|
|---|
| 1312 | !ifndef BUILD_VERBOSE
|
|---|
| 1313 | @ \
|
|---|
| 1314 | !endif
|
|---|
| 1315 | !ifdef TARGET_IGNORE_LINKER_WARNINGS
|
|---|
| 1316 | -4 \
|
|---|
| 1317 | !endif
|
|---|
| 1318 | !if "$(TARGET_MODE)" == "EXE"
|
|---|
| 1319 | $(LINK_CMD_EXE)
|
|---|
| 1320 | !endif
|
|---|
| 1321 | !if "$(TARGET_MODE)" == "DLL"
|
|---|
| 1322 | $(LINK_CMD_DLL)
|
|---|
| 1323 | !endif
|
|---|
| 1324 | !if "$(TARGET_MODE)" == "SYS"
|
|---|
| 1325 | $(LINK_CMD_SYS)
|
|---|
| 1326 | !endif
|
|---|
| 1327 | !if "$(TARGET_MODE)" == "IFS"
|
|---|
| 1328 | $(LINK_CMD_IFS)
|
|---|
| 1329 | !endif
|
|---|
| 1330 | !if "$(TARGET_MODE)" == "VDD"
|
|---|
| 1331 | $(LINK_CMD_VDD)
|
|---|
| 1332 | !endif
|
|---|
| 1333 | !if "$(TARGET_RES)" != "" && "$(RL)" != ""
|
|---|
| 1334 | @$(ECHO) Linking Resources $(CLRRST)
|
|---|
| 1335 | \
|
|---|
| 1336 | ! ifndef BUILD_VERBOSE
|
|---|
| 1337 | @ \
|
|---|
| 1338 | ! endif
|
|---|
| 1339 | $(RL) $(RL_FLAGS) $(TARGET_RES) $@
|
|---|
| 1340 | !endif
|
|---|
| 1341 | !if "$(TARGET_DLLRNAME)" != ""
|
|---|
| 1342 | @$(ECHO) Dll Rename $(TARGET_DLLRNAME)
|
|---|
| 1343 | \
|
|---|
| 1344 | ! ifndef BUILD_VERBOSE
|
|---|
| 1345 | @ \
|
|---|
| 1346 | ! endif
|
|---|
| 1347 | $(TOOL_DLLRNAME) $(TARGET) $(TARGET_DLLRNAME)
|
|---|
| 1348 | !endif
|
|---|
| 1349 | !if "$(TOOL_MAPSYM)" != "" && "$(TARGET_SYM)" != "" && "$(TARGET_MAP)" != ""
|
|---|
| 1350 | \
|
|---|
| 1351 | ! ifndef BUILD_VERBOSE
|
|---|
| 1352 | @ \
|
|---|
| 1353 | ! endif
|
|---|
| 1354 | $(TOOL_MAPSYM) $(TARGET_MAP) $(TARGET_SYM)
|
|---|
| 1355 | !endif
|
|---|
| 1356 | !if "$(BUILD_MODE)" == "RELEASE"
|
|---|
| 1357 | \
|
|---|
| 1358 | ! ifndef BUILD_VERBOSE
|
|---|
| 1359 | @ \
|
|---|
| 1360 | ! endif
|
|---|
| 1361 | $(TOOL_COPY) "$@" "$(_TARGET_DEB)"
|
|---|
| 1362 | ! if "$(TOOL_STRIP)" != ""
|
|---|
| 1363 | \
|
|---|
| 1364 | ! ifndef BUILD_VERBOSE
|
|---|
| 1365 | @ \
|
|---|
| 1366 | ! endif
|
|---|
| 1367 | $(TOOL_STRIP) $@
|
|---|
| 1368 | ! endif
|
|---|
| 1369 | !endif
|
|---|
| 1370 |
|
|---|
| 1371 | !endif
|
|---|
| 1372 |
|
|---|
| 1373 |
|
|---|
| 1374 | # -----------------------------------------------------------------------------
|
|---|
| 1375 | # The $(TARGET) rule - For LIB, SYSLIB, and IFSLIB targets.
|
|---|
| 1376 | # -----------------------------------------------------------------------------
|
|---|
| 1377 | !if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
|
|---|
| 1378 | $(TARGET): $(TARGET_OBJS) $(TARGET_LNK) $(TARGET_DEPS)
|
|---|
| 1379 | !if "$(TOOL_JOB_WAIT)" != ""
|
|---|
| 1380 | ! ifndef BUILD_QUIET
|
|---|
| 1381 | @$(ECHO) Waiting for jobs to complete $(CLRRST)
|
|---|
| 1382 | ! endif
|
|---|
| 1383 | \
|
|---|
| 1384 | ! ifndef BUILD_VERBOSE
|
|---|
| 1385 | @ \
|
|---|
| 1386 | ! endif
|
|---|
| 1387 | $(TOOL_JOB_WAIT)
|
|---|
| 1388 | !endif
|
|---|
| 1389 | @$(ECHO) Creating Library $(CLRFIL)$@ $(CLRRST)
|
|---|
| 1390 | !ifndef BUILD_VERBOSE
|
|---|
| 1391 | @$(TOOL_RM) "$@"
|
|---|
| 1392 | @$(AR_CMD)
|
|---|
| 1393 | !else
|
|---|
| 1394 | $(TOOL_RM) "$@"
|
|---|
| 1395 | $(AR_CMD)
|
|---|
| 1396 | !endif
|
|---|
| 1397 |
|
|---|
| 1398 |
|
|---|
| 1399 | #
|
|---|
| 1400 | # Lib parameter file.
|
|---|
| 1401 | #
|
|---|
| 1402 | $(TARGET_LNK): $(MAKEFILE) $(MAKE_INCLUDE_SETUP) $(MAKE_INCLUDE_AR_SETUP) $(PATH_ROOT)\$(BUILD_SETUP_MAK)
|
|---|
| 1403 | @$(TOOL_ECHOTXT) Creating Lib Input File $(CLRRST)<<$@
|
|---|
| 1404 | $(AR_LNK1)
|
|---|
| 1405 | $(AR_LNK2)
|
|---|
| 1406 | $(AR_LNK3)
|
|---|
| 1407 | $(AR_LNK4)
|
|---|
| 1408 | $(AR_LNK5)
|
|---|
| 1409 | <<KEEP
|
|---|
| 1410 | !ifdef BUILD_VERBOSE
|
|---|
| 1411 | @type $@
|
|---|
| 1412 | !endif
|
|---|
| 1413 | !endif
|
|---|
| 1414 |
|
|---|
| 1415 |
|
|---|
| 1416 | # -----------------------------------------------------------------------------
|
|---|
| 1417 | # The $(TARGET) rule - For DEPEND targets.
|
|---|
| 1418 | # -----------------------------------------------------------------------------
|
|---|
| 1419 | !if "$(TARGET_MODE)" == "DEPEND"
|
|---|
| 1420 | $(TARGET):
|
|---|
| 1421 | @$(ECHO) .
|
|---|
| 1422 | !endif
|
|---|
| 1423 |
|
|---|
| 1424 |
|
|---|
| 1425 |
|
|---|
| 1426 | # -----------------------------------------------------------------------------
|
|---|
| 1427 | # The $(TARGET_ILIB) rule - Make import library.
|
|---|
| 1428 | # -----------------------------------------------------------------------------
|
|---|
| 1429 | !ifdef TARGET_ILIB
|
|---|
| 1430 | $(TARGET_ILIB): $(TARGET_IDEF) $(MAKEFILE) $(MAKE_INCLUDE_SETUP) $(MAKE_INCLUDE_AR_SETUP) $(PATH_MAKE)\setup.tools.mk
|
|---|
| 1431 | @$(ECHO) Creating Import Library $(CLRFIL)$@ $(CLRRST)
|
|---|
| 1432 | \
|
|---|
| 1433 | !ifndef BUILD_VERBOSE
|
|---|
| 1434 | @if not exist $(@D) $(ECHO) Target implib path $(CLRFIL)$(@D)$(CLRTXT) does NOT exist. Creating. $(CLRRST)
|
|---|
| 1435 | !endif
|
|---|
| 1436 | @if not exist $(@D) $(TOOL_CREATEPATH) $(@D)
|
|---|
| 1437 | \
|
|---|
| 1438 | !ifndef BUILD_VERBOSE
|
|---|
| 1439 | @ \
|
|---|
| 1440 | !endif
|
|---|
| 1441 | $(IMPLIB) $(IMPLIB_FLAGS) $@ $(TARGET_IDEF)
|
|---|
| 1442 |
|
|---|
| 1443 |
|
|---|
| 1444 | #
|
|---|
| 1445 | # Conversion rule for converting the .def file before passing along to implib.
|
|---|
| 1446 | #
|
|---|
| 1447 | ! if "$(TARGET_IDEF_ORG)" != "" && "$(TARGET_IDEF_ORG)" != "$(TARGET_IDEF)"
|
|---|
| 1448 | $(TARGET_IDEF): $(TARGET_IDEF_ORG)
|
|---|
| 1449 | @$(ECHO) Making Import Definition File $(CLRFIL)$@ $(CLRRST)
|
|---|
| 1450 | \
|
|---|
| 1451 | !ifndef BUILD_VERBOSE
|
|---|
| 1452 | @if not exist $(@D) $(ECHO) Target .def path $(CLRFIL)$(@D)$(CLRTXT) does NOT exist. Creating. $(CLRRST)
|
|---|
| 1453 | !endif
|
|---|
| 1454 | @if not exist $(@D) $(TOOL_CREATEPATH) $(@D)
|
|---|
| 1455 | \
|
|---|
| 1456 | !ifndef BUILD_VERBOSE
|
|---|
| 1457 | @ \
|
|---|
| 1458 | !endif
|
|---|
| 1459 | $(TOOL_IDEFCONV) $(TOOL_IDEFCONV_FLAGS) $(TARGET_IDEF_ORG) $@
|
|---|
| 1460 | ! endif
|
|---|
| 1461 |
|
|---|
| 1462 | !endif
|
|---|
| 1463 |
|
|---|
| 1464 |
|
|---|
| 1465 |
|
|---|
| 1466 | # -----------------------------------------------------------------------------
|
|---|
| 1467 | # The .force rule - Force a remake of something everytime.
|
|---|
| 1468 | # -----------------------------------------------------------------------------
|
|---|
| 1469 | .force:
|
|---|
| 1470 | !ifndef BUILD_VERBOSE
|
|---|
| 1471 | @$(ECHO) .
|
|---|
| 1472 | !else
|
|---|
| 1473 | @$(ECHO) . (force) .
|
|---|
| 1474 | !endif
|
|---|
| 1475 |
|
|---|
| 1476 |
|
|---|
| 1477 |
|
|---|
| 1478 | # -----------------------------------------------------------------------------
|
|---|
| 1479 | # Read Dependencies.
|
|---|
| 1480 | # -----------------------------------------------------------------------------
|
|---|
| 1481 | !if "$(TARGET_MODE)" != "TESTCASE" && "$(TARGET_MODE)" != "DEPEND"
|
|---|
| 1482 | !if "$(TARGET_MODE)" != "EMPTY" && "$(NODEP)" == ""
|
|---|
| 1483 |
|
|---|
| 1484 | #
|
|---|
| 1485 | # Read dependency file for current directory
|
|---|
| 1486 | #
|
|---|
| 1487 | !ifndef MAKEVER
|
|---|
| 1488 | ! if [$(TOOL_EXISTS) $(TARGET_DEPEND)] == 0
|
|---|
| 1489 | ! ifdef BUILD_VERBOSE
|
|---|
| 1490 | ! if [$(ECHO) Including dependency $(CLRFIL)$(TARGET_DEPEND)$(CLRRST)]
|
|---|
| 1491 | ! endif
|
|---|
| 1492 | ! endif
|
|---|
| 1493 | ! include $(TARGET_DEPEND)
|
|---|
| 1494 | ! else
|
|---|
| 1495 | #! ifndef NODEP
|
|---|
| 1496 | #! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(TARGET_DEPEND) is missing.$(CLRRST)]
|
|---|
| 1497 | #! endif
|
|---|
| 1498 | #! endif
|
|---|
| 1499 | ! endif
|
|---|
| 1500 | !else
|
|---|
| 1501 | ! if %exists($(TARGET_DEPEND)) != 0
|
|---|
| 1502 | ! ifdef BUILD_VERBOSE
|
|---|
| 1503 | $(ECHO) Including dependency $(CLRFIL)$(TARGET_DEPEND)$(CLRRST)
|
|---|
| 1504 | ! endif
|
|---|
| 1505 | ! include $(TARGET_DEPEND)
|
|---|
| 1506 | ! else
|
|---|
| 1507 | #! ifndef NODEP
|
|---|
| 1508 | #$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(TARGET_DEPEND) is missing.$(CLRRST)
|
|---|
| 1509 | #! endif
|
|---|
| 1510 | ! endif
|
|---|
| 1511 | !endif
|
|---|
| 1512 |
|
|---|
| 1513 |
|
|---|
| 1514 | #
|
|---|
| 1515 | # Read global dependency files.
|
|---|
| 1516 | #
|
|---|
| 1517 | !ifdef BUILD_DEPEND1
|
|---|
| 1518 | ! ifndef MAKEVER
|
|---|
| 1519 | ! if [$(TOOL_EXISTS) $(BUILD_DEPEND1)] == 0
|
|---|
| 1520 | ! ifdef BUILD_VERBOSE
|
|---|
| 1521 | ! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND1)$(CLRRST)]
|
|---|
| 1522 | ! endif
|
|---|
| 1523 | ! endif
|
|---|
| 1524 | ! include $(BUILD_DEPEND1)
|
|---|
| 1525 | ! else
|
|---|
| 1526 | ! ifndef NODEP
|
|---|
| 1527 | ! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND1) is missing.$(CLRRST)]
|
|---|
| 1528 | ! endif
|
|---|
| 1529 | ! endif
|
|---|
| 1530 | ! endif
|
|---|
| 1531 | ! else
|
|---|
| 1532 | ! if %exists($(BUILD_DEPEND1)) != 0
|
|---|
| 1533 | ! ifdef BUILD_VERBOSE
|
|---|
| 1534 | $(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND1)$(CLRRST)
|
|---|
| 1535 | ! endif
|
|---|
| 1536 | ! include $(BUILD_DEPEND1)
|
|---|
| 1537 | ! else
|
|---|
| 1538 | ! ifndef NODEP
|
|---|
| 1539 | $(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND1) is missing.$(CLRRST)
|
|---|
| 1540 | ! endif
|
|---|
| 1541 | ! endif
|
|---|
| 1542 | ! endif
|
|---|
| 1543 | !endif
|
|---|
| 1544 |
|
|---|
| 1545 |
|
|---|
| 1546 | !ifdef BUILD_DEPEND2
|
|---|
| 1547 | ! ifndef MAKEVER
|
|---|
| 1548 | ! if [$(TOOL_EXISTS) $(BUILD_DEPEND2)] == 0
|
|---|
| 1549 | ! ifdef BUILD_VERBOSE
|
|---|
| 1550 | ! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND2)$(CLRRST)]
|
|---|
| 1551 | ! endif
|
|---|
| 1552 | ! endif
|
|---|
| 1553 | ! include $(BUILD_DEPEND2)
|
|---|
| 1554 | ! else
|
|---|
| 1555 | ! ifndef NODEP
|
|---|
| 1556 | ! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND2) is missing.$(CLRRST)]
|
|---|
| 1557 | ! endif
|
|---|
| 1558 | ! endif
|
|---|
| 1559 | ! endif
|
|---|
| 1560 | ! else
|
|---|
| 1561 | ! if %exists($(BUILD_DEPEND2)) != 0
|
|---|
| 1562 | ! ifdef BUILD_VERBOSE
|
|---|
| 1563 | $(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND2)$(CLRRST)
|
|---|
| 1564 | ! endif
|
|---|
| 1565 | ! include $(BUILD_DEPEND2)
|
|---|
| 1566 | ! else
|
|---|
| 1567 | ! ifndef NODEP
|
|---|
| 1568 | $(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND2) is missing.$(CLRRST)
|
|---|
| 1569 | ! endif
|
|---|
| 1570 | ! endif
|
|---|
| 1571 | ! endif
|
|---|
| 1572 | !endif
|
|---|
| 1573 |
|
|---|
| 1574 |
|
|---|
| 1575 | !ifdef BUILD_DEPEND3
|
|---|
| 1576 | ! ifndef MAKEVER
|
|---|
| 1577 | ! if [$(TOOL_EXISTS) $(BUILD_DEPEND3)] == 0
|
|---|
| 1578 | ! ifdef BUILD_VERBOSE
|
|---|
| 1579 | ! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND3)$(CLRRST)]
|
|---|
| 1580 | ! endif
|
|---|
| 1581 | ! endif
|
|---|
| 1582 | ! include $(BUILD_DEPEND3)
|
|---|
| 1583 | ! else
|
|---|
| 1584 | ! ifndef NODEP
|
|---|
| 1585 | ! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND3) is missing.$(CLRRST)]
|
|---|
| 1586 | ! endif
|
|---|
| 1587 | ! endif
|
|---|
| 1588 | ! endif
|
|---|
| 1589 | ! else
|
|---|
| 1590 | ! if %exists($(BUILD_DEPEND3)) != 0
|
|---|
| 1591 | ! ifdef BUILD_VERBOSE
|
|---|
| 1592 | $(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND3)$(CLRRST)
|
|---|
| 1593 | ! endif
|
|---|
| 1594 | ! include $(BUILD_DEPEND3)
|
|---|
| 1595 | ! else
|
|---|
| 1596 | ! ifndef NODEP
|
|---|
| 1597 | $(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND3) is missing.$(CLRRST)
|
|---|
| 1598 | ! endif
|
|---|
| 1599 | ! endif
|
|---|
| 1600 | ! endif
|
|---|
| 1601 | !endif
|
|---|
| 1602 |
|
|---|
| 1603 |
|
|---|
| 1604 | !endif
|
|---|
| 1605 |
|
|---|
| 1606 |
|
|---|
| 1607 | #
|
|---|
| 1608 | # If BUILD_MULTIJOBS is nonempty make sure the job daemon is up running.
|
|---|
| 1609 | #
|
|---|
| 1610 | !if "$(BUILD_MULTIJOBS)" != ""
|
|---|
| 1611 | ! if [$(TOOL_JOB_UP)] != 0
|
|---|
| 1612 | ! if "$(BUILD_QUITE)" == ""
|
|---|
| 1613 | ! ifndef MAKEVER
|
|---|
| 1614 | ! if [$(ECHO) Starting Job Daemon With $(TOOL_JOB_WORKERS) Workers...$(CLRRST)]
|
|---|
| 1615 | ! endif
|
|---|
| 1616 | ! else
|
|---|
| 1617 | $(ECHO) Starting Job Daemon With $(TOOL_JOB_WORKERS) Workers...$(CLRRST)
|
|---|
| 1618 | ! endif
|
|---|
| 1619 | ! endif
|
|---|
| 1620 | ! if [$(TOOL_JOB_INIT) $(TOOL_JOB_WORKERS)] != 0
|
|---|
| 1621 | ! ifndef MAKEVER
|
|---|
| 1622 | ! if [$(ECHO) $(CLRERR)Fatal error: Failed to start job daemon.$(CLRRST)]
|
|---|
| 1623 | ! endif
|
|---|
| 1624 | ! error
|
|---|
| 1625 | !else
|
|---|
| 1626 | ! error $(CLRERR)Fatal error: Failed to start job daemon.$(CLRRST)
|
|---|
| 1627 | !endif
|
|---|
| 1628 | ! endif
|
|---|
| 1629 | ! endif
|
|---|
| 1630 | !endif
|
|---|
| 1631 |
|
|---|
| 1632 | !endif #!TESTCASE
|
|---|
| 1633 |
|
|---|
| 1634 |
|
|---|
| 1635 | #
|
|---|
| 1636 | # Include system library dependency stubs.
|
|---|
| 1637 | #
|
|---|
| 1638 | !include $(PATH_MAKE)\setup.$(SHT_TRGPLTFRM)libs.mk
|
|---|
| 1639 |
|
|---|
| 1640 |
|
|---|
| 1641 | #
|
|---|
| 1642 | # Check if TARGET_ALWAYS needs to be forced built.
|
|---|
| 1643 | #
|
|---|
| 1644 | !if "$(TARGET_ALWAYS)" != ""
|
|---|
| 1645 | ! ifndef BUILD_FORCED_BUILD_TEST
|
|---|
| 1646 | ! if [$(TOOL_MAKE) BUILD_FORCED_BUILD_TEST=1 -f $(MAKEFILE) -q $(TARGET) $(TARGET_ILIB) >nul 2>nul] != 0
|
|---|
| 1647 | $(TARGET_ALWAYS): .force
|
|---|
| 1648 | ! endif
|
|---|
| 1649 | ! endif
|
|---|
| 1650 | !endif
|
|---|
| 1651 |
|
|---|
| 1652 |
|
|---|