common/tools/split_sysdef.pl
changeset 1078 551e851f4b49
parent 1077 f16ac94c147c
child 1211 776ca456c221
equal deleted inserted replaced
1077:f16ac94c147c 1078:551e851f4b49
    11 #
    11 #
    12 # Description:
    12 # Description:
    13 # Split a system model file into many package model files (one per package)
    13 # Split a system model file into many package model files (one per package)
    14 
    14 
    15 use strict;
    15 use strict;
       
    16 
    16 use Getopt::Long;
    17 use Getopt::Long;
    17 use XML::DOM;
    18 use XML::DOM;
       
    19 use File::Path;
    18 
    20 
    19 my $DEFAULT_OUTDIR = "models";
    21 my $DEFAULT_OUTDIR = "models";
    20 
    22 
    21 my $sysdef = '';
    23 my $sysdef = '';
    22 my $outdir = $DEFAULT_OUTDIR;
    24 my $outdir = $DEFAULT_OUTDIR;
    38 	print "and OPTIONS are:\n";
    40 	print "and OPTIONS are:\n";
    39 	print "\t--outdir=DIR Generate package model files under DIR (default: $DEFAULT_OUTDIR)\n";
    41 	print "\t--outdir=DIR Generate package model files under DIR (default: $DEFAULT_OUTDIR)\n";
    40 	exit(0);
    42 	exit(0);
    41 }
    43 }
    42 
    44 
    43 mkdir("$outdir") if (!-d$outdir);
    45 mkpath("$outdir") if (!-d $outdir);
    44 
    46 
    45 my $parser = new XML::DOM::Parser;
    47 my $parser = new XML::DOM::Parser;
    46 my $doc = $parser->parsefile ($sysdef);
    48 my $doc = $parser->parsefile ($sysdef);
    47 
    49 
    48 # fix bldFile and mrp paths
    50 # fix bldFile and mrp paths