Changeset 8253 for trunk/make/process.mak
- Timestamp:
- Apr 13, 2002, 6:40:01 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/make/process.mak
r8213 r8253 1 # $Id: process.mak,v 1. 2 2002-04-07 22:43:25bird Exp $1 # $Id: process.mak,v 1.3 2002-04-13 04:39:59 bird Exp $ 2 2 3 3 # … … 10 10 # 11 11 12 # 13 # This makefile expects setup.mak and the specific setup to be included 14 # already. Plus there are several prerequisite environment variables 15 # subsystem makefiles need to set: 16 # TARGET_NAME is obligatory 17 18 !ifndef TARGET_NAME 19 !error fatal error: TARGET_NAME is not defined! 20 !endif 21 22 # provide overridable defaults 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 !error Fatal error: You must include setup.mak before process.mak in the makefile. 21 !endif 22 !if "$(ENV_STATUS)" != "OK" 23 !error Fatal error: The enironment is not valid. Bad setup.mak? 24 !endif 25 26 !if "$(TARGET_NAME)" == "" 27 !error Fatal error: TARGET_NAME is not defined! Should be set in the makefile. 28 !endif 29 30 # ----------------------------------------------------------------------------- 31 # Provide overridable defaults 32 # ----------------------------------------------------------------------------- 33 34 # Default target mode is executable. 35 !ifndef TARGET_MODE 36 TARGET_MODE = EXE 37 !endif 38 39 # Default extension corresponds to the target mode. 40 !ifndef TARGET_EXT 41 ! if "$(TARGET_MODE)" == "CRT" || "$(TARGET_MODE)" == "DLL" 42 TARGET_EXT = $(EXT_DLL) 43 ! endif 44 ! if "$(TARGET_MODE)" == "SYS" 45 TARGET_EXT = $(EXT_SYS) 46 ! endif 47 ! if "$(TARGET_MODE)" == "EXE" 48 TARGET_EXT = $(EXT_EXE) 49 ! endif 50 ! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "PUBLIB" || "$(TARGET_MODE)" == "SYSLIB" 51 TARGET_EXT = $(EXT_LIB) 52 ! endif 53 ! if "$(TARGET_MODE)" == "EMPTY" 54 TARGET_EXT = empty 55 ! endif 56 ! ifndef TARGET_EXT 57 !error Error: TARGET_EXT not set 58 ! endif 59 !endif 60 61 # Default target path. (where all the generated stuff for this target goes) 62 !ifndef PATH_TARGET 63 PATH_TARGET = $(PATH_OBJ)\$(TARGET_NAME).$(TARGET_EXT) 64 !endif 65 66 # Default target file. (output) 23 67 !ifndef TARGET 24 TARGET=$(PATH_TARGET)\$(TARGET_NAME).$(TARGET_EXT) 25 !endif 26 68 TARGET = $(PATH_TARGET)\$(TARGET_NAME).$(TARGET_EXT) 69 !endif 70 71 # Default object file. (output) 27 72 !ifndef TARGET_OBJS 28 TARGET_OBJS=$(PATH_TARGET)\$(TARGET_NAME).$(EXT_OBJ) 29 !endif 30 73 TARGET_OBJS = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_OBJ) 74 !endif 75 76 # Default libraries. (input) 31 77 !ifndef TARGET_LIBS 32 TARGET_LIBS=$(LIB_C_DLL) $(LIB_OS) $(LIB_C_RTDLL) 33 !endif 34 78 TARGET_LIBS = $(LIB_C_DLL) $(LIB_OS) $(LIB_C_RTDLL) 79 !endif 80 81 # Default definition file. (input) 35 82 !ifndef TARGET_DEF 36 TARGET_DEF=$(MAKEDIR)\$(PATH_DEF)\$(TARGET_NAME).def 37 !endif 38 83 TARGET_DEF = $(MAKEDIR)\$(PATH_DEF)\$(TARGET_NAME).def 84 !endif 85 86 # Default definition file for generating the import library. (input) 39 87 !ifndef TARGET_IDEF 40 TARGET_IDEF=$(TARGET_DEF) 41 !endif 42 88 TARGET_IDEF = $(TARGET_DEF) 89 !endif 90 91 # Default map file. (output) 43 92 !ifndef TARGET_MAP 44 TARGET_MAP=$(PATH_TARGET)\$(TARGET_NAME).map 45 !endif 46 93 TARGET_MAP = $(PATH_TARGET)\$(TARGET_NAME).map 94 !endif 95 96 # Default link file. (output) 47 97 !ifndef TARGET_LNK 48 TARGET_LNK=$(PATH_TARGET)\$(TARGET_NAME).lnk 49 !endif 50 51 !ifndef TARGET_MODE 52 TARGET_MODE=EXE 53 !endif 54 55 !ifndef TARGET_EXT 56 !if "$(TARGET_MODE)" == "CRT" || "$(TARGET_MODE)" == "DLL" 57 TARGET_EXT=$(EXT_DLL) 58 !endif 59 !if "$(TARGET_MODE)" == "SYS" 60 TARGET_EXT=$(EXT_SYS) 61 !endif 62 !if "$(TARGET_MODE)" == "EXE" 63 TARGET_EXT=$(EXT_EXE) 64 !endif 65 !if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "PUBLIB" || "$(TARGET_MODE)" == "SYSLIB" 66 TARGET_EXT=$(EXT_LIB) 67 !endif 68 !if "$(TARGET_MODE)" == "EMPTY" 69 TARGET_EXT=empty 70 !endif 71 !ifndef TARGET_EXT 72 !error Error: TARGET_EXT not set 73 !endif 74 !endif 75 98 TARGET_LNK = $(PATH_TARGET)\$(TARGET_NAME).lnk 99 !endif 100 101 # Default import library file. (output) 76 102 !ifndef TARGET_ILIB 77 !if "$(TARGET_MODE)" == "CRT" || "$(TARGET_MODE)" == "DLL" 78 TARGET_ILIB=$(PATH_LIB)\$(TARGET_NAME).$(EXT_ILIB) 79 !endif 80 !endif 81 82 !if "$(TARGET_MODE)" == "PUBLIB" 103 ! if "$(TARGET_MODE)" == "CRT" || "$(TARGET_MODE)" == "DLL" 104 TARGET_ILIB =$(PATH_LIB)\$(TARGET_NAME).$(EXT_ILIB) 105 ! endif 106 !endif 107 108 # Default public library name. (output) 109 !ifndef TARGET_PUBLIB 110 ! if "$(TARGET_MODE)" == "PUBLIB" 83 111 TARGET_PUBLIB=$(PATH_LIB)\$(TARGET_NAME).$(TARGET_EXT) 84 ! else112 ! else 85 113 TARGET_PUBLIB= 86 !endif 87 88 114 ! endif 115 !endif 116 117 # Default depend filename. 118 !ifndef TARGET_DEPEND 119 TARGET_DEPEND = $(PATH_TARGET)\.depend 120 !endif 121 122 # Default makefile name. 123 !ifndef MAKEFILE 124 MAKEFILE = makefile 125 !endif 126 127 # Ignore linker warnings for some target modes. 128 !ifndef TARGET_IGNORE_LINKER_WARNINGS 129 ! if "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT" 130 TARGET_IGNORE_LINKER_WARNINGS = 1 131 ! endif 132 !endif 133 134 135 # Default stacksize 136 # 137 # BUGBUG/TODO/FIXME 138 # kso: Not sure if this is the *right* way to represent it! 139 # It can't be when we start changing it based on the 140 # current build environment. 89 141 !ifndef TARGET_STACKSIZE 90 142 # check if 16-bit target compiler … … 96 148 !endif 97 149 98 !ifndef MAKEFILE 99 MAKEFILE = makefile 100 !endif 101 102 103 # ensure the platform-specific target path exists 104 PATH_TARGET=$(PATH_OBJ)\$(TARGET_NAME).$(TARGET_EXT) 105 !if "$(PATH_TARGET)" != "" 106 ! if [$(TOOL_EXISTS) $(PATH_TARGET)] != 0 107 ! if [$(ECHO) Target path $(CLRFIL)$(PATH_TARGET)$(CLRTXT) does NOT exist. Creating. $(CLRRST)] 150 151 152 # ----------------------------------------------------------------------------- 153 # Tell user what we're building. 154 # ----------------------------------------------------------------------------- 155 !ifndef BUILD_QUIET 156 !if [$(ECHO) Target is $(CLRFIL)$(TARGET)$(CLRRST)] 157 !endif 158 !endif 159 160 161 # ----------------------------------------------------------------------------- 162 # Ensure the platform-specific target path exists 163 # ----------------------------------------------------------------------------- 164 165 !if "$(TARGET_MODE)" != "EMPTY" 166 ! if "$(PATH_TARGET)" != "" 167 ! if [$(TOOL_EXISTS) $(PATH_TARGET)] != 0 168 ! ifndef BUILD_QUIET 169 ! if [$(ECHO) Target path $(CLRFIL)$(PATH_TARGET)$(CLRTXT) does NOT exist. Creating. $(CLRRST)] 170 ! endif 171 ! endif 172 ! if [$(TOOL_CREATEPATH) $(PATH_TARGET)] 173 ! error Could not create $(PATH_TARGET) 174 ! endif 108 175 ! endif 109 ! if [$(TOOL_CREATEPATH) $(PATH_TARGET)] 110 ! error Could not create $(PATH_TARGET) 111 ! endif 112 ! endif 113 !endif 114 115 116 # Tell user what we're building. 117 !if [$(ECHO) Target is $(CLRFIL)$(TARGET)$(CLRRST)] 118 !endif 119 120 121 # build the target filenames 122 BUILD_TARGET_DEPEND=$(PATH_TARGET)\.depend 123 124 125 # ---------------------- 126 # common inference rules 127 # ---------------------- 176 ! endif 177 !endif 178 # not 100% sure about the != EMPTY stuff, but this is way faster. 179 180 181 182 # ----------------------------------------------------------------------------- 183 # Common inference rules 184 # ----------------------------------------------------------------------------- 128 185 129 186 .SUFFIXES: … … 168 225 $(CXX_FLAGS_IFS) \ 169 226 !endif 170 !if def CXX_LST_OUT227 !if "$(CXX_LST_OUT)" != "" 171 228 $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \ 172 229 !endif … … 191 248 $(CXX_FLAGS_IFS) \ 192 249 !endif 193 !if def CXX_LST_OUT250 !if "$(CXX_LST_OUT)" != "" 194 251 $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \ 195 252 !endif … … 238 295 $(CC_FLAGS_IFS) \ 239 296 !endif 240 !if def CC_LST_OUT297 !if "$(CC_LST_OUT)" != "" 241 298 $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \ 242 299 !endif … … 261 318 $(CC_FLAGS_IFS) \ 262 319 !endif 263 !if def CC_LST_OUT320 !if "$(CC_LST_OUT)" != "" 264 321 $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \ 265 322 !endif … … 299 356 300 357 301 # 302 # establish root dependency 303 # by removing the extension from the BUILD_TARGET 304 # and replacing it with .obj 305 # 358 359 360 361 # ----------------------------------------------------------------------------- 362 # The all rule - The default one, as it's the first rule in the file. 363 # ----------------------------------------------------------------------------- 306 364 all: build 307 365 308 366 309 # 310 # Build the main target. 311 # 367 368 # ----------------------------------------------------------------------------- 369 # The build rule - Build the target. 370 # Must take into account any subdirectories and makefiles which is is to be 371 # made before and after the target. That makes it kind of messy, sorry. 372 # ----------------------------------------------------------------------------- 312 373 !ifdef SUBDIRS 313 374 SUBDIRS_BUILD = subbuild … … 329 390 330 391 331 # 332 # Make Public libraries. 333 # 392 393 # ----------------------------------------------------------------------------- 394 # The lib rule - Make Public libraries. 395 # Must take into account any subdirectories and makefiles which is is to be 396 # made before and after the target. That makes it kind of messy, sorry. 397 # ----------------------------------------------------------------------------- 334 398 !ifdef SUBDIRS 335 399 SUBDIRS_LIB = subdir_lib … … 350 414 351 415 352 # 353 # Copies target to main binary directory. 354 # 416 417 # ----------------------------------------------------------------------------- 418 # The install rule - Copies target to main binary directory. 419 # Installation order is not concidered vital, so subdirectories and 420 # pre-makefiles are processed after this directory. This might be changed. 421 # ----------------------------------------------------------------------------- 355 422 install: 356 423 !if "$(TARGET_MODE)" == "EXE" … … 363 430 if exist $(TARGET) $(TOOL_COPY) $(TARGET) $(PATH_SYS) 364 431 !endif 365 !if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "PUBLIB" || "$(TARGET_MODE)" == "SYSLIB" 432 !if 0 433 # Nothing to do here currently. These are either private or they're allready where they should be. 434 # 435 # TODO/BUGBUG/FIXME: 436 # The PUB stuff should be change to a separate variable. 437 # It will make life easier to just state that this target, 438 # what ever it is, should be public. 439 # 440 # That's allow project to install targets during make without 441 # running the install command by setting some target modes 442 # public by default. 443 # (kso) 444 #!if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "PUBLIB" || "$(TARGET_MODE)" == "SYSLIB" 366 445 # if exist $(TARGET) $(TOOL_COPY) $(TARGET) $(PATH_LIB) 446 #!endif 367 447 !endif 368 448 !if "$(TARGET_DOCS)" != "" … … 380 460 381 461 382 # 383 # Run evt. testcase 384 # 462 463 # ----------------------------------------------------------------------------- 464 # The testcase rule - Execute testcases when present. 465 # Testcases are either a testcase.mak file or a testcase subdirectory. 466 # ----------------------------------------------------------------------------- 385 467 !ifndef BUILD_NO_TESTCASE 386 468 testcase: install … … 403 485 404 486 405 # 406 # Make dependencies. 407 # 487 488 # ----------------------------------------------------------------------------- 489 # The dep rule - Make dependencies. 490 # ----------------------------------------------------------------------------- 408 491 dep: 409 492 @$(ECHO) Building dependencies $(CLRRST) 410 @$(TOOL_DEP) $(TOOL_DEP_FLAGS) -o$$(PATH_TARGET) -d$( BUILD_TARGET_DEPEND)\493 @$(TOOL_DEP) $(TOOL_DEP_FLAGS) -o$$(PATH_TARGET) -d$(TARGET_DEPEND)\ 411 494 !ifdef TARGET_NO_DEP 412 495 -x$(TARGET_NO_DEP: =;)\ … … 424 507 425 508 426 # 427 # Clean up output files (not the installed ones). 428 # 509 510 # ----------------------------------------------------------------------------- 511 # The clean rule - Clean up output files. 512 # The current setup doesn't clean the installed ones. 513 # ----------------------------------------------------------------------------- 429 514 clean: 430 515 !if "$(PATH_TARGET)" != "" # paranoia … … 458 543 459 544 460 # 461 # EXE, DLL, SYS and IFS Targets 462 # 545 546 # ----------------------------------------------------------------------------- 547 # The $(TARGET) rule - For EXE, DLL, SYS and IFS targets 548 # ----------------------------------------------------------------------------- 463 549 !if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT" || "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS" 464 ! if "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT"465 TARGET_IGNORE_LINKER_WARNINGS=1466 !endif467 550 $(TARGET): $(TARGET_OBJS) $(TARGET_RES) $(TARGET_DEF) $(TARGET_LNK) $(TARGET_DEPS) 468 551 @$(ECHO) Linking $(TARGET_MODE) $(CLRFIL)$@ $(CLRRST) … … 471 554 !endif 472 555 !if "$(TARGET_MODE)" == "EXE" 473 @$(LINK_CMD_EXE)556 $(LINK_CMD_EXE) 474 557 !endif 475 558 !if "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT" … … 505 588 506 589 507 # 508 # DLL Import library 509 # 510 !ifdef TARGET_ILIB 511 $(TARGET_ILIB): $(TARGET_IDEF) 512 @$(ECHO) Creating Import Library $(CLRFIL)$@ $(CLRRST) 513 $(IMPLIB) $(IMPLIB_FLAGS) $@ $(TARGET_IDEF) 514 !endif 515 !endif 516 517 518 # 519 # Lib Targets. 520 # 590 591 # ----------------------------------------------------------------------------- 592 # The $(TARGET) rule - For LIB, PUBLIB, and SYSLIB targets. 593 # ----------------------------------------------------------------------------- 521 594 !if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "PUBLIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB" 522 595 $(TARGET): $(TARGET_OBJS) $(TARGET_LNK) $(TARGET_DEPS) … … 542 615 # 543 616 # Copy rule for public libraries. 617 # BUGBUG/TODO/FIXME: get rid of the PUBLIB stuff. see commet in install. 544 618 # 545 619 !if "$(TARGET_MODE)" == "PUBLIB" … … 550 624 551 625 552 # 553 # Empty target. 554 # 626 627 # ----------------------------------------------------------------------------- 628 # The $(TARGET) rule - For EMPTY targets. 629 # ----------------------------------------------------------------------------- 555 630 !if "$(TARGET_MODE)" == "EMPTY" 556 631 $(TARGET): … … 559 634 560 635 561 # 562 # read dependency file from current directory 563 # 636 637 # ----------------------------------------------------------------------------- 638 # The $(TARGET_ILIB) rule - Make import library. 639 # ----------------------------------------------------------------------------- 640 !ifdef TARGET_ILIB 641 $(TARGET_ILIB): $(TARGET_IDEF) 642 @$(ECHO) Creating Import Library $(CLRFIL)$@ $(CLRRST) 643 $(IMPLIB) $(IMPLIB_FLAGS) $@ $(TARGET_IDEF) 644 !endif 645 !endif 646 647 648 649 # ----------------------------------------------------------------------------- 650 # The .force rule - Force a remake of something everytime. 651 # ----------------------------------------------------------------------------- 652 .force: 653 @$(ECHO) . 654 655 656 657 # ----------------------------------------------------------------------------- 658 # Read Dependencies. 659 # ----------------------------------------------------------------------------- 660 564 661 !if "$(TARGET_MODE)" != "EMPTY" 565 ! if [$(TOOL_EXISTS) $(BUILD_TARGET_DEPEND)] == 0 566 ! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_TARGET_DEPEND)$(CLRRST)] 662 663 # 664 # Read dependency file for current directory 665 # 666 !if [$(TOOL_EXISTS) $(TARGET_DEPEND)] == 0 667 ! ifndef BUILD_QUIET 668 ! if [$(ECHO) Including dependency $(CLRFIL)$(TARGET_DEPEND)$(CLRRST)] 567 669 ! endif 568 ! include $(BUILD_TARGET_DEPEND) 670 ! endif 671 ! include $(TARGET_DEPEND) 672 !else 673 ! ifndef NODEP 674 ! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(TARGET_DEPEND) is missing.$(CLRRST)] 675 ! endif 676 ! endif 677 !endif 678 679 680 # 681 # Read global dependency files. 682 # 683 !ifdef BUILD_DEPEND1 684 ! if [$(TOOL_EXISTS) $(BUILD_DEPEND1)] == 0 685 ! ifndef BUILD_QUIET 686 ! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND1)$(CLRRST)] 687 ! endif 688 ! endif 689 ! include $(BUILD_DEPEND1) 569 690 ! else 570 691 ! ifndef NODEP 571 ! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_ TARGET_DEPEND) is missing.$(CLRRST)]692 ! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND1) is missing.$(CLRRST)] 572 693 ! endif 573 694 ! endif … … 575 696 !endif 576 697 577 578 # 579 # Force rule. 580 # 581 .force: 582 @$(ECHO) . 583 698 !ifdef BUILD_DEPEND2 699 ! if [$(TOOL_EXISTS) $(BUILD_DEPEND2)] == 0 700 ! ifndef BUILD_QUIET 701 ! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND2)$(CLRRST)] 702 ! endif 703 ! endif 704 ! include $(BUILD_DEPEND2) 705 ! else 706 ! ifndef NODEP 707 ! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND2) is missing.$(CLRRST)] 708 ! endif 709 ! endif 710 ! endif 711 !endif 712 713 714 !ifdef BUILD_DEPEND3 715 ! if [$(TOOL_EXISTS) $(BUILD_DEPEND3)] == 0 716 ! ifndef BUILD_QUIET 717 ! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND3)$(CLRRST)] 718 ! endif 719 ! endif 720 ! include $(BUILD_DEPEND3) 721 ! else 722 ! ifndef NODEP 723 ! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND3) is missing.$(CLRRST)] 724 ! endif 725 ! endif 726 ! endif 727 !endif 728 729 730 !endif 731
Note:
See TracChangeset
for help on using the changeset viewer.