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

  1. $    SAVE_VERIFY = 'F$VERIFY(0) + F$VERIFY(0'CKVKER_VERIFY' .GT. 0)
  2. $    ON CONTROL_Y THEN GOTO ABNORMAL_EXIT
  3. $    ON WARNING THEN GOTO ABNORMAL_EXIT
  4. $!
  5. $! CKVKER.COM    1.0 (002) 25-June-1985
  6. $!
  7. $! Build Kermit modules.
  8. $!
  9. $! Note: this command file implements a very limited "make" capability.
  10. $! If you change ckwart.c, you must delete ckwart.exe
  11. $! If you change any header files, you must delete all .obj files.
  12. $!
  13. $! IF YOU HAVE TROUBLE COMPILING OR RUNNING SOME OF THE GENERATED CODE,
  14. $! TRY COMPILING WITHOUT OPTIMIZATION.
  15. $!
  16. $! input:
  17. $!    CKVKER_VERIFY    If defined and positive, causes verification
  18. $!            of this command file.
  19. $!    CC_OPTIONS    Optional list of qualifiers for use when compiling
  20. $!            (e.g., "/list/debug=all", "/define=xxx", etc.).
  21. $!            Remember to enclose symbol names, etc. in quotes
  22. $!            so that DCL won't convert them to uppercase.
  23. $!
  24. $! Modifications:
  25. $!
  26. $!    25-Jun-85    Allow external specification of CC options, and
  27. $!            provide some defaults.
  28. $!                            -- Dan Schullman
  29. $!
  30. $!    24-Jun-85    Automatically determine C Run-Time library to use.
  31. $!            Save and restore verification, and exit on errors.
  32. $!            Display additional "progress" information.
  33. $!            Avoid use of LNK$LIBRARY in case user had it defined.
  34. $!            Use CCMAKE to compile CKCPRO and CKWART.
  35. $!                            -- Dan Schullman
  36. $!
  37. $! Define command to be used in conditionally compiling C sources.
  38. $!
  39. $    IF "''CCMAKE'" .EQS. "" THEN CCMAKE = "@CKVMAK.COM"
  40. $!
  41. $! Determine which version of the C compiler is being used,
  42. $! and define version-specific stuff.
  43. $!
  44. $    CC_VER_OPTS = "/DEFINE=(""DEBUG"",""TLOG"")"    !V2 options
  45. $    C_LIBRARY = "SYS$LIBRARY:VAXCRTL.OLB"        !V2 lib
  46. $    IF F$SEARCH(C_LIBRARY) .NES. "" THEN GOTO FOUND_LIB
  47. $!
  48. $    CC_VER_OPTS = ""                !V1 options
  49. $    C_LIBRARY = "SYS$LIBRARY:CRTLIB.OLB"        !V1 lib
  50. $    IF F$SEARCH(C_LIBRARY) .NES. "" THEN GOTO FOUND_LIB
  51. $!
  52. $    WRITE SYS$OUTPUT "Unable to locate C Run-Time Library."
  53. $    GOTO ABNORMAL_EXIT
  54. $FOUND_LIB:
  55. $    WRITE SYS$OUTPUT "Using ",C_LIBRARY," as the C Run-Time Library."
  56. $!
  57. $! Define CC options to be used, if not explicitly supplied.
  58. $!
  59. $    IF "''CC_OPTIONS'" .EQS. "" -
  60.       THEN CC_OPTIONS = "/NOLIST" + CC_VER_OPTS
  61. $    WRITE SYS$OUTPUT "Using CC options of ",CC_OPTIONS,"."
  62. $!
  63. $    CCMAKE CKCFN2.C "" 'CC_OPTIONS'
  64. $    CCMAKE CKCFNS.C "" 'CC_OPTIONS'
  65. $    CCMAKE CKCMAI.C "" 'CC_OPTIONS'
  66. $!
  67. $    IF F$SEARCH("CKWART.EXE") .EQS. ""    THEN GOTO DO_WART
  68. $    IF F$SEARCH("CKCPRO.C") .EQS. ""    THEN GOTO DO_WART
  69. $    IF F$SEARCH("CKCPRO.OBJ") .EQS. ""    THEN GOTO DO_WART
  70. $    SRC_TIME = F$FILE_ATTRIBUTES("CKCPRO.W", "CDT") ! get creation time
  71. $    OUT_TIME = F$FILE_ATTRIBUTES("CKCPRO.OBJ", "CDT") ! for both files.
  72. $    IF F$CVTIME(SRC_TIME) .GES. F$CVTIME(OUT_TIME) THEN GOTO DO_WART
  73. $    WRITE SYS$OUTPUT "CKCPRO.OBJ", " is up to date."
  74. $    GOTO DONE_WART
  75. $DO_WART:
  76. $    IF F$SEARCH("CKWART.EXE") .NES. "" THEN GOTO GOT_WART
  77. $!    CCMAKE CKWART.C "" 'CC_OPTIONS'/NOOPTIMIZATION
  78. $    CCMAKE CKWART.C "" 'CC_OPTIONS'
  79. $    WRITE SYS$OUTPUT "Linking WART..."
  80. $    LINK/EXECUTABLE=CKWART/NOMAP -
  81.       CKWART.OBJ,'C_LIBRARY'/LIBRARY
  82. $GOT_WART:
  83. $    WRITE SYS$OUTPUT "Executing WART..."
  84. $    WART = "$SYS$DISK:[]CKWART"
  85. $    WART CKCPRO.W CKCPRO.C
  86. $    CCMAKE CKCPRO.C "" 'CC_OPTIONS'
  87. $DONE_WART:
  88. $!
  89. $    CCMAKE CKUCMD.C "" 'CC_OPTIONS'
  90. $    CCMAKE CKUDIA.C "" 'CC_OPTIONS'
  91. $    CCMAKE CKUSCR.C "" 'CC_OPTIONS'
  92. $    CCMAKE CKUUS2.C "" 'CC_OPTIONS'
  93. $    CCMAKE CKUUS3.C "" 'CC_OPTIONS'
  94. $    CCMAKE CKUUSR.C "" 'CC_OPTIONS'
  95. $    CCMAKE CKVCON.C "" 'CC_OPTIONS'
  96. $    CCMAKE CKVFIO.C "" 'CC_OPTIONS'
  97. $    CCMAKE CKVTIO.C "" 'CC_OPTIONS'
  98. $    WRITE SYS$OUTPUT "Linking WERMIT..."
  99. $    LINK/EXECUTABLE=WERMIT/NOMAP -
  100.       CKCFN2,CKCFNS,CKCMAI,CKCPRO,CKUCMD,CKUDIA,CKUSCR,-
  101.       CKUUS2,CKUUS3,CKUUSR,CKVCON,CKVFIO,CKVTIO, -
  102.       'C_LIBRARY'/LIBRARY
  103. $    GOTO NORMAL_EXIT
  104. $!
  105. $! Abnormal exit.
  106. $!
  107. $ABNORMAL_EXIT:
  108. $    STATUS = $STATUS            !save failure status
  109. $    IF STATUS THEN STATUS = "%X08000002"    !force error if neccessary
  110. $    GOTO EXIT
  111. $!
  112. $! Normal exit.
  113. $!
  114. $NORMAL_EXIT:
  115. $    STATUS = $STATUS            !save success status
  116. $!
  117. $! Exit.
  118. $!
  119. $EXIT:
  120. $    EXIT ('STATUS' .OR. %X10000000) + F$VERIFY(SAVE_VERIFY) * 0
  121.