home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Add-Ons / MPW / MPW dmake 4.0 / BuildCommands < prev    next >
Encoding:
Text File  |  1995-12-05  |  1.4 KB  |  61 lines  |  [TEXT/MPS ]

  1. #    BuildCommands - show build commands
  2. #
  3. #    Usage:
  4. #        BuildCommands program [options…] > commands
  5. #
  6. #    The BuildCommands script writes the build commands for the specified
  7. #    program (or target) to standard output.
  8. #
  9. #    Make is used to generate the build commands.  If file <program>.make
  10. #    exists it is used as the makefile.    If not, file MakeFile is used.
  11. #
  12. #    The options specified are passed directly to Make, and control the
  13. #    generation of the build commands.
  14. #
  15. #
  16. #    Copyright Apple Computer, Inc. 1987 - 1990
  17. #    All rights reserved.
  18. #
  19. #    Modified for dmake by Matthias Neeracher
  20. #
  21.  
  22. #    Find the program parameter.
  23.  
  24. Unset program
  25. For i In {"Parameters"}
  26.     If "{i}" !~ /-≈/
  27.         Set program "{i}"
  28.         Break
  29.     End
  30. End
  31. If "{program}" == ""
  32.     Echo "### {0} - Specify a program to build." > Dev:StdErr
  33.     Echo "# Usage - {0} program [options…]" > Dev:StdErr
  34.     Exit 1
  35. End
  36.  
  37. #    Select the makefile.
  38.  
  39. Set makefile `(Files -t TEXT "{program}".mk || ∂
  40.     Files -t TEXT "{program}".make || ∂
  41.     Files -t TEXT makefile.mk || ∂
  42.     Files -t TEXT MakeFile || ∂
  43.     Echo '""') ≥ Dev:Null`
  44. If "{makefile}" == ""
  45.     Echo "### {0} - No makefile exists for {program}." > Dev:StdErr
  46.     Exit 1
  47. Else if "{makefile}" =~ /≈.mk/
  48.     Set Make "dmake -n"
  49.     if "{1}" == "-e"
  50.         set everything -u
  51.         shift
  52.     end
  53. Else
  54.     Set Make "Make"
  55. End
  56.  
  57. #    Run Make.
  58.  
  59. Echo "# `Date -t` ----- Build commands for {program}."
  60. {Make} {Everything} {"Parameters"} -f "{makefile}"
  61.