home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / software / unix / saoimage / sao1_07.tar / make.com < prev    next >
Text File  |  1991-06-04  |  3KB  |  162 lines

  1. $!-------------------------------------------------------------------------
  2. $!
  3. $! MAKE.COM - Build SAOimage on a VMS system
  4. $!
  5. $!    Parameters:
  6. $!        P1    null    Build everything
  7. $!            LINK    Link SAOIMAGE.EXE
  8. $!            CLEAN    Clean up build residue
  9. $!            xxx    Source module - compile and update library
  10. $!        P2    options    If P1=LINK, VMS Linker option (e.g. /DEBUG)
  11. $!                If P1=source module, CC compiler option
  12. $!
  13. $!-------------------------------------------------------------------------
  14. $
  15. $
  16. $ gosub BUILD_SETUP
  17. $
  18. $ if p1 .eqs. ""     then goto BUILD_ALL
  19. $ if p1 .eqs. "LINK" then goto LINK_ONLY
  20. $ if p1 .eqs. "CLEAN" then goto DISPOSE
  21. $ gosub COMPILE_MODULE
  22. $ exit
  23. $
  24. $
  25. $BUILD_SETUP:
  26. $
  27. $ set noon
  28. $
  29. $ define/nolog  c$include    [.hfiles],decw$include,sys$library
  30. $ define/nolog  vaxc$include c$include
  31. $ define/nolog  X11          decw$include    ! for #include <X11/...>
  32. $ define/nolog  sys          sys$library    ! for #include <sys/...>
  33. $
  34. $ compile := cc/define=(FITS,OIF,IMTOOL,LSB,XV11R2,PSCRIPT,NODEBUG)/nodebug/optimize
  35. $ libname := libsao.olb
  36. $ makefile:= make.lst
  37. $
  38. $ return
  39. $
  40. $
  41. $COMPILE_MODULE:
  42. $
  43. $ p1 = p1 - ".C"
  44. $ compile 'p1' 'p2' 'make_options'
  45. $ library/log 'libname' 'p1'
  46. $
  47. $ return
  48. $
  49. $
  50. $LINK_ONLY:
  51. $
  52. $ if f$locate("/DEBUG",p2) .eqs. f$length(p2)
  53. $ then
  54. $    outname = "SAOIMAGE"
  55. $ else
  56. $    outname = "D_SAOIMAGE"
  57. $ endif
  58. $
  59. $ link 'p2' /nomap='outname' /exe='outname' -
  60.     []libsao/include=maininit/lib, -
  61.     [.btnlib]libbtn/lib, -
  62.     [.vms]libvms/lib, -
  63.     sys$input/opt
  64. sys$share:decw$xlibshr/share
  65. sys$share:vaxcrtl/share
  66. $
  67. $ exit
  68. $
  69. $
  70. $BUILD_ALL:
  71. $
  72. $
  73. $ write sys$output "----- Building local source modules -----"
  74. $
  75. $ if f$search(libname) .eqs. "" then library/create 'libname'
  76. $
  77. $ open/read make_input 'makefile'
  78. $
  79. $ on control_y then goto CLEANUP
  80. $
  81. $ReadLoop:
  82. $ read/end=ReadEOF/err=CLEANUP make_input line
  83. $ first = f$extract(0,1,line)
  84. $ if first .nes. "!" .and. first .nes. "#"
  85. $ then
  86. $    make_options = f$extract(f$locate("/",line),f$length(line),line)
  87. $
  88. $    p1  = f$edit(line,"UPCASE") - ".C" - make_options
  89. $    p1s = p1 + ".C"
  90. $    p1o = p1 + ".OBJ"
  91. $    if f$search(p1s) .eqs. ""
  92. $    then
  93. $        write sys$output p1s + " not found!"
  94. $        goto ReadLoop
  95. $    endif
  96. $    if f$search(p1o) .eqs. "" then goto Recompile
  97. $
  98. $    srcdate = f$file_attributes(p1s,"RDT")
  99. $    objdate = f$file_attributes(p1o,"RDT")
  100. $    bin_srcdate = f$cvtime(srcdate)
  101. $    bin_objdate = f$cvtime(objdate)
  102. $
  103. $    if bin_srcdate .les. bin_objdate
  104. $    then
  105. $        write sys$output "Up-to-date... " + p1
  106. $        goto ReadLoop
  107. $    endif
  108. $Recompile:
  109. $    write sys$output "Compiling... " + p1
  110. $
  111. $ p1 = p1 - ".C"
  112. $ compile 'p1' 'p2' 'make_options'
  113. $ library/log 'libname' 'p1'
  114. $
  115. $ endif
  116. $ goto ReadLoop
  117. $
  118. $ReadEOF:
  119. $ close make_input
  120. $
  121. $
  122. $ write sys$output "----- Building BTNLIB subdirectory -----"
  123. $
  124. $ set default [.btnlib]
  125. $ @make
  126. $ set default [-]
  127. $
  128. $
  129. $ write sys$output "----- Building VMS subdirectory -----"
  130. $
  131. $ set default [.vms]
  132. $ @make
  133. $ set default [-]
  134. $
  135. $
  136. $ write sys$output "----- Building special-case source modules -----"
  137. $
  138. $ set default [.panel]
  139. $
  140. $ libname := [-]libsao.olb
  141. $
  142. $ p1 := MAKEMENU.C
  143. $ write sys$output "Compiling... " + "[.PANEL]" + p1
  144. $ gosub COMPILE_MODULE
  145. $
  146. $ set default [-]
  147. $
  148. $
  149. $ write sys$output "----- Linking SAOimage -----"
  150. $
  151. $ goto LINK_ONLY
  152. $ exit
  153. $
  154. $DISPOSE:
  155. $ delete [...]*.obj;, [...]*.olb;, spool.log;, saoimage.exe;
  156. $ exit
  157. $
  158. $CLEANUP:
  159. $ if f$logical("MAKE_INPUT") .nes. "" then close make_input
  160. $ exit
  161.