?section ADD^LIST routine
[#IF [#ARGUMENT /VALUE item/ WORD/SPACE/]]
#APPEND bin ADD * FROM [item]
#SET itime [#FILEINFO /MODIFICATION/ [item]]
[#IF itime > ntime |THEN| #SETV ntime itime]

?section BBZIPLIB MACRO
#FRAME
#push bin item ntime itime libtime
#SET ntime 0

#OUTPUT Building [lib]
#APPEND bin CLEAR
add^list CRC32O
add^list CRCTABO
add^list CRYPTO
add^list DEFLATEO
add^list FILEIOO
add^list GLOBALSO
add^list TANDEMO
add^list TANZIPO
add^list TREESO
add^list TTYIOO
add^list UTILO
add^list ZIPFILEO
add^list ZIPUPO
#APPEND bin INFO UNRESOLVED *
#APPEND bin BUILD [lib] ! , LIST * OFF

#SET libtime [#FILEINFO /MODIFICATION/ [lib]]
[#IF libtime < ntime
|THEN|
  #OUTPUT [lib] needs re-building
  BIND /NAME,INV BIN/
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Bound [lib] OK
  | 1         | #OUTPUT [lib]: BIND Failed with Warnings
  | OTHERWISE | #OUTPUT [lib]: BIND Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT [lib] is up to date
]

#UNFRAME

?section BBZIP MACRO
#FRAME
#push bin ziptime build
#SET build 0
#OUTPUT Building %1% with %2% memory model
#APPEND bin CLEAR
#APPEND bin ADD * FROM ZIPO
#APPEND bin select search ($system.system.c%2%, [lib])
#APPEND bin select runnable object on
#APPEND bin select list * off
#APPEND bin set heap 20 pages
#APPEND bin set symbols on
#APPEND bin set saveabend on
#APPEND bin set inspect on
#APPEND bin info unresolved *
#APPEND bin BUILD %1%   !

#SET ziptime [#FILEINFO /MODIFICATION/ %1%]
[#IF ziptime < [#FILEINFO /MODIFICATION/ ZIPO] |THEN|
  #OUTPUT %1% is older than ZIPO
  #SET build -1
]
[#IF ziptime < [#FILEINFO /MODIFICATION/ [lib]] |THEN|
  #OUTPUT %1% is older than [lib]
  #SET build -1
]
[#IF build
|THEN|
  #OUTPUT %1% is out of date, re-building
  BIND /NAME,INV BIN/
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Bound %1% OK
  | 1         | #OUTPUT %1%: BIND Failed with Warnings
  | OTHERWISE | #OUTPUT %1%: BIND Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT %1% is up to date, no re-build required
]

#UNFRAME

?section BBANY MACRO
#FRAME
#push bin memory anytime build
#SET build 0
#SETMANY memory, %2% LARGE
#OUTPUT Building %1% with [memory] memory model
#APPEND bin CLEAR
#APPEND bin ADD * FROM %1%O
#APPEND bin select search ($system.system.c[memory],[lib])
#APPEND bin select runnable object on
#APPEND bin select list * off
#APPEND bin set heap 20 pages
#APPEND bin set symbols on
#APPEND bin set saveabend on
#APPEND bin set inspect on
#APPEND bin info unresolved *
#APPEND bin BUILD %1%   !

#SET anytime [#FILEINFO /MODIFICATION/ %1%]
[#IF anytime < [#FILEINFO /MODIFICATION/ %1%O] |THEN|
  #OUTPUT %1% is older than %1%O
  #SET build -1
]
[#IF anytime < [#FILEINFO /MODIFICATION/ [lib]] |THEN|
  #OUTPUT %1% is older than [lib]
  #SET build -1
]
[#IF build
|THEN|
  #OUTPUT %1% is out of date, re-building
  BIND /NAME,INV BIN/
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Bound %1% OK
  | 1         | #OUTPUT %1%: BIND Failed with Warnings
  | OTHERWISE | #OUTPUT %1%: BIND Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT %1% is up to date, no re-build required
]

#UNFRAME


?section BBUNZIPLIB MACRO
#FRAME
#push bin item ntime itime libtime
#SET ntime 0

#OUTPUT Building [lib]
#APPEND bin CLEAR
add^list CRC32O
add^list CRCTABO
add^list CRYPTO
add^list ENVARGSO
add^list EXPLODEO
add^list EXTRACTO
add^list FILEIOO
add^list GLOBALSO
add^list INFLATEO
add^list LISTO
add^list MATCHO
add^list PROCESSO
add^list TANDEMO
add^list TANUNZO
add^list TTYIOO
add^list UNSHRINO
add^list ZIPINFOO
#APPEND bin INFO UNRESOLVED *
#APPEND bin BUILD [lib] ! , LIST * OFF

#SET libtime [#FILEINFO /MODIFICATION/ [lib]]
[#IF libtime < ntime
|THEN|
  #OUTPUT [lib] needs re-building
  BIND /NAME,INV BIN/
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Bound [lib] OK
  | 1         | #OUTPUT [lib]: BIND Failed with Warnings
  | OTHERWISE | #OUTPUT [lib]: BIND Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT [lib] is up to date
]

#UNFRAME

?section BBUNZIP MACRO
#FRAME
#push bin ziptime build
#SET build 0
#OUTPUT Building %1% with %2% memory model
#APPEND bin CLEAR
#APPEND bin ADD * FROM UNZIPO
#APPEND bin select search ($system.system.c%2%,[lib])
#APPEND bin select runnable object on
#APPEND bin select list * off
#APPEND bin set heap 20 pages
#APPEND bin set symbols on
#APPEND bin set saveabend on
#APPEND bin set inspect on
#APPEND bin info unresolved *
#APPEND bin BUILD %1%   !

#SET ziptime [#FILEINFO /MODIFICATION/ %1%]
[#IF ziptime < [#FILEINFO /MODIFICATION/ UNZIPO] |THEN|
  #OUTPUT %1% is older than UNZIPO
  #SET build -1
]
[#IF ziptime < [#FILEINFO /MODIFICATION/ [lib]] |THEN|
  #OUTPUT %1% is older than [lib]
  #SET build -1
]
[#IF build
|THEN|
  #OUTPUT %1% is out of date, re-building
  BIND /NAME,INV BIN/
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Bound %1% OK
  | 1         | #OUTPUT %1%: BIND Failed with Warnings
  | OTHERWISE | #OUTPUT %1%: BIND Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT %1% is up to date, no re-build required
]

#UNFRAME

?section BBSFXLIB MACRO
#FRAME
#push bin item ntime itime libtime
#SET ntime 0

#OUTPUT Building [lib]
#APPEND bin CLEAR
add^list CRC32O
add^list CRCTABO
add^list EXTRACTX
add^list FILEIOO
add^list GLOBALSO
add^list INFLATEO
add^list MATCHO
add^list PROCESSX
add^list TANDEMO
add^list TANUNZX
add^list TTYIOO
#APPEND bin INFO UNRESOLVED *
#APPEND bin BUILD [lib] ! , LIST * OFF

#SET libtime [#FILEINFO /MODIFICATION/ [lib]]
[#IF libtime < ntime
|THEN|
  #OUTPUT [lib] needs re-building
  BIND /NAME,INV BIN/
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Bound [lib] OK
  | 1         | #OUTPUT [lib]: BIND Failed with Warnings
  | OTHERWISE | #OUTPUT [lib]: BIND Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT [lib] is up to date
]

#UNFRAME

?section BBSFX MACRO
#FRAME
#push bin ziptime build
#SET build 0
#OUTPUT Building %1% with %2% memory model
#APPEND bin CLEAR
#APPEND bin ADD * FROM UNZIPX
#APPEND bin select search ($system.system.c%2%,[lib])
#APPEND bin select runnable object on
#APPEND bin select list * off
#APPEND bin set heap 20 pages
#APPEND bin set symbols on
#APPEND bin set saveabend on
#APPEND bin set inspect on
#APPEND bin info unresolved *
#APPEND bin BUILD %1%   !

#SET ziptime [#FILEINFO /MODIFICATION/ %1%]
[#IF ziptime < [#FILEINFO /MODIFICATION/ UNZIPX] |THEN|
  #OUTPUT %1% is older than UNZIPX
  #SET build -1
]
[#IF ziptime < [#FILEINFO /MODIFICATION/ [lib]] |THEN|
  #OUTPUT %1% is older than [lib]
  #SET build -1
]
[#IF build
|THEN|
  #OUTPUT %1% is out of date, re-building
  BIND /NAME,INV BIN/
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Bound %1% OK
  | 1         | #OUTPUT %1%: BIND Failed with Warnings
  | OTHERWISE | #OUTPUT %1%: BIND Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT %1% is up to date, no re-build required
]

#UNFRAME

?section accel^file MACRO
#FRAME
#PUSH buf
[#IF [#FILEINFO /MODIFICATION/ %1%]
   > [#FILEINFO /MODIFICATION/ %2%]
|THEN|
  #OUTPUT %2% is older than %1%
  #OUTPUT Accelerating %1% to %2%
  AXCEL /IN [general_seg_subvol].DUMMY, OUTV buf/ %1%,%2%
  #OUTPUTV buf
  [#CASE [tacl^completioncode]
  | 0         | #OUTPUT Accelerated %2% OK
  | 1         | #OUTPUT %2%: AXCEL Failed with Warnings
  | OTHERWISE | #OUTPUT %2%: AXCEL Failed with ERRORS !
  ]
|ELSE|
  #OUTPUT %2% is up to date
]

#UNFRAME

?section fup^license ROUTINE
#FRAME
#PUSH #DEFAULTS filename old^user current^user

[#IF [#ARGUMENT /VALUE filename/ FILENAME]]

#SET old^user [#USERNAME [#PROCESSINFO /PAID/]]
#SETV current^user old^user
[#LOOP |WHILE| current^user '<>' "SUPER.SUPER"
               AND NOT [#INPUTEOF]
|DO|
  #OUTPUT Please log on as SUPER.SUPER (CTRL-Y aborts)
  logon SUPER.SUPER
  #SET current^user [#USERNAME [#PROCESSINFO /PAID/]]
  #OUTPUT
]

[#IF current^user '=' "SUPER.SUPER" |THEN|
  #OUTPUT Licensing [filename]
  $SYSTEM.SYSTEM.FUP LICENSE [filename]
]

[#LOOP |WHILE| current^user '<>' old^user
               AND NOT [#INPUTEOF]
|DO|
  #OUTPUT Please log on as [old^user] (CTRL-Y aborts)
  logon [old^user]
  #SET current^user [#USERNAME [#PROCESSINFO /PAID/]]
  #OUTPUT
]

#UNFRAME
