MTK android 建立项目拷贝文件(makeMtk)

在同一套代码里面建立不同的项目,各项目之间又不能相互影响,那么最有效的方法即将各项目相互影响的文件独立出来,编译时拷贝各项目相应文件到相应目录;

下面是拷贝代码:写在文件makeMtk中:

可以搜索$project找到如下代码,比如项目名为:test_xxx1,test_xxx2,test_xxx3,中等为test

while ($#ARGV != -1)
{
  if ($ARGV[0] =~ /^-(t|te|tee)/)
  {
    $tee = "TRUE";
  }
  elsif ($ARGV[0] =~ /^-h|help/)
  {
    &Usage;
  }
  elsif ($ARGV[0] =~ /^-(o|op|opt)=(.*)$/)
  {
    @mOpts = split(",", $2);
  }
  elsif ($ARGV[0] =~ /^(listp|listproject)/)
  {
    &p_system("perl mediatek/build/tools/listP.pl");
    exit 0;
  }
  elsif ($ARGV[0] =~ /check-env|chk-env/)
  {
    &chkMustEnv;
    exit 0;
  }
  else
  {
    $project = lc($ARGV[0]);
    $project = "generic" if ($project eq "emulator");

    $project_config_name = "null";
    if(($project eq "test_xxx1"))
    {
       $project_config_name = "test_xxx1";
    }
   elsif(($project eq "test_xxx2"))
    {
       $project_config_name = "test_xxx2";
    }

    if($project_config_name ne "null")
    {
       print "caihr: Important Information.\n";
       print "You are choose the project with the config file in vendor/test/makefile/${project_config_name}\n";
       system("cp -f vendor/test/makefile/${project_config_name}/test.mk build/target/product/");
       system("cp -f vendor/test/makefile/${project_config_name}/ProjectConfig.mk mediatek/config/ $project");
       system("cp -f vendor/test/makefile/${project_config_name}/codegen.dws mediatek/custom/$project/kernel/dct/dct");
    //   $project = $project_config_name;
    }

    if (!-e "mediatek/config/${project}/ProjectConfig.mk")
    {
      if (-e $ini)
      {
        open (FILE_HANDLE, "<$ini") or die "cannot open $ini\n";
        while (<FILE_HANDLE>)
        {
          if (/^(\S+)\s*=\s*(\S+)/)
          {
            $keyname = $1;
            $${keyname} = $2;
          }
        }
        close FILE_HANDLE;
        $project = lc($project);
          $project_config_name = "null";
    if(($project eq "test_xxx1"))
    {
       $project_config_name = "test_xxx1";
    }
   elsif(($project eq "test_xxx2"))
    {
       $project_config_name = "test_xxx2";
    }

    if($project_config_name ne "null")
    {
       print "caihr: Important Information.\n";
       print "You are choose the project with the config file in vendor/test/makefile/${project_config_name}\n";
       system("cp -f vendor/test/makefile/${project_config_name}/test.mk build/target/product/");
       system("cp -f vendor/test/makefile/${project_config_name}/ProjectConfig.mk mediatek/config/ $project");
       system("cp -f vendor/test/makefile/${project_config_name}/codegen.dws mediatek/custom/$project/kernel/dct/dct");
    //   $project = $project_config_name;
    }

        die "Can NOT find project Makefile "
            . "mediatek/config/${project}/ProjectConfig.mk from $ini\n"
        if (!-e "mediatek/config/${project}/ProjectConfig.mk");
      }
    }
    else
    {
      shift(@ARGV);
    }

    die "Can NOT recognize project Makefile "
        . "mediatek/config/${project}/ProjectConfig.mk from command\n"
    if (!-e "mediatek/config/${project}/ProjectConfig.mk");
    $action = lc($ARGV[0]);
    shift(@ARGV);
    @arguments = @ARGV;
    @ARGV = ();
  }
  shift(@ARGV);
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值