Changeset 9031 for trunk/make/process.mak
- Timestamp:
- Aug 20, 2002, 6:05:40 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/make/process.mak
r9028 r9031 1 # $Id: process.mak,v 1.1 6 2002-08-19 15:00:25bird Exp $1 # $Id: process.mak,v 1.17 2002-08-20 04:05:40 bird Exp $ 2 2 3 3 # … … 511 511 512 512 # ----------------------------------------------------------------------------- 513 # The build rule - Build the target. 514 # Must take into account any subdirectories and makefiles which is is to be 515 # made before and after the target. That makes it kind of messy, sorry. 516 # ----------------------------------------------------------------------------- 513 # The build rule - This runs all passes: 514 # 1. Make Dependencies 515 # 2. Make Libraries (all kinds) 516 # 3. Make Executables 517 # 4. Make Miscellaneous Targets 518 # 5. Make Install 519 # Note: In order to load dependencies we'll do a forwarding after making them. 520 # ----------------------------------------------------------------------------- 521 build: _build 522 !if "$(MAKEFLAGS:I=_)" == "$(MAKEFLAGS)" # this is of course broken in nmake v5.0 for OS/2. 523 @$(ECHO)$(CLRMAK)[Successfully Built Everything!] $(CLRRST) 524 !else 525 @$(ECHO)$(CLRMAK)[Built Everything! (Ignore option specified)] $(CLRRST) 526 !endif 527 528 # internal rule shared by rebuild and build. 529 _build: _build_banner_dep dep 530 !ifndef BUILD_QUIET 531 @$(ECHO) Restarting $(CLRFIL)$(MAKEFILE)$(CLRTXT) with new dependencies. $(CLRRST) 532 !endif 533 \ 534 !ifndef BUILD_VERBOSE 535 @ \ 536 !endif 537 $(TOOL_MAKE) -f $(MAKEFILE) _build_new_dependencies_ 538 539 # internal rule used to reload dependencies. 540 _build_new_dependencies_: \ 541 _build_banner_lib lib \ 542 _build_banner_executable executable \ 543 _build_banner_miscellaneous miscellaneous \ 544 _build_banner_install install 545 546 # Banners for rebuild and build. 547 _build_banner_clean: 548 @$(ECHO)$(CLRMAK)[Start Pass 0 - Make Clean] $(CLRRST) 549 @SET _BUILD_PASS=0 550 _build_banner_dep: 551 @$(ECHO)$(CLRMAK)[Start Pass 1 - Make Dependencies] $(CLRRST) 552 @SET _BUILD_PASS=1 553 _build_banner_lib: 554 @$(ECHO)$(CLRMAK)[Start Pass 2 - Make Libraries] $(CLRRST) 555 @SET _BUILD_PASS=2 556 _build_banner_executable: 557 @$(ECHO)$(CLRMAK)[Start Pass 3 - Make Executables] $(CLRRST) 558 @SET _BUILD_PASS=3 559 _build_banner_miscellaneous: 560 @$(ECHO)$(CLRMAK)[Start Pass 4 - Make Miscellaneous Targets] $(CLRRST) 561 @SET _BUILD_PASS=4 562 _build_banner_install: 563 @$(ECHO)$(CLRMAK)[Start Pass 5 - Make Install] $(CLRRST) 564 @SET _BUILD_PASS=5 565 566 567 568 # ----------------------------------------------------------------------------- 569 # The rebuild rule - Same as build but does a clean first (as Pass 0). 570 # ----------------------------------------------------------------------------- 571 rebuild: \ 572 _build_banner_clean clean \ 573 _build 574 !if "$(MAKEFLAGS:i=_)" == "$(MAKEFLAGS)" 575 @$(ECHO)$(CLRMAK)[Successfully Rebuilt Everything!] $(CLRRST) 576 !else 577 @$(ECHO)$(CLRMAK)[Rebuilt Everything! (Ignore option specified)] $(CLRRST) 578 !endif 579 580 581 582 # ----------------------------------------------------------------------------- 583 # Pass 0 - The clean rule - Clean up output files. 584 # The current setup doesn't clean the installed ones. 585 # ----------------------------------------------------------------------------- 586 !if "$(TARGET_MODE)" != "TESTCASE" 587 clean: 588 @$(ECHO) Cleaning... $(CLRRST) 589 !if "$(PATH_TARGET)" != "" # paranoia 590 \ 591 ! ifndef BUILD_VERBOSE 592 @ \ 593 ! endif 594 $(TOOL_RM) \ 595 $(PATH_TARGET)\*.$(EXT_OBJ) \ 596 $(PATH_TARGET)\*.$(EXT_ILIB) \ 597 $(PATH_TARGET)\*.$(EXT_EXE) \ 598 $(PATH_TARGET)\*.$(EXT_DLL) \ 599 $(PATH_TARGET)\*.$(EXT_RES) 600 \ 601 ! ifndef BUILD_VERBOSE 602 @ \ 603 ! endif 604 $(TOOL_RM) \ 605 $(PATH_TARGET)\*.$(EXT_SYS) \ 606 $(PATH_TARGET)\*.$(EXT_LIB) \ 607 $(PATH_TARGET)\*.$(EXT_IFS) \ 608 $(PATH_TARGET)\*.$(EXT_MAP) \ 609 $(PATH_TARGET)\*.$(EXT_SYM) 610 \ 611 ! ifndef BUILD_VERBOSE 612 @ \ 613 ! endif 614 $(TOOL_RM) \ 615 $(PATH_TARGET)\*.s \ 616 $(PATH_TARGET)\*.lst \ 617 $(PATH_TARGET)\*.lnk \ 618 $(PATH_TARGET)\*.ii \ 619 $(PATH_TARGET)\.depend 620 \ 621 ! ifndef BUILD_VERBOSE 622 @ \ 623 ! endif 624 $(TOOL_RM) \ 625 .\*.ii \ 626 .\*.err \ 627 .\.depend 628 !endif 517 629 !ifdef SUBDIRS 518 SUBDIRS_BUILD = subbuild 519 $(SUBDIRS_BUILD): 520 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) build 521 !endif 522 630 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@ 631 !endif 523 632 !ifdef PREMAKEFILES 524 PREMAKEFILES_BUILD = premakefiles_build 525 $(PREMAKEFILES_BUILD): 526 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) build 527 !endif 528 529 build: $(SUBDIRS_BUILD) $(PREMAKEFILES_BUILD) $(TARGET) $(TARGET_ILIB) $(TARGET_PUBNAME) 530 @$(ECHO) Successfully Built $(CLRFIL)$(TARGET) $(TARGET_ILIB)$(CLRRST) 633 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@ 634 !endif 635 !ifdef POSTMAKEFILES 636 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@ 637 !endif 638 !endif #!TESTCASE 639 640 641 642 # ----------------------------------------------------------------------------- 643 # Pass 1 - The dep rule - Make dependencies. 644 # ----------------------------------------------------------------------------- 645 dep: 646 @$(ECHO) Making dependencies... $(CLRRST) 647 \ 648 !ifndef BUILD_VERBOSE 649 @ \ 650 !endif 651 !if "$(TARGET_MODE)" != "EMPTY" && "$(TARGET_MODE)" != "TESTCASE" 652 $(TOOL_DEP) $(TOOL_DEP_FLAGS) -o$$(PATH_TARGET) -d$(TARGET_DEPEND)\ 653 ! ifdef TARGET_NO_DEP 654 -x$(TARGET_NO_DEP: =;)\ 655 ! endif 656 $(TOOL_DEP_FILES) 657 !endif 658 !ifdef SUBDIRS 659 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@ 660 !endif 661 !ifdef PREMAKEFILES 662 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@ 663 !endif 664 !ifdef POSTMAKEFILES 665 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@ 666 !endif 667 668 669 670 # ----------------------------------------------------------------------------- 671 # Pass 2 - The lib rule - Make libraries. 672 # ----------------------------------------------------------------------------- 673 !ifdef SUBDIRS 674 SUBDIRS_LIB = _subdir_lib 675 $(SUBDIRS_LIB): 676 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) lib 677 !endif 678 679 !ifdef PREMAKEFILES 680 PREMAKEFILES_LIB = _premakefiles_lib 681 $(PREMAKEFILES_LIB): 682 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) lib 683 !endif 684 685 lib: $(SUBDIRS_LIB) $(PREMAKEFILES_LIB) \ 686 !if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB" 687 $(TARGET) $(TARGET_PUBNAME) \ 688 !endif 689 $(TARGET_ILIB) 531 690 !ifdef POSTMAKEFILES 532 691 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@ … … 536 695 537 696 # ----------------------------------------------------------------------------- 538 # The lib rule - Make Public libraries. 539 # Must take into account any subdirectories and makefiles which is is to be 540 # made before and after the target. That makes it kind of messy, sorry. 697 # Pass 3 - The executable rule - Build the executables. 541 698 # ----------------------------------------------------------------------------- 542 699 !ifdef SUBDIRS 543 SUBDIRS_ LIB = subdir_lib544 $(SUBDIRS_ LIB):545 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) lib700 SUBDIRS_EXECUTABLE = _subdir_executable 701 $(SUBDIRS_EXECUTABLE): 702 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) executable 546 703 !endif 547 704 548 705 !ifdef PREMAKEFILES 549 PREMAKEFILES_LIB = premakefiles_lib 550 $(PREMAKEFILES_LIB): 551 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) lib 552 !endif 553 554 !if "$(TARGET_PUBLIC_PART)" != "" && ("$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB") 555 lib: $(SUBDIRS_LIB) $(TARGET_ILIB) $(TARGET) $(TARGET_PUBNAME) 706 PREMAKEFILES_EXECUTABLE = _premakefiles_executable 707 $(PREMAKEFILES_EXECUTABLE): 708 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) executable 709 !endif 710 711 executable: \ 712 !if "$(TARGET_MODE)" != "LIB" && "$(TARGET_MODE)" != "SYSLIB" && "$(TARGET_MODE)" != "IFSLIB" 713 $(SUBDIRS_EXECUTABLE) $(PREMAKEFILES_EXECUTABLE) $(TARGET) $(TARGET_PUBNAME) 714 @$(ECHO) Successfully Built $(CLRFIL)$(TARGET)$(CLRRST) 556 715 !else 557 lib: $(SUBDIRS_LIB) $(TARGET_ILIB)716 $(SUBDIRS_EXECUTABLE) $(PREMAKEFILES_EXECUTABLE) 558 717 !endif 559 718 !ifdef POSTMAKEFILES … … 564 723 565 724 # ----------------------------------------------------------------------------- 566 # The install rule - Copies target to main binary directory. 725 # Pass 4 - The miscellaneous rule - Makes other miscellaneous stuff like 726 # documentations etc. This is experimental for the moment. 727 # ----------------------------------------------------------------------------- 728 !ifdef SUBDIRS 729 SUBDIRS_MISC = _subdir_misc 730 $(SUBDIRS_MISC): 731 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) miscellaneous 732 !endif 733 734 !ifdef PREMAKEFILES 735 PREMAKEFILES_MISC = _premakefiles_misc 736 $(PREMAKEFILES_MISC): 737 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) miscellaneous 738 !endif 739 740 miscellaneous: $(SUBDIRS_MISC) $(PREMAKEFILES_MISC) \ 741 $(TARGET_DOCS) $(TARGET_MISC) 742 !if "$(TARGET_DOCS)$(TARGET_MISC)" != "" 743 @$(ECHO) Successfully Built $(CLRFIL)$(TARGET_DOCS) $(TARGET_MISC)$(CLRRST) 744 !else 745 !endif 746 !ifdef POSTMAKEFILES 747 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@ 748 !endif 749 750 751 752 # ----------------------------------------------------------------------------- 753 # Pass 5 - The install rule - Copies target to main binary directory. 567 754 # Installation order is not concidered vital, so subdirectories and 568 755 # pre-makefiles are processed after this directory. This might be changed. … … 616 803 617 804 805 # ----------------------------------------------------------------------------- 806 # Pass x - The testcase rule - Execute testcases when present. 807 # Testcases are either a testcase.mak file or a testcase subdirectory. 808 # ----------------------------------------------------------------------------- 618 809 !if "$(TARGET_MODE)" != "TESTCASE" 619 810 !ifndef BUILD_OWN_TESTCASE_RULE … … 625 816 _TESTCASE_TST2 = exists(testcase.mak) != 0 626 817 !endif 627 # ----------------------------------------------------------------------------- 628 # The testcase rule - Execute testcases when present. 629 # Testcases are either a testcase.mak file or a testcase subdirectory. 630 # ----------------------------------------------------------------------------- 818 631 819 testcase: 820 @$(ECHO) Executing testcases $(CLRRST) 632 821 !if $(_TESTCASE_TST1) 633 822 @$(TOOL_DODIRS) "testcase" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@ … … 651 840 652 841 # ----------------------------------------------------------------------------- 842 # The target rule - Build the target. 843 # Note: This also builds libraries in subdirectories and submakefiles. 844 # ----------------------------------------------------------------------------- 845 !ifdef SUBDIRS 846 SUBDIRS_TARGET = _subdir_target 847 $(SUBDIRS_TARGET): 848 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) target 849 !endif 850 851 !ifdef PREMAKEFILES 852 PREMAKEFILES_TARGET = _premakefiles_target 853 $(PREMAKEFILES_TARGET): 854 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) target 855 !endif 856 857 target: $(SUBDIRS_TARGET) $(PREMAKEFILES_TARGET) $(TARGET) $(TARGET_ILIB) $(TARGET_PUBNAME) 858 @$(ECHO) Successfully Built $(CLRFIL)$(TARGET) $(TARGET_ILIB)$(CLRRST) 859 !ifdef POSTMAKEFILES 860 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@ 861 !endif 862 863 864 865 # ----------------------------------------------------------------------------- 653 866 # The shell rule - Setup the correcte shell environment and start a shell. 654 867 # ----------------------------------------------------------------------------- 655 868 shell: 869 @$(ECHO) Creating work shell $(CLRRST) 656 870 \ 657 871 !ifndef BUILD_VERBOSE … … 664 878 665 879 # ----------------------------------------------------------------------------- 666 # The dep rule - Make dependencies.667 # -----------------------------------------------------------------------------668 dep:669 @$(ECHO) Building dependencies $(CLRRST)670 \671 !ifndef BUILD_VERBOSE672 @ \673 !endif674 !if "$(TARGET_MODE)" != "EMPTY" && "$(TARGET_MODE)" != "TESTCASE"675 $(TOOL_DEP) $(TOOL_DEP_FLAGS) -o$$(PATH_TARGET) -d$(TARGET_DEPEND)\676 ! ifdef TARGET_NO_DEP677 -x$(TARGET_NO_DEP: =;)\678 ! endif679 $(TOOL_DEP_FILES)680 !endif681 !ifdef SUBDIRS682 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@683 !endif684 !ifdef PREMAKEFILES685 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@686 !endif687 !ifdef POSTMAKEFILES688 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@689 !endif690 691 692 693 # -----------------------------------------------------------------------------694 # The clean rule - Clean up output files.695 # The current setup doesn't clean the installed ones.696 # -----------------------------------------------------------------------------697 !if "$(TARGET_MODE)" != "TESTCASE"698 clean:699 !if "$(PATH_TARGET)" != "" # paranoia700 $(TOOL_RM) \701 $(PATH_TARGET)\*.$(EXT_OBJ) \702 $(PATH_TARGET)\*.$(EXT_ILIB) \703 $(PATH_TARGET)\*.$(EXT_EXE) \704 $(PATH_TARGET)\*.$(EXT_DLL) \705 $(PATH_TARGET)\*.$(EXT_RES)706 $(TOOL_RM) \707 $(PATH_TARGET)\*.$(EXT_SYS) \708 $(PATH_TARGET)\*.$(EXT_LIB) \709 $(PATH_TARGET)\*.$(EXT_IFS) \710 $(PATH_TARGET)\*.$(EXT_MAP) \711 $(PATH_TARGET)\*.$(EXT_SYM)712 $(TOOL_RM) \713 $(PATH_TARGET)\*.s \714 $(PATH_TARGET)\*.lst \715 $(PATH_TARGET)\*.lnk \716 $(PATH_TARGET)\*.ii \717 $(PATH_TARGET)\.depend718 $(TOOL_RM) \719 .\*.ii \720 .\*.err \721 .\.depend722 !endif723 !ifdef SUBDIRS724 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@725 !endif726 !ifdef PREMAKEFILES727 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@728 !endif729 !ifdef POSTMAKEFILES730 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@731 !endif732 !endif #!TESTCASE733 734 735 736 # -----------------------------------------------------------------------------737 880 # The nothing rule - Rule for testing the makefile structure. 738 881 # ----------------------------------------------------------------------------- 739 882 nothing: 883 @$(ECHO) Doing nothing in $(MAKEFILE). 740 884 !ifdef SUBDIRS 741 885 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@ … … 909 1053 910 1054 911 # 1055 # ----------------------------------------------------------------------------- 912 1056 # Copy rule for public targets. 913 # 1057 # Normally used for public libraries, but may be used for other purposes... 1058 # ----------------------------------------------------------------------------- 914 1059 !if "$(TARGET_PUBNAME)" != "" 915 1060 $(TARGET_PUBNAME): $(TARGET) … … 931 1076 932 1077 # ----------------------------------------------------------------------------- 933 # The $(TARGET) rule - For EMPTY targets. 934 # ----------------------------------------------------------------------------- 935 # this doesn't work as we don't have a target name. Hence not needed. 936 #!if "$(TARGET_MODE)" == "EMPTY" 937 #$(TARGET): 938 # @$(ECHO) . 939 #!endif 1078 # The $(TARGET) rule - For DEPEND targets. 1079 # ----------------------------------------------------------------------------- 940 1080 !if "$(TARGET_MODE)" == "DEPEND" 941 1081 $(TARGET):
Note:
See TracChangeset
for help on using the changeset viewer.