function makeCmdOut = setup_for_default(args)
% SETUP_FOR_DEFAULT - sets up a default batch file for RTW builds

% Copyright 2002-2022 The MathWorks, Inc.
  
  makeCmd        = args.makeCmd;
  modelName      = args.modelName;
  verbose        = args.verbose;
    
  % Create command file content
  content = '';
  
  if ~verbose
      content = sprintf('%s\n%s\n', content, '@echo off');
  end
  content = sprintf('%s\n%s=%s\n', content, 'set MATLAB', matlabroot);
  
  [mapMLR, forceMap, mlrToUse] = coder.make.internal.checkMLRDriveMap(args.buildInfo);
  
  if mapMLR
      cmd = coder.make.internal.getMLRDriveMapCmd(mlrToUse, forceMap);
      content = sprintf('%s\n\n%s\n', content, cmd); 
  end
  
  % Write out any build hook environment commands
  if ~isempty(args.aBuildHookEnvVars)
      cmds = coder.make.internal.getPCBuildEnvironmentCmds...
          (args.aBuildHookEnvVars, args.aBuildHookPathPrepends);
      if ~isempty(cmds)
          content = sprintf('%s\n%s', content, cmds);
      end
  end
      
  
  content = sprintf('%s\n%s\n', content, makeCmd );
  
  % Write out command file
  cmdFile = ['.\',modelName, '.bat'];
  cmdFileFid = fopen(cmdFile,'w');
  fprintf(cmdFileFid, '%s', content);
  fclose(cmdFileFid);
  makeCmdOut = cmdFile;

%endfunction setup_for_default
