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
|
$! BUILD.COM
$! Creates Ftnchek from source code for VMS systems
$! This script uses CC.COM and LINK.COM to check whether target
$! is up to date, giving effect of a crude make utility.
$!
$ On Control_Y Then GoTo The_Exit
$ On Error Then GoTo The_Exit
$! DISABLED at ftnchek 2.8: On Warning Then GoTo The_Exit
$!
$! First, create the right environment for compilation.
$ IF F$SEARCH("vaxc.opt") .EQS. ""
$ THEN! Create option file for shareable image: makes executable smaller
$ COPY SYS$INPUT vaxc.opt
sys$library:vaxcrtl/share
$ ENDIF
$ DEFINE lnk$library sys$library:vaxcrtl ! simplest runtime library
$!
$! Now compile everything and link it all. The /DEFINE is not actually
$! needed since VMS is a predefined symbol in VAX C.
$! If you have xmalloc/xrealloc, remove the /DEFINE from shell_mung
$! line and add them to the list of objs to link.
$! The CC.COM script is used in place of CC command so that if something
$! is changed, BUILD can be re-run and only re-compiles what changed.
$! Invocation: @CC PROG DEPENDENCIES [/CFLAGS...]
$ IF F$SEARCH("shell_mung.c") .EQS. ""
$ THEN! If shell_mung not found, work around it and tell the user
$ WRITE SYS$OUTPUT "SHELL_MUNG.C not found: wildcard expansion will not be"
$ WRITE SYS$OUTPUT "done. SHELL_MUNG.C is distributed separately."
$ @CC ftnchek ftnchek.h /DEFINE=(VMS)
$ ELSE
$ @CC ftnchek ftnchek.h /DEFINE=(VMS,USE_SHELL_MUNG)
$ @CC shell_mung "" /DEFINE=("xmalloc=malloc","xrealloc=realloc")
$ ENDIF
$ @CC exprtype ftnchek.h,keywords.h,symtab.h,tokdefs.h /DEFINE=(VMS)
$ @CC forlex ftnchek.h,symtab.h,tokdefs.h /DEFINE=(VMS)
$ @CC fortran ftnchek.h,symtab.h,tokdefs.h /DEFINE=(VMS)
$ @CC pgsymtab ftnchek.h,symtab.h /DEFINE=(VMS)
$ @CC plsymtab ftnchek.h,symtab.h /DEFINE=(VMS)
$ @CC project ftnchek.h,symtab.h /DEFINE=(VMS)
$ @CC symtab ftnchek.h,iokeywds.h,intrins.h,symtab.h,tokdefs.h /DEFINE=(VMS)
$ IF F$SEARCH("shell_mung.c") .EQS. ""
$ THEN
$ @LINK ftnchek,forlex,fortran,pgsymtab,plsymtab,symtab,exprtype,project
$ ELSE
$ @LINK ftnchek,forlex,fortran,pgsymtab,plsymtab,symtab,exprtype,project,-
shell_mung
$ ENDIF
$ WRITE SYS$OUTPUT "Ftnchek created"
$ WRITE SYS$OUTPUT "To make it runnable as a command"
$ WRITE SYS$OUTPUT "say $ FTNCHEK :== $diskname:[pathname]FTNCHEK"
$ On Control_Y Then GoTo Help_Exit
$ On Warning Then GoTo Help_Exit
$! Create the help library.
$ LIBR/CREATE/HELP FTNCHEK.HLB FTNCHEK.HLP
$ WRITE SYS$OUTPUT "Help library created -- to access it via HELP"
$ WRITE SYS$OUTPUT "say $ DEFINE HLP$LIBRARY diskname:[pathname]FTNCHEK.HLB"
$ EXIT
$ Help_Exit:
$ Set NoVerify
$ WRITE SYS$OUTPUT "Error- help library not created"
$ EXIT
$ The_Exit:
$ Set NoVerify
$ WRITE SYS$OUTPUT "Error- BUILD failed."
|