home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / software / unix / saoimage / sao1_07.tar / btnlib / make.com < prev    next >
Text File  |  1990-05-12  |  2KB  |  97 lines

  1. $!-------------------------------------------------------------------------
  2. $!
  3. $! MAKE.COM - Build SAOimage Button library
  4. $!
  5. $!    Parameters:
  6. $!        P1    null    Compile and update all sources
  7. $!            xxx    Source module - compile and update library
  8. $!        P2    options    CC compiler options
  9. $!
  10. $!-------------------------------------------------------------------------
  11. $
  12. $
  13. $ gosub BUILD_SETUP
  14. $
  15. $ if p1 .eqs. ""     then goto BUILD_ALL
  16. $
  17. $ gosub COMPILE_MODULE
  18. $ exit
  19. $
  20. $
  21. $BUILD_SETUP:
  22. $
  23. $ set noon
  24. $
  25. $ define/nolog  c$include     [-.hfiles],decw$include,sys$library
  26. $ define/nolog  vaxc$include  c$include
  27. $ define/nolog  X11           decw$include
  28. $ define/nolog  sys           sys$library
  29. $
  30. $ compile := cc/define=(IMTOOL)/nodebug/optimize
  31. $ libname := libbtn.olb
  32. $ makefile:= make.lst
  33. $
  34. $ return
  35. $
  36. $
  37. $COMPILE_MODULE:
  38. $
  39. $ p1 = p1 - ".C"
  40. $ compile 'p1' 'p2' 'make_options'
  41. $ library/log 'libname' 'p1'
  42. $
  43. $ return
  44. $
  45. $
  46. $BUILD_ALL:
  47. $
  48. $ if f$search(libname) .eqs. "" then library/create 'libname'
  49. $
  50. $ open/read make_input 'makefile'
  51. $
  52. $ReadLoop:
  53. $ read/end=ReadEOF/err=CLEANUP make_input line
  54. $ first = f$extract(0,1,line)
  55. $ if first .nes. "!" .and. first .nes. "#"
  56. $ then
  57. $    make_options = f$extract(f$locate("/",line),f$length(line),line)
  58. $
  59. $    p1  = f$edit(line,"UPCASE") - ".C" - make_options
  60. $    p1s = p1 + ".C"
  61. $    p1o = p1 + ".OBJ"
  62. $    if f$search(p1s) .eqs. ""
  63. $    then
  64. $        write sys$output p1s + " not found!"
  65. $        goto ReadLoop
  66. $    endif
  67. $    if f$search(p1o) .eqs. "" then goto Recompile
  68. $
  69. $    srcdate = f$file_attributes(p1s,"RDT")
  70. $    objdate = f$file_attributes(p1o,"RDT")
  71. $    bin_srcdate = f$cvtime(srcdate)
  72. $    bin_objdate = f$cvtime(objdate)
  73. $
  74. $    if bin_srcdate .les. bin_objdate
  75. $    then
  76. $        write sys$output "Up-to-date... " + p1
  77. $        goto ReadLoop
  78. $    endif
  79. $Recompile:
  80. $    write sys$output "Compiling... " + p1
  81. $
  82. $ p1 = p1 - ".C"
  83. $ compile 'p1' 'p2' 'make_options'
  84. $ library/log 'libname' 'p1'
  85. $
  86. $ endif
  87. $ goto ReadLoop
  88. $
  89. $ReadEOF:
  90. $ close make_input
  91. $ exit
  92. $
  93. $
  94. $CLEANUP:
  95. $ if f$logical("MAKE_INPUT") .nes. "" then close make_input
  96. $ exit
  97.