[8333] | 1 | # $Id: process.mak,v 1.10 2002-04-30 06:19:13 bird Exp $
|
---|
[8197] | 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 |
|
---|
[8253] | 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 | !error Fatal error: You must include setup.mak before process.mak in the makefile.
|
---|
[8197] | 21 | !endif
|
---|
[8253] | 22 | !if "$(ENV_STATUS)" != "OK"
|
---|
[8290] | 23 | !error Fatal error: The environment is not valid. Bad setup.mak?
|
---|
[8253] | 24 | !endif
|
---|
[8197] | 25 |
|
---|
[8253] | 26 | !if "$(TARGET_NAME)" == ""
|
---|
| 27 | !error Fatal error: TARGET_NAME is not defined! Should be set in the makefile.
|
---|
| 28 | !endif
|
---|
| 29 |
|
---|
[8290] | 30 | !ifdef TARGET_MODE
|
---|
| 31 | # Executable target mode.
|
---|
| 32 | ! if "$(TARGET_MODE)" != "EXE"
|
---|
| 33 | # Dynamic Load Library target mode.
|
---|
| 34 | ! if "$(TARGET_MODE)" != "DLL"
|
---|
| 35 | # Dynamic Load Library target mode - Special variant for making custom C/C++ runtime DLL.
|
---|
| 36 | ! if "$(TARGET_MODE)" != "CRT"
|
---|
| 37 | # Drive (/ system software) target mode.
|
---|
| 38 | ! if "$(TARGET_MODE)" != "SYS"
|
---|
| 39 | # Installable File System Drive target mode. (Also called FSD, File System Driver.)
|
---|
| 40 | ! if "$(TARGET_MODE)" != "IFS"
|
---|
| 41 | # Virtual Device Driver target mode.
|
---|
| 42 | ! if "$(TARGET_MODE)" != "VDD"
|
---|
| 43 | # Object Library target mode.
|
---|
| 44 | ! if "$(TARGET_MODE)" != "LIB"
|
---|
| 45 | # Object Library target mode - Special variant which is to be linked with a SYS target.
|
---|
| 46 | ! if "$(TARGET_MODE)" != "SYSLIB"
|
---|
| 47 | # Object Library target mode - Special variant which is to be linked with an IFS target.
|
---|
| 48 | ! if "$(TARGET_MODE)" != "IFSLIB"
|
---|
| 49 | # Dummy/Hub/TopLevel empty makefile. This has no target.
|
---|
| 50 | ! if "$(TARGET_MODE)" != "EMPTY"
|
---|
| 51 | ! error Error: Bad TARGET_MODE="$(TARGET_MODE)". Valid ones are: EXE, DLL, CRT, EXE, SYS, IFS, VDD, LIB, SYSLIB, IFSLIB and EMPTY.
|
---|
| 52 | ! endif
|
---|
| 53 | ! endif
|
---|
| 54 | ! endif
|
---|
| 55 | ! endif
|
---|
| 56 | ! endif
|
---|
| 57 | ! endif
|
---|
| 58 | ! endif
|
---|
| 59 | ! endif
|
---|
| 60 | ! endif
|
---|
| 61 | ! endif
|
---|
| 62 | !endif
|
---|
| 63 |
|
---|
| 64 |
|
---|
[8253] | 65 | # -----------------------------------------------------------------------------
|
---|
| 66 | # Provide overridable defaults
|
---|
| 67 | # -----------------------------------------------------------------------------
|
---|
| 68 |
|
---|
| 69 | # Default target mode is executable.
|
---|
| 70 | !ifndef TARGET_MODE
|
---|
| 71 | TARGET_MODE = EXE
|
---|
| 72 | !endif
|
---|
| 73 |
|
---|
| 74 | # Default extension corresponds to the target mode.
|
---|
| 75 | !ifndef TARGET_EXT
|
---|
[8290] | 76 | ! if "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT"
|
---|
[8253] | 77 | TARGET_EXT = $(EXT_DLL)
|
---|
| 78 | ! endif
|
---|
| 79 | ! if "$(TARGET_MODE)" == "SYS"
|
---|
| 80 | TARGET_EXT = $(EXT_SYS)
|
---|
| 81 | ! endif
|
---|
[8290] | 82 | ! if "$(TARGET_MODE)" == "IFS"
|
---|
| 83 | TARGET_EXT = $(EXT_IFS)
|
---|
| 84 | ! endif
|
---|
| 85 | ! if "$(TARGET_MODE)" == "VDD"
|
---|
| 86 | TARGET_EXT = $(EXT_VDD)
|
---|
| 87 | ! endif
|
---|
[8253] | 88 | ! if "$(TARGET_MODE)" == "EXE"
|
---|
| 89 | TARGET_EXT = $(EXT_EXE)
|
---|
| 90 | ! endif
|
---|
[8290] | 91 | ! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
|
---|
[8253] | 92 | TARGET_EXT = $(EXT_LIB)
|
---|
| 93 | ! endif
|
---|
| 94 | ! if "$(TARGET_MODE)" == "EMPTY"
|
---|
| 95 | TARGET_EXT = empty
|
---|
| 96 | ! endif
|
---|
| 97 | ! ifndef TARGET_EXT
|
---|
[8290] | 98 | !error Internal Error: TARGET_EXT not set. Probably invalid TARGET_MODE. (TARGET_MODE="$(TARGET_MODE)")
|
---|
[8253] | 99 | ! endif
|
---|
| 100 | !endif
|
---|
| 101 |
|
---|
| 102 | # Default target path. (where all the generated stuff for this target goes)
|
---|
| 103 | !ifndef PATH_TARGET
|
---|
| 104 | PATH_TARGET = $(PATH_OBJ)\$(TARGET_NAME).$(TARGET_EXT)
|
---|
| 105 | !endif
|
---|
| 106 |
|
---|
| 107 | # Default target file. (output)
|
---|
[8197] | 108 | !ifndef TARGET
|
---|
[8270] | 109 | ! if "$(TARGET_MODE)" != "EMPTY"
|
---|
[8253] | 110 | TARGET = $(PATH_TARGET)\$(TARGET_NAME).$(TARGET_EXT)
|
---|
[8270] | 111 | ! endif
|
---|
[8197] | 112 | !endif
|
---|
| 113 |
|
---|
[8333] | 114 | # Default target .sym file. (output)
|
---|
| 115 | !ifndef TARGET_SYM
|
---|
| 116 | TARGET_SYM = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_SYM)
|
---|
| 117 | !endif
|
---|
[8270] | 118 |
|
---|
[8253] | 119 | # Default object file. (output)
|
---|
[8197] | 120 | !ifndef TARGET_OBJS
|
---|
[8253] | 121 | TARGET_OBJS = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_OBJ)
|
---|
[8197] | 122 | !endif
|
---|
| 123 |
|
---|
[8253] | 124 | # Default libraries. (input)
|
---|
[8197] | 125 | !ifndef TARGET_LIBS
|
---|
[8253] | 126 | TARGET_LIBS = $(LIB_C_DLL) $(LIB_OS) $(LIB_C_RTDLL)
|
---|
[8197] | 127 | !endif
|
---|
| 128 |
|
---|
[8253] | 129 | # Default definition file. (input)
|
---|
[8197] | 130 | !ifndef TARGET_DEF
|
---|
[8253] | 131 | TARGET_DEF = $(MAKEDIR)\$(PATH_DEF)\$(TARGET_NAME).def
|
---|
[8197] | 132 | !endif
|
---|
| 133 |
|
---|
[8333] | 134 | # Default modified definition filename. (output)
|
---|
| 135 | !ifndef TARGET_DEF_LINK
|
---|
| 136 | TARGET_DEF_LINK = $(PATH_TARGET)\$(TARGET_NAME)_link.def
|
---|
| 137 | !endif
|
---|
| 138 |
|
---|
[8253] | 139 | # Default definition file for generating the import library. (input)
|
---|
[8197] | 140 | !ifndef TARGET_IDEF
|
---|
[8253] | 141 | TARGET_IDEF = $(TARGET_DEF)
|
---|
[8197] | 142 | !endif
|
---|
| 143 |
|
---|
[8253] | 144 | # Default map file. (output)
|
---|
[8197] | 145 | !ifndef TARGET_MAP
|
---|
[8333] | 146 | TARGET_MAP = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_MAP)
|
---|
[8197] | 147 | !endif
|
---|
| 148 |
|
---|
[8253] | 149 | # Default link file. (output)
|
---|
[8197] | 150 | !ifndef TARGET_LNK
|
---|
[8253] | 151 | TARGET_LNK = $(PATH_TARGET)\$(TARGET_NAME).lnk
|
---|
[8197] | 152 | !endif
|
---|
| 153 |
|
---|
[8253] | 154 | # Default import library file. (output)
|
---|
| 155 | !ifndef TARGET_ILIB
|
---|
[8290] | 156 | ! if "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT"
|
---|
[8253] | 157 | TARGET_ILIB =$(PATH_LIB)\$(TARGET_NAME).$(EXT_ILIB)
|
---|
| 158 | ! endif
|
---|
[8197] | 159 | !endif
|
---|
| 160 |
|
---|
[8290] | 161 | # Default public name. (output)
|
---|
| 162 | !ifndef TARGET_PUBNAME
|
---|
| 163 | TARGET_PUBNAME=
|
---|
| 164 | ! ifdef TARGET_PUBLIC
|
---|
| 165 | ! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
|
---|
| 166 | TARGET_PUBNAME=$(PATH_LIB)\$(TARGET_NAME).$(TARGET_EXT)
|
---|
| 167 | ! endif
|
---|
| 168 | ! if "$(TARGET_MODE)" == "EXE"
|
---|
| 169 | TARGET_PUBNAME=$(PATH_EXE)\$(TARGET_NAME).$(TARGET_EXT)
|
---|
| 170 | ! endif
|
---|
| 171 | ! if "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT"
|
---|
| 172 | TARGET_PUBNAME=$(PATH_DLL)\$(TARGET_NAME).$(TARGET_EXT)
|
---|
| 173 | ! endif
|
---|
| 174 | ! if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS"
|
---|
| 175 | TARGET_PUBNAME=$(PATH_SYS)\$(TARGET_NAME).$(TARGET_EXT)
|
---|
| 176 | ! endif
|
---|
| 177 | ! if "$(TARGET_MODE)" == "VDD"
|
---|
| 178 | TARGET_PUBNAME=$(PATH_VDD)\$(TARGET_NAME).$(TARGET_EXT)
|
---|
| 179 | ! endif
|
---|
[8253] | 180 | ! endif
|
---|
[8197] | 181 | !endif
|
---|
[8253] | 182 |
|
---|
| 183 | # Default depend filename.
|
---|
| 184 | !ifndef TARGET_DEPEND
|
---|
| 185 | TARGET_DEPEND = $(PATH_TARGET)\.depend
|
---|
[8197] | 186 | !endif
|
---|
| 187 |
|
---|
[8253] | 188 | # Default makefile name.
|
---|
| 189 | !ifndef MAKEFILE
|
---|
| 190 | MAKEFILE = makefile
|
---|
[8197] | 191 | !endif
|
---|
| 192 |
|
---|
[8253] | 193 | # Ignore linker warnings for some target modes.
|
---|
| 194 | !ifndef TARGET_IGNORE_LINKER_WARNINGS
|
---|
| 195 | ! if "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT"
|
---|
| 196 | TARGET_IGNORE_LINKER_WARNINGS = 1
|
---|
| 197 | ! endif
|
---|
[8197] | 198 | !endif
|
---|
| 199 |
|
---|
| 200 |
|
---|
[8253] | 201 | # Default stacksize
|
---|
| 202 | #
|
---|
| 203 | # BUGBUG/TODO/FIXME
|
---|
| 204 | # kso: Not sure if this is the *right* way to represent it!
|
---|
| 205 | # It can't be when we start changing it based on the
|
---|
| 206 | # current build environment.
|
---|
[8197] | 207 | !ifndef TARGET_STACKSIZE
|
---|
| 208 | # check if 16-bit target compiler
|
---|
| 209 | ! if "$(BUILD_ENV)" == "MSCV6"
|
---|
| 210 | TARGET_STACKSIZE=0x2000
|
---|
| 211 | ! else
|
---|
| 212 | TARGET_STACKSIZE=0x10000
|
---|
| 213 | ! endif
|
---|
| 214 | !endif
|
---|
| 215 |
|
---|
[8253] | 216 |
|
---|
| 217 |
|
---|
| 218 | # -----------------------------------------------------------------------------
|
---|
| 219 | # Tell user what we're building.
|
---|
| 220 | # -----------------------------------------------------------------------------
|
---|
| 221 | !ifndef BUILD_QUIET
|
---|
| 222 | !if [$(ECHO) Target is $(CLRFIL)$(TARGET)$(CLRRST)]
|
---|
[8197] | 223 | !endif
|
---|
[8253] | 224 | !endif
|
---|
[8197] | 225 |
|
---|
| 226 |
|
---|
[8253] | 227 | # -----------------------------------------------------------------------------
|
---|
| 228 | # Ensure the platform-specific target path exists
|
---|
| 229 | # -----------------------------------------------------------------------------
|
---|
| 230 |
|
---|
| 231 | !if "$(TARGET_MODE)" != "EMPTY"
|
---|
| 232 | ! if "$(PATH_TARGET)" != ""
|
---|
| 233 | ! if [$(TOOL_EXISTS) $(PATH_TARGET)] != 0
|
---|
| 234 | ! ifndef BUILD_QUIET
|
---|
| 235 | ! if [$(ECHO) Target path $(CLRFIL)$(PATH_TARGET)$(CLRTXT) does NOT exist. Creating. $(CLRRST)]
|
---|
| 236 | ! endif
|
---|
| 237 | ! endif
|
---|
| 238 | ! if [$(TOOL_CREATEPATH) $(PATH_TARGET)]
|
---|
| 239 | ! error Could not create $(PATH_TARGET)
|
---|
| 240 | ! endif
|
---|
[8197] | 241 | ! endif
|
---|
| 242 | ! endif
|
---|
| 243 | !endif
|
---|
[8253] | 244 | # not 100% sure about the != EMPTY stuff, but this is way faster.
|
---|
[8197] | 245 |
|
---|
| 246 |
|
---|
| 247 |
|
---|
[8253] | 248 | # -----------------------------------------------------------------------------
|
---|
| 249 | # Common inference rules
|
---|
| 250 | # -----------------------------------------------------------------------------
|
---|
[8197] | 251 |
|
---|
| 252 | .SUFFIXES:
|
---|
[8213] | 253 | .SUFFIXES: .$(EXT_OBJ) .c .cpp .asm .$(EXT_RES) .rc .pre-c .pre-cpp # .h .def
|
---|
[8197] | 254 |
|
---|
| 255 |
|
---|
| 256 | # Assembling assembly source.
|
---|
| 257 | .asm{$(PATH_TARGET)}.$(EXT_OBJ):
|
---|
| 258 | @$(ECHO) Assembling $(CLRFIL)$< $(CLRRST)
|
---|
[8290] | 259 | !ifndef BUILD_VERBOSE
|
---|
| 260 | @ \
|
---|
| 261 | !endif
|
---|
[8213] | 262 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
|
---|
[8290] | 263 | $(AS) $(AS_FLAGS_SYS) $< $(AS_OBJ_OUT)$@
|
---|
[8197] | 264 | !else
|
---|
[8290] | 265 | $(AS) $(AS_FLAGS) $< $(AS_OBJ_OUT)$@
|
---|
[8197] | 266 | !endif
|
---|
| 267 |
|
---|
| 268 | .asm.$(EXT_OBJ):
|
---|
| 269 | @$(ECHO) Assembling $(CLRFIL)$< $(CLRRST)
|
---|
[8290] | 270 | !ifndef BUILD_VERBOSE
|
---|
| 271 | @ \
|
---|
| 272 | !endif
|
---|
[8213] | 273 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
|
---|
[8290] | 274 | $(AS) $(AS_FLAGS_SYS) $< $(AS_OBJ_OUT)$(PATH_TARGET)\$(@F)
|
---|
[8197] | 275 | !else
|
---|
[8290] | 276 | $(AS) $(AS_FLAGS) $< $(AS_OBJ_OUT)$(PATH_TARGET)\$(@F)
|
---|
[8197] | 277 | !endif
|
---|
| 278 |
|
---|
| 279 |
|
---|
| 280 | # Compiling C++ source.
|
---|
| 281 | .cpp{$(PATH_TARGET)}.$(EXT_OBJ):
|
---|
| 282 | @$(ECHO) C++ Compiler $(CLRFIL)$< $(CLRRST)
|
---|
[8290] | 283 | !ifndef BUILD_VERBOSE
|
---|
| 284 | @ \
|
---|
| 285 | !endif
|
---|
| 286 | $(CXX) \
|
---|
| 287 | !if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB"
|
---|
[8197] | 288 | $(CXX_FLAGS_EXE) \
|
---|
| 289 | !endif
|
---|
| 290 | !if "$(TARGET_MODE)" == "CRT"
|
---|
| 291 | $(CXX_FLAGS_CRT) \
|
---|
| 292 | !endif
|
---|
| 293 | !if "$(TARGET_MODE)" == "DLL"
|
---|
| 294 | $(CXX_FLAGS_DLL) \
|
---|
| 295 | !endif
|
---|
| 296 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
|
---|
| 297 | $(CXX_FLAGS_SYS) \
|
---|
| 298 | !endif
|
---|
[8213] | 299 | !if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
|
---|
| 300 | $(CXX_FLAGS_IFS) \
|
---|
| 301 | !endif
|
---|
[8253] | 302 | !if "$(CXX_LST_OUT)" != ""
|
---|
[8213] | 303 | $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \
|
---|
| 304 | !endif
|
---|
[8197] | 305 | $(CXX_OBJ_OUT)$@ $<
|
---|
| 306 |
|
---|
| 307 | .cpp.$(EXT_OBJ):
|
---|
| 308 | @$(ECHO) C++ Compiler $(CLRFIL)$< $(CLRRST)
|
---|
[8290] | 309 | !ifndef BUILD_VERBOSE
|
---|
| 310 | @ \
|
---|
| 311 | !endif
|
---|
| 312 | $(CXX) \
|
---|
| 313 | !if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB"
|
---|
[8197] | 314 | $(CXX_FLAGS_EXE) \
|
---|
| 315 | !endif
|
---|
| 316 | !if "$(TARGET_MODE)" == "CRT"
|
---|
| 317 | $(CXX_FLAGS_CRT) \
|
---|
| 318 | !endif
|
---|
| 319 | !if "$(TARGET_MODE)" == "DLL"
|
---|
| 320 | $(CXX_FLAGS_DLL) \
|
---|
| 321 | !endif
|
---|
| 322 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
|
---|
| 323 | $(CXX_FLAGS_SYS) \
|
---|
| 324 | !endif
|
---|
[8213] | 325 | !if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
|
---|
| 326 | $(CXX_FLAGS_IFS) \
|
---|
| 327 | !endif
|
---|
[8253] | 328 | !if "$(CXX_LST_OUT)" != ""
|
---|
[8213] | 329 | $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \
|
---|
| 330 | !endif
|
---|
[8197] | 331 | $(CXX_OBJ_OUT)$(PATH_TARGET)\$(@F) $<
|
---|
| 332 |
|
---|
| 333 |
|
---|
| 334 | # Pre-Compiling C++ source.
|
---|
| 335 | .cpp.pre-cpp:
|
---|
| 336 | @$(ECHO) C++ Compiler $(CLRFIL)$< $(CLRRST)
|
---|
[8290] | 337 | !ifndef BUILD_VERBOSE
|
---|
| 338 | @ \
|
---|
| 339 | !endif
|
---|
| 340 | $(CXX) \
|
---|
| 341 | !if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB"
|
---|
[8197] | 342 | $(CXX_FLAGS_EXE) \
|
---|
| 343 | !endif
|
---|
| 344 | !if "$(TARGET_MODE)" == "CRT"
|
---|
| 345 | $(CXX_FLAGS_CRT) \
|
---|
| 346 | !endif
|
---|
| 347 | !if "$(TARGET_MODE)" == "DLL"
|
---|
| 348 | $(CXX_FLAGS_DLL) \
|
---|
| 349 | !endif
|
---|
| 350 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
|
---|
| 351 | $(CXX_FLAGS_SYS) \
|
---|
| 352 | !endif
|
---|
[8213] | 353 | !if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
|
---|
| 354 | $(CXX_FLAGS_IFS) \
|
---|
| 355 | !endif
|
---|
[8197] | 356 | $(CXX_PC_2_STDOUT) $< > $@
|
---|
| 357 |
|
---|
| 358 |
|
---|
| 359 | # Compiling C source.
|
---|
| 360 | .c{$(PATH_TARGET)}.$(EXT_OBJ):
|
---|
| 361 | @$(ECHO) C Compiler $(CLRFIL)$< $(CLRRST)
|
---|
[8290] | 362 | !ifndef BUILD_VERBOSE
|
---|
| 363 | @ \
|
---|
| 364 | !endif
|
---|
| 365 | $(CC) \
|
---|
| 366 | !if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB"
|
---|
[8197] | 367 | $(CC_FLAGS_EXE) \
|
---|
| 368 | !endif
|
---|
| 369 | !if "$(TARGET_MODE)" == "CRT"
|
---|
| 370 | $(CC_FLAGS_CRT) \
|
---|
| 371 | !endif
|
---|
| 372 | !if "$(TARGET_MODE)" == "DLL"
|
---|
| 373 | $(CC_FLAGS_DLL) \
|
---|
| 374 | !endif
|
---|
| 375 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
|
---|
| 376 | $(CC_FLAGS_SYS) \
|
---|
| 377 | !endif
|
---|
[8213] | 378 | !if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
|
---|
| 379 | $(CC_FLAGS_IFS) \
|
---|
| 380 | !endif
|
---|
[8253] | 381 | !if "$(CC_LST_OUT)" != ""
|
---|
[8213] | 382 | $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \
|
---|
| 383 | !endif
|
---|
[8197] | 384 | $(CC_OBJ_OUT)$@ $<
|
---|
| 385 |
|
---|
| 386 | .c.$(EXT_OBJ):
|
---|
| 387 | @$(ECHO) C Compiler $(CLRFIL)$< $(CLRRST)
|
---|
[8290] | 388 | !ifndef BUILD_VERBOSE
|
---|
| 389 | @ \
|
---|
| 390 | !endif
|
---|
| 391 | $(CC) \
|
---|
| 392 | !if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB"
|
---|
[8197] | 393 | $(CC_FLAGS_EXE) \
|
---|
| 394 | !endif
|
---|
| 395 | !if "$(TARGET_MODE)" == "CRT"
|
---|
| 396 | $(CC_FLAGS_CRT) \
|
---|
| 397 | !endif
|
---|
| 398 | !if "$(TARGET_MODE)" == "DLL"
|
---|
| 399 | $(CC_FLAGS_DLL) \
|
---|
| 400 | !endif
|
---|
| 401 | !if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
|
---|
| 402 | $(CC_FLAGS_SYS) \
|
---|
| 403 | !endif
|
---|
[8213] | 404 | !if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
|
---|
| 405 | $(CC_FLAGS_IFS) \
|
---|
| 406 | !endif
|
---|
[8253] | 407 | !if "$(CC_LST_OUT)" != ""
|
---|
[8213] | 408 | $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \
|
---|
| 409 | !endif
|
---|
[8197] | 410 | $(CC_OBJ_OUT)$(PATH_TARGET)\$(@F) $<
|
---|
| 411 |
|
---|
| 412 |
|
---|
| 413 | # Pre-Compiling C source.
|
---|
| 414 | .c.pre-c:
|
---|
| 415 | @$(ECHO) C PreCompiler $(CLRFIL)$< $(CLRRST)
|
---|
[8290] | 416 | !ifndef BUILD_VERBOSE
|
---|
| 417 | @ \
|
---|
| 418 | !endif
|
---|
| 419 | $(CC) \
|
---|
| 420 | !if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB"
|
---|
[8197] | 421 | $(CC_FLAGS_EXE) \
|
---|
| 422 | !endif
|
---|
| 423 | !if "$(TARGET_MODE)" == "CRT"
|
---|
| 424 | $(CC_FLAGS_CRT) \
|
---|
| 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
|
---|
[8213] | 432 | !if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
|
---|
| 433 | $(CC_FLAGS_IFS) \
|
---|
| 434 | !endif
|
---|
[8197] | 435 | $(CC_PC_2_STDOUT) $< > $@
|
---|
| 436 |
|
---|
| 437 |
|
---|
| 438 | # Compiling resources.
|
---|
| 439 | .rc{$(PATH_TARGET)}.res:
|
---|
| 440 | @$(ECHO) RC Compiler $(CLRFIL)$< $(CLRRST)
|
---|
[8290] | 441 | !ifndef BUILD_VERBOSE
|
---|
| 442 | @ \
|
---|
| 443 | !endif
|
---|
| 444 | $(RC) $(RC_FLAGS) $< $@
|
---|
[8197] | 445 |
|
---|
| 446 | .rc.res:
|
---|
| 447 | @$(ECHO) RC Compiler $(CLRFIL)$< $(CLRRST)
|
---|
[8290] | 448 | !ifndef BUILD_VERBOSE
|
---|
| 449 | @ \
|
---|
| 450 | !endif
|
---|
| 451 | $(RC) $(RC_FLAGS) $< $(PATH_TARGET)\$(@F)
|
---|
[8197] | 452 |
|
---|
| 453 |
|
---|
[8253] | 454 |
|
---|
| 455 |
|
---|
| 456 |
|
---|
| 457 | # -----------------------------------------------------------------------------
|
---|
| 458 | # The all rule - The default one, as it's the first rule in the file.
|
---|
| 459 | # -----------------------------------------------------------------------------
|
---|
[8197] | 460 | all: build
|
---|
| 461 |
|
---|
| 462 |
|
---|
[8253] | 463 |
|
---|
| 464 | # -----------------------------------------------------------------------------
|
---|
| 465 | # The build rule - Build the target.
|
---|
| 466 | # Must take into account any subdirectories and makefiles which is is to be
|
---|
| 467 | # made before and after the target. That makes it kind of messy, sorry.
|
---|
| 468 | # -----------------------------------------------------------------------------
|
---|
[8197] | 469 | !ifdef SUBDIRS
|
---|
| 470 | SUBDIRS_BUILD = subbuild
|
---|
| 471 | $(SUBDIRS_BUILD):
|
---|
| 472 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) build
|
---|
| 473 | !endif
|
---|
| 474 |
|
---|
| 475 | !ifdef PREMAKEFILES
|
---|
| 476 | PREMAKEFILES_BUILD = premakefiles_build
|
---|
| 477 | $(PREMAKEFILES_BUILD):
|
---|
| 478 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) build
|
---|
| 479 | !endif
|
---|
| 480 |
|
---|
[8290] | 481 | build: $(SUBDIRS_BUILD) $(PREMAKEFILES_BUILD) $(TARGET) $(TARGET_ILIB) $(TARGET_PUBNAME)
|
---|
[8197] | 482 | @$(ECHO) Successfully Built $(CLRFIL)$(TARGET) $(TARGET_ILIB)$(CLRRST)
|
---|
| 483 | !ifdef POSTMAKEFILES
|
---|
| 484 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
|
---|
| 485 | !endif
|
---|
| 486 |
|
---|
| 487 |
|
---|
[8253] | 488 |
|
---|
| 489 | # -----------------------------------------------------------------------------
|
---|
| 490 | # The lib rule - Make Public libraries.
|
---|
| 491 | # Must take into account any subdirectories and makefiles which is is to be
|
---|
| 492 | # made before and after the target. That makes it kind of messy, sorry.
|
---|
| 493 | # -----------------------------------------------------------------------------
|
---|
[8197] | 494 | !ifdef SUBDIRS
|
---|
| 495 | SUBDIRS_LIB = subdir_lib
|
---|
| 496 | $(SUBDIRS_LIB):
|
---|
| 497 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) lib
|
---|
| 498 | !endif
|
---|
| 499 |
|
---|
| 500 | !ifdef PREMAKEFILES
|
---|
| 501 | PREMAKEFILES_LIB = premakefiles_lib
|
---|
| 502 | $(PREMAKEFILES_LIB):
|
---|
| 503 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) lib
|
---|
| 504 | !endif
|
---|
| 505 |
|
---|
[8290] | 506 | !if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
|
---|
[8319] | 507 | lib: $(SUBDIRS_LIB) $(TARGET_ILIB) $(TARGET) $(TARGET_PUBNAME)
|
---|
[8290] | 508 | !else
|
---|
| 509 | lib: $(SUBDIRS_LIB) $(TARGET_ILIB)
|
---|
| 510 | !endif
|
---|
[8197] | 511 | !ifdef POSTMAKEFILES
|
---|
| 512 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
|
---|
| 513 | !endif
|
---|
| 514 |
|
---|
| 515 |
|
---|
[8253] | 516 |
|
---|
| 517 | # -----------------------------------------------------------------------------
|
---|
| 518 | # The install rule - Copies target to main binary directory.
|
---|
| 519 | # Installation order is not concidered vital, so subdirectories and
|
---|
| 520 | # pre-makefiles are processed after this directory. This might be changed.
|
---|
| 521 | # -----------------------------------------------------------------------------
|
---|
[8197] | 522 | install:
|
---|
[8290] | 523 | !if "$(TARGET_PUBLIC)" == ""
|
---|
| 524 | ! if "$(TARGET_MODE)" == "EXE"
|
---|
| 525 | @$(ECHO) Installing $(CLRFIL)$(TARGET)$(CLRTXT) in directory $(CLRFIL)$(PATH_BIN)$(CLRRST)
|
---|
| 526 | @if not exist $(TARGET) $(ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST)
|
---|
[8333] | 527 | @if exist $(TARGET) $(TOOL_COPY) $(TARGET) $(PATH_BIN)
|
---|
| 528 | @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(PATH_BIN)
|
---|
[8290] | 529 | ! endif
|
---|
| 530 | ! if "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT"
|
---|
| 531 | @$(ECHO) Installing $(CLRFIL)$(TARGET)$(CLRTXT) in directory $(CLRFIL)$(PATH_DLL)$(CLRRST)
|
---|
| 532 | @if not exist $(TARGET) $(ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST)
|
---|
[8333] | 533 | @if exist $(TARGET) $(TOOL_COPY) $(TARGET) $(PATH_DLL)
|
---|
| 534 | @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(PATH_DLL)
|
---|
[8290] | 535 | ! endif
|
---|
| 536 | ! if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS"
|
---|
| 537 | @$(ECHO) Installing $(CLRFIL)$(TARGET)$(CLRTXT) in directory $(CLRFIL)$(PATH_SYS)$(CLRRST)
|
---|
| 538 | @if not exist $(TARGET) $(ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST)
|
---|
[8333] | 539 | @if exist $(TARGET) $(TOOL_COPY) $(TARGET) $(PATH_SYS)
|
---|
| 540 | @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(PATH_SYS)
|
---|
[8290] | 541 | ! endif
|
---|
| 542 | !if 1 # these targets are either TARGET_PUBLIC or all private.
|
---|
| 543 | ! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
|
---|
| 544 | @$(ECHO) Installing $(CLRFIL)$(TARGET)$(CLRTXT) in directory $(CLRFIL)$(PATH_LIB)$(CLRRST)
|
---|
| 545 | @if not exist $(TARGET) $(ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST)
|
---|
[8333] | 546 | @if exist $(TARGET) $(TOOL_COPY) $(TARGET) $(PATH_LIB)
|
---|
| 547 | @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(PATH_LIB)
|
---|
[8290] | 548 | ! endif
|
---|
| 549 | ! endif
|
---|
[8197] | 550 | !endif
|
---|
| 551 | !if "$(TARGET_DOCS)" != ""
|
---|
| 552 | $(TOOL_COPY) $(TARGET_DOCS) $(PATH_DOC)
|
---|
| 553 | !endif
|
---|
| 554 | !ifdef SUBDIRS
|
---|
| 555 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) $@
|
---|
| 556 | !endif
|
---|
| 557 | !ifdef PREMAKEFILES
|
---|
| 558 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
|
---|
| 559 | !endif
|
---|
| 560 | !ifdef POSTMAKEFILES
|
---|
| 561 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
|
---|
| 562 | !endif
|
---|
| 563 |
|
---|
| 564 |
|
---|
[8253] | 565 |
|
---|
| 566 | # -----------------------------------------------------------------------------
|
---|
| 567 | # The testcase rule - Execute testcases when present.
|
---|
| 568 | # Testcases are either a testcase.mak file or a testcase subdirectory.
|
---|
| 569 | # -----------------------------------------------------------------------------
|
---|
[8265] | 570 | !ifndef BUILD_OWN_TESTCASE_RULE
|
---|
[8290] | 571 | testcase:
|
---|
[8197] | 572 | !if [$(TOOL_EXISTS) testcase] == 0
|
---|
| 573 | @$(TOOL_DODIRS) "testcase" $(TOOL_MAKE) $@
|
---|
| 574 | !endif
|
---|
| 575 | !if [$(TOOL_EXISTS) testcase.mak] == 0
|
---|
| 576 | @$(TOOL_DOMAKES) "testcase.mak" $(TOOL_MAKE) $@
|
---|
| 577 | !endif
|
---|
| 578 | !ifdef SUBDIRS
|
---|
| 579 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) $@
|
---|
| 580 | !endif
|
---|
| 581 | !ifdef PREMAKEFILES
|
---|
| 582 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
|
---|
| 583 | !endif
|
---|
| 584 | !ifdef POSTMAKEFILES
|
---|
| 585 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
|
---|
| 586 | !endif
|
---|
| 587 | !endif
|
---|
| 588 |
|
---|
| 589 |
|
---|
[8253] | 590 |
|
---|
| 591 | # -----------------------------------------------------------------------------
|
---|
[8298] | 592 | # The shell rule - Setup the correcte shell environment and start a shell.
|
---|
| 593 | # -----------------------------------------------------------------------------
|
---|
| 594 | shell:
|
---|
| 595 | !ifndef BUILD_VERBOSE
|
---|
| 596 | @ \
|
---|
| 597 | !endif
|
---|
| 598 | -$(TOOL_BUILDENV) $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(ENV_ENVS) \
|
---|
| 599 | $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST) * $(COMSPEC)
|
---|
| 600 |
|
---|
| 601 |
|
---|
| 602 |
|
---|
| 603 | # -----------------------------------------------------------------------------
|
---|
[8253] | 604 | # The dep rule - Make dependencies.
|
---|
| 605 | # -----------------------------------------------------------------------------
|
---|
[8197] | 606 | dep:
|
---|
| 607 | @$(ECHO) Building dependencies $(CLRRST)
|
---|
[8290] | 608 | !ifndef BUILD_VERBOSE
|
---|
| 609 | @ \
|
---|
| 610 | !endif
|
---|
| 611 | $(TOOL_DEP) $(TOOL_DEP_FLAGS) -o$$(PATH_TARGET) -d$(TARGET_DEPEND)\
|
---|
[8197] | 612 | !ifdef TARGET_NO_DEP
|
---|
| 613 | -x$(TARGET_NO_DEP: =;)\
|
---|
| 614 | !endif
|
---|
| 615 | $(TOOL_DEP_FILES)
|
---|
| 616 | !ifdef SUBDIRS
|
---|
| 617 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) NODEP=1 $@
|
---|
| 618 | !endif
|
---|
| 619 | !ifdef PREMAKEFILES
|
---|
| 620 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@
|
---|
| 621 | !endif
|
---|
| 622 | !ifdef POSTMAKEFILES
|
---|
| 623 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@
|
---|
| 624 | !endif
|
---|
| 625 |
|
---|
| 626 |
|
---|
[8253] | 627 |
|
---|
| 628 | # -----------------------------------------------------------------------------
|
---|
| 629 | # The clean rule - Clean up output files.
|
---|
| 630 | # The current setup doesn't clean the installed ones.
|
---|
| 631 | # -----------------------------------------------------------------------------
|
---|
[8197] | 632 | clean:
|
---|
| 633 | !if "$(PATH_TARGET)" != "" # paranoia
|
---|
| 634 | $(TOOL_RM) \
|
---|
| 635 | $(PATH_TARGET)\*.$(EXT_OBJ) \
|
---|
| 636 | $(PATH_TARGET)\*.$(EXT_ILIB) \
|
---|
| 637 | $(PATH_TARGET)\*.$(EXT_EXE) \
|
---|
| 638 | $(PATH_TARGET)\*.$(EXT_DLL) \
|
---|
[8333] | 639 | $(PATH_TARGET)\*.$(EXT_RES)
|
---|
| 640 | $(TOOL_RM) \
|
---|
[8197] | 641 | $(PATH_TARGET)\*.$(EXT_SYS) \
|
---|
[8333] | 642 | $(PATH_TARGET)\*.$(EXT_LIB) \
|
---|
| 643 | $(PATH_TARGET)\*.$(EXT_IFS) \
|
---|
| 644 | $(PATH_TARGET)\*.$(EXT_MAP) \
|
---|
| 645 | $(PATH_TARGET)\*.$(EXT_SYM)
|
---|
[8213] | 646 | $(TOOL_RM) \
|
---|
| 647 | $(PATH_TARGET)\*.s \
|
---|
| 648 | $(PATH_TARGET)\*.lst \
|
---|
[8197] | 649 | $(PATH_TARGET)\*.lnk \
|
---|
| 650 | $(PATH_TARGET)\*.pre-c \
|
---|
| 651 | $(PATH_TARGET)\*.pre-cpp \
|
---|
[8213] | 652 | $(PATH_TARGET)\.depend
|
---|
[8197] | 653 | !endif
|
---|
| 654 | !ifdef SUBDIRS
|
---|
| 655 | @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) $@
|
---|
| 656 | !endif
|
---|
| 657 | !ifdef PREMAKEFILES
|
---|
| 658 | @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
|
---|
| 659 | !endif
|
---|
| 660 | !ifdef POSTMAKEFILES
|
---|
| 661 | @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
|
---|
| 662 | !endif
|
---|
| 663 |
|
---|
| 664 |
|
---|
[8253] | 665 |
|
---|
| 666 | # -----------------------------------------------------------------------------
|
---|
| 667 | # The $(TARGET) rule - For EXE, DLL, SYS and IFS targets
|
---|
| 668 | # -----------------------------------------------------------------------------
|
---|
[8290] | 669 | !if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT" || "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "VDD"
|
---|
[8333] | 670 | $(TARGET): $(TARGET_OBJS) $(TARGET_RES) $(TARGET_DEF_LINK) $(TARGET_LNK) $(TARGET_DEPS)
|
---|
[8197] | 671 | @$(ECHO) Linking $(TARGET_MODE) $(CLRFIL)$@ $(CLRRST)
|
---|
[8290] | 672 | !ifndef BUILD_VERBOSE
|
---|
| 673 | @ \
|
---|
| 674 | !endif
|
---|
[8197] | 675 | !ifdef TARGET_IGNORE_LINKER_WARNINGS
|
---|
| 676 | -4 \
|
---|
| 677 | !endif
|
---|
| 678 | !if "$(TARGET_MODE)" == "EXE"
|
---|
[8253] | 679 | $(LINK_CMD_EXE)
|
---|
[8197] | 680 | !endif
|
---|
| 681 | !if "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT"
|
---|
[8290] | 682 | $(LINK_CMD_DLL)
|
---|
[8197] | 683 | !endif
|
---|
| 684 | !if "$(TARGET_MODE)" == "SYS"
|
---|
[8290] | 685 | $(LINK_CMD_SYS)
|
---|
[8197] | 686 | !endif
|
---|
[8213] | 687 | !if "$(TARGET_MODE)" == "IFS"
|
---|
[8290] | 688 | $(LINK_CMD_IFS)
|
---|
[8213] | 689 | !endif
|
---|
[8290] | 690 | !if "$(TARGET_MODE)" == "VDD"
|
---|
| 691 | $(LINK_CMD_VDD)
|
---|
| 692 | !endif
|
---|
[8197] | 693 | !if "$(TARGET_RES)" != "" && "$(RL)" != ""
|
---|
| 694 | @$(ECHO) Linking Resources $(CLRRST)
|
---|
[8290] | 695 | ! ifndef BUILD_VERBOSE
|
---|
| 696 | @ \
|
---|
| 697 | ! endif
|
---|
| 698 | $(RL) $(RL_FLAGS) $(TARGET_RES) $@
|
---|
[8197] | 699 | !endif
|
---|
| 700 | !if "$(TARGET_DLLRNAME)" != ""
|
---|
| 701 | @$(ECHO) Dll Rename $(TARGET_DLLRNAME)
|
---|
[8290] | 702 | ! ifndef BUILD_VERBOSE
|
---|
| 703 | @ \
|
---|
| 704 | ! endif
|
---|
[8197] | 705 | $(TOOL_DLLRNAME) $(TARGET) $(TARGET_DLLRNAME)
|
---|
| 706 | !endif
|
---|
[8333] | 707 | !if "$(TOOL_MAPSYM)" != "" && "$(TARGET_SYM)" != "" && "$(TARGET_MAP)" != ""
|
---|
| 708 | ! ifndef BUILD_VERBOSE
|
---|
| 709 | @ \
|
---|
| 710 | ! endif
|
---|
| 711 | $(TOOL_MAPSYM) $(TARGET_MAP) $(TARGET_SYM)
|
---|
| 712 | !endif
|
---|
[8197] | 713 |
|
---|
| 714 |
|
---|
| 715 | #
|
---|
| 716 | # Linker parameter file.
|
---|
| 717 | #
|
---|
| 718 | $(TARGET_LNK): $(MAKE_INCLUDE_PROCESS) $(MAKE_INCLUDE_SETUP) $(PATH_MAKE)\setup.mak $(MAKEFILE)
|
---|
| 719 | @$(ECHO) Creating Linker Input File $(CLRRST)<<$@
|
---|
| 720 | $(LINK_LNK1)
|
---|
| 721 | $(LINK_LNK2)
|
---|
| 722 | $(LINK_LNK3)
|
---|
| 723 | $(LINK_LNK4)
|
---|
| 724 | $(LINK_LNK5)
|
---|
| 725 | <<KEEP
|
---|
[8333] | 726 |
|
---|
| 727 |
|
---|
| 728 | #
|
---|
| 729 | # Builddef modified definition file.
|
---|
| 730 | #
|
---|
| 731 | !if "$(TARGET_DEF_LINK)" != "$(TARGET_DEF)"
|
---|
| 732 | $(TARGET_DEF_LINK): $(TARGET_DEF)
|
---|
| 733 | ! ifndef BUILD_QUIET
|
---|
| 734 | @$(ECHO) Stamping deffile with build level info.$(CLRRST)
|
---|
| 735 | ! endif
|
---|
| 736 | ! ifndef BUILD_VERBOSE
|
---|
| 737 | @ \
|
---|
| 738 | ! endif
|
---|
| 739 | $(TOOL_BLDLEVEL) $(BUILD_BLDLEVEL_FLAGS) $(TARGET_BLDLEVEL_FLAGS) -R$** $** $@
|
---|
[8290] | 740 | !endif
|
---|
[8197] | 741 |
|
---|
[8333] | 742 | !endif
|
---|
[8197] | 743 |
|
---|
[8333] | 744 |
|
---|
[8253] | 745 | # -----------------------------------------------------------------------------
|
---|
[8290] | 746 | # The $(TARGET) rule - For LIB, SYSLIB, and IFSLIB targets.
|
---|
[8253] | 747 | # -----------------------------------------------------------------------------
|
---|
[8290] | 748 | !if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
|
---|
[8197] | 749 | $(TARGET): $(TARGET_OBJS) $(TARGET_LNK) $(TARGET_DEPS)
|
---|
| 750 | @$(ECHO) Creating Library $(CLRFIL)$@ $(CLRRST)
|
---|
[8290] | 751 | !ifndef BUILD_VERBOSE
|
---|
| 752 | @$(TOOL_RM) $@
|
---|
| 753 | @$(AR_CMD)
|
---|
| 754 | !else
|
---|
[8197] | 755 | $(TOOL_RM) $@
|
---|
| 756 | $(AR_CMD)
|
---|
[8290] | 757 | !endif
|
---|
[8197] | 758 |
|
---|
| 759 |
|
---|
| 760 | #
|
---|
| 761 | # Lib parameter file.
|
---|
| 762 | #
|
---|
| 763 | $(TARGET_LNK): $(MAKE_INCLUDE_PROCESS) $(MAKE_INCLUDE_SETUP) $(PATH_MAKE)\setup.mak $(MAKEFILE)
|
---|
| 764 | @$(ECHO) Creating Lib Input File $(CLRRST)<<$@
|
---|
| 765 | $(AR_LNK1)
|
---|
| 766 | $(AR_LNK2)
|
---|
| 767 | $(AR_LNK3)
|
---|
| 768 | $(AR_LNK4)
|
---|
| 769 | $(AR_LNK5)
|
---|
| 770 | <<KEEP
|
---|
| 771 | !endif
|
---|
| 772 |
|
---|
| 773 |
|
---|
| 774 | #
|
---|
[8290] | 775 | # Copy rule for public targets.
|
---|
[8197] | 776 | #
|
---|
[8290] | 777 | !if "$(TARGET_PUBNAME)" != ""
|
---|
| 778 | $(TARGET_PUBNAME): $(TARGET)
|
---|
| 779 | @$(ECHO) Copying $(CLRFIL)$(TARGET)$(CLRTXT) to $(CLRFIL)$(@D)$(CLRRST)
|
---|
| 780 | !ifndef BUILD_VERBOSE
|
---|
| 781 | @ \
|
---|
[8197] | 782 | !endif
|
---|
[8290] | 783 | $(TOOL_COPY) $** $@
|
---|
[8333] | 784 | @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(@R).sym
|
---|
[8290] | 785 | !endif
|
---|
[8197] | 786 |
|
---|
| 787 |
|
---|
[8253] | 788 |
|
---|
| 789 | # -----------------------------------------------------------------------------
|
---|
| 790 | # The $(TARGET) rule - For EMPTY targets.
|
---|
| 791 | # -----------------------------------------------------------------------------
|
---|
[8197] | 792 | !if "$(TARGET_MODE)" == "EMPTY"
|
---|
[8316] | 793 | #$(TARGET):
|
---|
| 794 | # @$(ECHO) .
|
---|
[8197] | 795 | !endif
|
---|
| 796 |
|
---|
| 797 |
|
---|
[8253] | 798 |
|
---|
| 799 | # -----------------------------------------------------------------------------
|
---|
| 800 | # The $(TARGET_ILIB) rule - Make import library.
|
---|
| 801 | # -----------------------------------------------------------------------------
|
---|
| 802 | !ifdef TARGET_ILIB
|
---|
| 803 | $(TARGET_ILIB): $(TARGET_IDEF)
|
---|
| 804 | @$(ECHO) Creating Import Library $(CLRFIL)$@ $(CLRRST)
|
---|
[8290] | 805 | !ifndef BUILD_VERBOSE
|
---|
| 806 | @ \
|
---|
| 807 | !endif
|
---|
[8253] | 808 | $(IMPLIB) $(IMPLIB_FLAGS) $@ $(TARGET_IDEF)
|
---|
| 809 | !endif
|
---|
| 810 |
|
---|
| 811 |
|
---|
| 812 |
|
---|
| 813 | # -----------------------------------------------------------------------------
|
---|
| 814 | # The .force rule - Force a remake of something everytime.
|
---|
| 815 | # -----------------------------------------------------------------------------
|
---|
| 816 | .force:
|
---|
[8290] | 817 | !ifndef BUILD_VERBOSE
|
---|
[8253] | 818 | @$(ECHO) .
|
---|
[8290] | 819 | !else
|
---|
| 820 | @$(ECHO) . (force) .
|
---|
| 821 | !endif
|
---|
[8253] | 822 |
|
---|
| 823 |
|
---|
| 824 |
|
---|
| 825 | # -----------------------------------------------------------------------------
|
---|
| 826 | # Read Dependencies.
|
---|
| 827 | # -----------------------------------------------------------------------------
|
---|
| 828 |
|
---|
| 829 | !if "$(TARGET_MODE)" != "EMPTY"
|
---|
| 830 |
|
---|
[8197] | 831 | #
|
---|
[8253] | 832 | # Read dependency file for current directory
|
---|
[8197] | 833 | #
|
---|
[8253] | 834 | !if [$(TOOL_EXISTS) $(TARGET_DEPEND)] == 0
|
---|
| 835 | ! ifndef BUILD_QUIET
|
---|
| 836 | ! if [$(ECHO) Including dependency $(CLRFIL)$(TARGET_DEPEND)$(CLRRST)]
|
---|
[8197] | 837 | ! endif
|
---|
[8253] | 838 | ! endif
|
---|
| 839 | ! include $(TARGET_DEPEND)
|
---|
| 840 | !else
|
---|
| 841 | ! ifndef NODEP
|
---|
| 842 | ! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(TARGET_DEPEND) is missing.$(CLRRST)]
|
---|
| 843 | ! endif
|
---|
| 844 | ! endif
|
---|
| 845 | !endif
|
---|
| 846 |
|
---|
| 847 |
|
---|
| 848 | #
|
---|
| 849 | # Read global dependency files.
|
---|
| 850 | #
|
---|
| 851 | !ifdef BUILD_DEPEND1
|
---|
| 852 | ! if [$(TOOL_EXISTS) $(BUILD_DEPEND1)] == 0
|
---|
| 853 | ! ifndef BUILD_QUIET
|
---|
| 854 | ! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND1)$(CLRRST)]
|
---|
| 855 | ! endif
|
---|
| 856 | ! endif
|
---|
| 857 | ! include $(BUILD_DEPEND1)
|
---|
[8197] | 858 | ! else
|
---|
| 859 | ! ifndef NODEP
|
---|
[8253] | 860 | ! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND1) is missing.$(CLRRST)]
|
---|
[8197] | 861 | ! endif
|
---|
| 862 | ! endif
|
---|
| 863 | ! endif
|
---|
| 864 | !endif
|
---|
| 865 |
|
---|
[8253] | 866 | !ifdef BUILD_DEPEND2
|
---|
| 867 | ! if [$(TOOL_EXISTS) $(BUILD_DEPEND2)] == 0
|
---|
| 868 | ! ifndef BUILD_QUIET
|
---|
| 869 | ! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND2)$(CLRRST)]
|
---|
| 870 | ! endif
|
---|
| 871 | ! endif
|
---|
| 872 | ! include $(BUILD_DEPEND2)
|
---|
| 873 | ! else
|
---|
| 874 | ! ifndef NODEP
|
---|
| 875 | ! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND2) is missing.$(CLRRST)]
|
---|
| 876 | ! endif
|
---|
| 877 | ! endif
|
---|
| 878 | ! endif
|
---|
| 879 | !endif
|
---|
[8197] | 880 |
|
---|
| 881 |
|
---|
[8253] | 882 | !ifdef BUILD_DEPEND3
|
---|
| 883 | ! if [$(TOOL_EXISTS) $(BUILD_DEPEND3)] == 0
|
---|
| 884 | ! ifndef BUILD_QUIET
|
---|
| 885 | ! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND3)$(CLRRST)]
|
---|
| 886 | ! endif
|
---|
| 887 | ! endif
|
---|
| 888 | ! include $(BUILD_DEPEND3)
|
---|
| 889 | ! else
|
---|
| 890 | ! ifndef NODEP
|
---|
| 891 | ! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND3) is missing.$(CLRRST)]
|
---|
| 892 | ! endif
|
---|
| 893 | ! endif
|
---|
| 894 | ! endif
|
---|
| 895 | !endif
|
---|
| 896 |
|
---|
| 897 |
|
---|
| 898 | !endif
|
---|
| 899 |
|
---|