home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckc072.zip / ckvmak.com < prev    next >
Text File  |  1988-08-16  |  2KB  |  72 lines

  1. $    SAVE_VERIFY = 'F$VERIFY(0) + F$VERIFY(0'CKVMAK_VERIFY' .GT. 0)
  2. $    ON CONTROL_Y THEN GOTO ABNORMAL_EXIT
  3. $    ON WARNING THEN GOTO ABNORMAL_EXIT
  4. $!
  5. $! CKVMAK.COM    1.0 (001)+ 24-June-1985
  6. $!
  7. $! The SOURCE file is processed to create the OUTPUT file.  This command
  8. $! checks creation dates and does not compile if both files are present
  9. $! and the OUTPUT file is newer (younger) than the SOURCE file.
  10. $!
  11. $! Usage:
  12. $!
  13. $!    CKVMAK [SOURCE [OUTPUT [P3]]]
  14. $!
  15. $! input:
  16. $!    P1    Source file specification.
  17. $!    P2    Output file specification.  The name defaults to that
  18. $!        of the source file, and the type defaults to ".OBJ".
  19. $!    P3    Additional qualifiers for the CC command.
  20. $!    CKVMAK_VERIFY    If defined and positive, causes verification
  21. $!            of this command file.
  22. $!
  23. $! Modifications
  24. $!
  25. $!    24-Jun-85    Save and restore verification, and exit on any
  26. $!            errors.  Use F$PARSE to default the name and
  27. $!            type of the output file. -- Dan Schullman
  28. $!
  29. $    SOURCE = P1
  30. $    IF SOURCE .EQS. "" THEN INQUIRE SOURCE "C Source File"
  31. $    SOURCE = F$PARSE(SOURCE,".C")
  32. $    OUTPUT = F$PARSE(P2,".OBJ",SOURCE)
  33. $!
  34. $! Continue at must_process if either file is missing or the source is younger
  35. $! A missing SOURCE is, of course, an error -- but one that should be
  36. $! caught by the "normal" command.
  37. $!
  38. $    IF F$SEARCH(SOURCE) .EQS. "" THEN GOTO MUST_PROCESS
  39. $    IF F$SEARCH(OUTPUT) .EQS. "" THEN GOTO MUST_PROCESS
  40. $    SRC_TIME = F$FILE_ATTRIBUTES(SOURCE, "CDT")    ! get creation time
  41. $    OUT_TIME = F$FILE_ATTRIBUTES(OUTPUT, "CDT")    !   for both files.
  42. $    IF F$CVTIME(SRC_TIME) .GES. F$CVTIME(OUT_TIME) THEN GOTO MUST_PROCESS
  43. $    WRITE SYS$OUTPUT OUTPUT," is up to date."
  44. $    GOTO NORMAL_EXIT
  45. $!
  46. $! Come here to build OUTPUT from SOURCE
  47. $!
  48. $MUST_PROCESS:
  49. $!
  50. $! Insert commands to create OUTPUT from SOURCE here, for example:
  51. $!
  52. $    WRITE SYS$OUTPUT OUTPUT, " <= ", SOURCE
  53. $    CC/NOLIST/OBJECT='OUTPUT''P3' 'SOURCE'
  54. $    GOTO NORMAL_EXIT
  55. $!
  56. $! Abnormal exit.
  57. $!
  58. $ABNORMAL_EXIT:
  59. $    STATUS = $STATUS            !save failure status
  60. $    IF STATUS THEN STATUS = "%X08000002"    !force error if neccessary
  61. $    GOTO EXIT
  62. $!
  63. $! Normal exit.
  64. $!
  65. $NORMAL_EXIT:
  66. $    STATUS = $STATUS            !save success status
  67. $!
  68. $! Exit.
  69. $!
  70. $EXIT:
  71. $    EXIT ('STATUS' .OR. %X10000000) + F$VERIFY(SAVE_VERIFY) * 0
  72.