function rtwTargetInfo(tr)
%RTWTARGETINFO Target info callback

% Copyright 2012-2019 The MathWorks, Inc.

tr.registerTargetInfo(@loc_createToolchain);

end

% -------------------------------------------------------------------------
% Create the ToolchainInfoRegistry entries
% -------------------------------------------------------------------------
function config = loc_createToolchain

config = coder.make.ToolchainInfoRegistry;
% toolsDir = fullfile(matlabroot, 'toolbox', 'coder', 'foundation', 'build', 'tools');
toolsDir = fileparts(mfilename('fullpath'));


% -----------------------------------
% MSVC Toolchains
% -----------------------------------

if strcmpi(computer('arch'), 'win64')
    config(1)                       = coder.make.ToolchainInfoRegistry;
    config(end).Name                = 'IBIS-AMI Microsoft Visual C++ 2019 v16.0 | nmake (64-bit Windows)';
    config(end).Alias               = 'IBIS-AMI Microsoft-16.0';
    config(end).FileName            = fullfile(toolsDir, 'ibis_ami_ms_vc_nmake_win64_v16.0.mat');
    config(end).TargetHWDeviceType  = {'*'};
    config(end).Platform            = {'win64'};
    %-----------
    config(end+1)                       = coder.make.ToolchainInfoRegistry;
    config(end).Name                = 'IBIS-AMI Microsoft Visual C++ 2017 v15.0 | nmake (64-bit Windows)';
    config(end).Alias               = 'IBIS-AMI Microsoft-15.0';
    config(end).FileName            = fullfile(toolsDir, 'ibis_ami_ms_vc_nmake_win64_v15.0.mat');
    config(end).TargetHWDeviceType  = {'*'};
    config(end).Platform            = {'win64'};
    %-----------
    config(end+1)                   = coder.make.ToolchainInfoRegistry;
    config(end).Name                = 'IBIS-AMI Microsoft Visual C++ 2015 v14.0 | nmake (64-bit Windows)';
    config(end).Alias               = 'IBIS-AMI Microsoft-14.0';
    config(end).FileName            = fullfile(toolsDir, 'ibis_ami_ms_vc_nmake_win64_v14.0.mat');
    config(end).TargetHWDeviceType	= {'*'};
    config(end).Platform            = {'win64'};
end

% -----------------------------------
% Other PC Toolchains (LCC, MinGW64)
% -----------------------------------
    
if strcmpi(computer('arch'), 'win64')
    config(end+1)                   = coder.make.ToolchainInfoRegistry;
    config(end).Name                = 'IBIS-AMI MinGW64 | gmake (64-bit Windows)';
    config(end).Alias               = {'IBIS-AMI GNU-x', 'IBIS-AMI MinGW64 v4.x | gmake (64-bit Windows)'};
    config(end).FileName            = fullfile(toolsDir, 'ibis_ami_gnu_gcc_gmake_win64.mat');
    config(end).TargetHWDeviceType  = {'*'};
    config(end).Platform            = {'win64'};
end

% -----------------------------------
% GNU Toolchains
% -----------------------------------

if strcmpi(computer('arch'), 'glnxa64')
    config(1)                       = coder.make.ToolchainInfoRegistry;
    config(end).Name                = 'IBIS-AMI GNU gcc/g++ | gmake (64-bit Linux)';
    config(end).Alias               = {'IBIS-AMI GNU-x', 'IBIS-AMI GNU gcc/g++ v4.4.x | gmake (64-bit Linux)'};
    config(end).FileName            = fullfile(toolsDir, 'ibis_ami_gnu_gcc_gmake_glnxa64.mat');
    config(end).TargetHWDeviceType	= {'*'};
    config(end).Platform            = {'glnxa64'};
% elseif strcmpi(computer('arch'), 'maci64')
%     config(1)                       = coder.make.ToolchainInfoRegistry;
%     config(end).Name                = 'IBIS-AMI Clang v3.1 | gmake (64-bit Mac)';
%     config(end).Alias               = 'IBIS-AMI Apple-x';
%     config(end).FileName            = fullfile(toolsDir, 'ibis_ami_clang_tools_gmake_maci64_v3.1.mat');
%     config(end).TargetHWDeviceType  = {'*'};
%     config(end).Platform            = {'maci64'};
end

% -------------------------------------------------------------------------
% ADDING A NEW ENTRY:
% 1. Copy the commented block of code below.
% 2. Paste it at the bottom of the list above.
% 3. Uncomment it.
% 4. Fill out the required information.
% -------------------------------------------------------------------------
% config(end+1)                   = coder.make.ToolchainInfoRegistry;
% config(end).Name                = <put the 'Name' property of the toolchain here>;
% config(end).FileName            = <insert the MAT file here with complete path>;
% config(end).TargetHWDeviceType  = {'*'};
% -------------------------------------------------------------------------
end
