# GETVERSION # adapted from UNIX script # # Generates Rversion.h and RVerDefs.h # # Jago August 2001, Stefano M. Iacus # # needs "sed" to be found at # ftp://sunsite.cnlab-switch.ch/software/platform/macos/src/mpw_c/ # set maj `sed 's/\([^ .]*\).\([^ ]*\) *\(.*\)/\1/' < :::VERSION` set min `sed 's/\([^ .]*\).\([^ ]*\) *\(.*\)/\2/' < :::VERSION` set rev "`sed 's/\([^ .]*\).\([^ ]*\) *\(.*\)/\3/' < :::VERSION`" set pl `echo {min} | sed 's/\..*//'` set sl `echo {min} | sed 's/.*\.//'` set ver `evaluate {maj} * 65536 + {pl} * 256 + {sl}` set y `sed 's/\([^ /]*\).\([^ ]*\) *\(.*\)/\1/' < :::date-stamp` set m `sed 's/\([^ /]*\).\([^ /]*\) *\(.*\)/\2/' < :::date-stamp` set d `sed 's/\([^ /]*\).\([^ /]*\).\([^ \eof]*\)/\3/' < :::date-stamp` >::nil echo "/* Rversion.h. Generated automatically. */" > :Rversion.h echo "#ifndef R_VERSION_H" >> :Rversion.h echo "#define R_VERSION_H" >> :Rversion.h echo "#define R_VERSION {ver}" >> :Rversion.h echo "#define R_Version(v,p,s) (((v) * 65536) + ((p) * 256) + (s))" >> :Rversion.h echo '#define R_MAJOR "'{maj}'"' >> :Rversion.h echo '#define R_MINOR "'{min}'"' >> :Rversion.h echo '#define R_STATUS "'{rev}'"' >> :Rversion.h echo '#define R_YEAR "'{y}'"' >> :Rversion.h echo '#define R_MONTH "'{m}'"' >> :Rversion.h echo '#define R_DAY "'{d}'"' >> :Rversion.h echo '#define R_FILEVERSION '{maj}','{pl}','{sl}',0' >> :Rversion.h echo '#endif /* not R_VERSION_H */' >> :Rversion.h echo >> :Rversion.h echo "/* RVerDefs.h. Generated automatically. */" > :res:RVerDefs.h echo '#define kMajorVersNumber 0x0'{maj} >> :res:RVerDefs.h echo '#define kMinorVersNumber 0x'{pl}{sl} >> :res:RVerDefs.h echo '#define kNonFinalRelease 0x0'{sl} >> :res:RVerDefs.h echo '#define kVersString "'{maj}.{pl}.{sl}'"' >> :res:RVerDefs.h echo '#define kStatusString "'{rev}'"' >> :res:RVerDefs.h