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