home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / FUNNEL_S / ADMIN / VMS_BLD.COM < prev   
Text File  |  1992-05-27  |  4KB  |  121 lines

  1. $! VMSBUILD.COM         Build the Funnelweb program under VMS
  2. $!
  3. $!      J Begg  VSM Software Services   11-Feb-1992     jeremy@vsm.com.au
  4. $!
  5. $! set verify
  6. $       set noon
  7. $       say     = "write sys$output"
  8. $       sts     = 1
  9. $
  10. $!
  11. $! Make sure we are in the sources directory -- Assumes this procedure is in
  12. $! the same directory as the sources.
  13. $!
  14. $       cur_def = f$env("DEFAULT")
  15. $       proc    = f$env("PROCEDURE")
  16. $       procnam = proc - f$parse(proc,,,"VERSION")
  17. $       procdir = proc - f$parse(proc,,,"NAME")    -
  18.                        - f$parse(proc,,,"TYPE")    -
  19.                        - f$parse(proc,,,"VERSION")
  20. $       sourcedir = procdir - "ADMIN]" + "SOURCES]"
  21. $       if f$search(sourcedir+"WEAVE.C").eqs.""
  22. $       then
  23. $           say "It would appear that the FunnelWeb sources have not been"
  24. $           say "loaded into the correct directory.  Please move them into"
  25. $           say "       ", procdir
  26. $           say "then re-execute this procedure."
  27. $           goto Exit
  28. $       endif
  29. $
  30. $       set default 'sourcedir'
  31.  
  32. $       show default
  33. $
  34. $!
  35. $! Check for VAX C, use GNU C if VAX C is not found
  36. $!
  37. $       if f$search("SYS$SYSTEM:VAXC.EXE").nes.""
  38. $       then
  39. $           say "   Using VAX C.  If you prefer to use GNU C, edit the file"
  40. $           say "   ",procnam
  41. $           say "   as instructed therein."
  42. $           use_VAXC = "true"
  43. $       else
  44. $           say "   VAX C not found -- using GNU C."
  45. $           use_VAXC = "false"
  46. $       endif
  47. $
  48. $!*************************************************************************
  49. $! UNCOMMENT the following line to force use of VAX C                    !*
  50. $!      use_VAXC = "true"                                                !*
  51. $! UNCOMMENT the following line to force use of GNU C                    !*
  52. $!      use_VAXC = "false"                                               !*
  53. $!*************************************************************************
  54. $!
  55. $! Set up the appropriate symbols
  56. $!
  57. $       if use_VAXC
  58. $       then
  59. $           cc = "CC"
  60. $           cflags = "/DEBUG/WARN/NOOPT/LIST"
  61. $       else
  62. $           cc = "GCC"
  63. $           cflags = " -g -Wall"
  64. $       endif
  65. $
  66. $       link = "link"
  67. $
  68. $!
  69. $! An object library is used to hold .OBJ files along the way.
  70. $!
  71. $       if f$search("FUNNELWEB.OLB").eqs."" then $ lib/cre/obj funnelweb.olb
  72. $
  73. $ if "''p1'" .eqs. "LINK" then $ goto Done_Compile
  74. $!
  75. $! Search for .C files, compiling same.
  76. $!
  77. $       old_src = ""
  78. $       filecount = 0
  79. $       skiptofile = ""
  80. $       if "''p1'" .nes. ""
  81. $       then
  82. $          skiptofile = "$USERS:[ROSS.FWDIR.SOURCES]''p1'"
  83. $       endif
  84. $Compile:
  85. $       src = f$search("*.C")
  86. $       if src.eqs."" then $ goto Done_Compile
  87. $       if src.eqs.old_src then $ goto Done_Compile
  88. $       srcnam = src - f$parse(src,,,"TYPE") - f$parse(src,,,"VERSION")
  89. $       if srcnam .lts. skiptofile
  90. $       then
  91. $          write sys$output "Skipping ''srcnam'"
  92. $          goto Compile
  93. $       endif
  94. $       say "Compiling ",srcnam
  95. $       'cc 'cflags 'srcnam
  96. $       if .not.$status then $ goto Compile_Failed
  97. $       lib/repl funnelweb 'srcnam
  98. $       deletx 'srcnam'.obj;
  99. $       goto Compile
  100. $
  101. $Compile_Failed:
  102. $       sts = $status
  103. $       say "Build of FunnelWeb aborted because compile failed for file:"
  104. $       say src
  105. $       goto Exit
  106. $
  107. $Done_Compile:
  108. $       say "Linking..."
  109. $       cur_exe = f$search("FUNNELWEB.EXE")
  110. $       !Jeremy's link: link/debug/map/full funnelweb/opt
  111. $       link funnelweb/library/include=main,sys$input:/opt/exe='procdir'fw.exe
  112. sys$share:vaxcrtl/share
  113. $       if $status then $ goto Exit
  114. $       sts = $status
  115. $       say "Build of FunnelWeb aborted in Link phase"
  116. $       if f$search("FUNNELWEB.EXE").nes.cur_exe then $ delete funnelweb.exe;
  117. $
  118. $Exit:
  119. $       set default 'cur_def'
  120. $       exit sts
  121.