X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=vms%2Fmms2make.pl;h=7795e4a8ab91a6fdee2bff9814b8a4a4cc63b934;hb=e06c4d37e9c075c9a909e0cdf8fdf9d851bbe1a4;hp=54db616c86a5f7d6a897d07b6dea9691efaea0c4;hpb=a0d0e21ea6ea90a22318550944fe6cb09ae10cda;p=p5sagit%2Fp5-mst-13.2.git diff --git a/vms/mms2make.pl b/vms/mms2make.pl index 54db616..7795e4a 100644 --- a/vms/mms2make.pl +++ b/vms/mms2make.pl @@ -1,10 +1,10 @@ #!/usr/bin/perl # # mms2make.pl - convert Descrip.MMS file to Makefile -# Version 2.0 29-Sep-1994 +# Version 2.2 29-Jan-1996 # David Denholm # -# 1.0 06-Aug-1994 Charles Bailey bailey@genetics.upenn.edu +# 1.0 06-Aug-1994 Charles Bailey bailey@newman.upenn.edu # - original version # 2.0 29-Sep-1994 David Denholm # - take action based on MMS .if / .else / .endif @@ -16,13 +16,17 @@ # we deselect any other line if $conditions[0] is 0 # I'm being very lazy - push a 1 at start, then dont need to check for # an empty @conditions [assume nesting in descrip.mms is correct] +# 2.1 26-Feb-1995 Charles Bailey bailey@newman.upenn.edu +# - handle MMS macros generated by MakeMaker +# 2.2 29-Jan-1996 Charles Bailey bailey@newman.upenn.edu +# - Fix output file name to work under Unix if ($#ARGV > -1 && $ARGV[0] =~ /^[\-\/]trim/i) { $do_trim = 1; shift @ARGV; } $infile = $#ARGV > -1 ? shift(@ARGV) : "Descrip.MMS"; -$outfile = $#ARGV > -1 ? shift(@ARGV) : "Makefile."; +$outfile = $#ARGV > -1 ? shift(@ARGV) : "Makefile"; # set any other args in %macros - set VAXC by default foreach (@ARGV) { $macros{"\U$_"}=1 } @@ -83,6 +87,22 @@ while () { else { $firstsrc = "\$<" } } +#convert macros we expect to see in MakeMaker-generated Descrip.MMSs + s#/Descrip=\s*\n#-f \nMMS = make\n#; + s#/Macro=\(# #; + s#MACROEND = \)#MACROEND = #; + if (m#\$\(USEMACROS\)(.*)(\$\(MACROEND\))?#) { + while (1) { + my($macros,$end) = ($1,$2); + $macros =~ s/,/ /g; # We're hosed if there're commas within a macro - + # someday, check for "" and skip contents + last if $end; + print OUTFIL $conditions[0] ? "#> " : "",$_; + $_ = ; + m#(.*)(\$\(MACROEND\))?#; + } + } + s/^ +/\t/; s/^\.first/\.first:/i; s/^\.suffixes/\.suffixes:/i;