
%Matlab m-file to build the mex64 dll library in debug mode
disp('executes matlab script to generate mex');
rootPath = evalin('base', 'rootPath');
display(rootPath);
clear mex;
currdir_ = pwd;
cd(rootPath);

system('copy "main\Smlk\lib_Sfn_Inspc\+mkSfn\emC_rtwmakecfg.m$" "..\mexDbg\rtwmakecfg.m"');
  

clear mex;  %unload mex64 dll
system('mkdir ..\\mexDbg');

  system('mkdir ..\\mexDbg\tlc_c');
  system('copy "main\\Smlk\\libSfn_Ctrl\\+genSfn\\Ctrl\*.tlc" "..\\mexDbg\tlc_c\*.tlc"');


disp('mex stepY_T1i_Ctrl_emC_SfH.c to ../mexDbg'); 
 
  disp('-Imain/cpp/src_emC');
 
  disp('-Imain/cpp/src_emC/emC_inclApplSpec/stdef_SmlkSfuncExcH');
 
  disp('-Imain/cpp/src_emC/emC_inclComplSpec/cc_SmlkSfunc_64bit');



mex -g COMPFLAGS='$COMPFLAGS -TP -EHa' -outdir ../mexDbg/ ...
  -Lc:\Programs\MSC15_adaptSmlk\missingLibSDK8_10 ...
      -Imain/cpp/src_emC ...
      -Imain/cpp/src_emC/emC_inclApplSpec/stdef_SmlkSfuncExcH ...
      -Imain/cpp/src_emC/emC_inclComplSpec/cc_SmlkSfunc_64bit ...
    main/Smlk/libSfn_Ctrl/+genSfn/Ctrl/stepY_T1i_Ctrl_emC_SfH.c ...
      main/cpp/src_emC/emC/Ctrl/T1i_Ctrl_emC.c ...
      main/cpp/src_emC/emC_srcApplSpec/applConv/ApplThrowOnFatalError_emC.c ...
      main/cpp/src_emC/emC_srcApplSpec/applConv/ExceptionPrintStacktrace_emC.c ...
      main/cpp/src_emC/emC_srcApplSpec/applConv/ExcThCxtStacksize.c ...
      main/cpp/src_emC/emC_srcApplSpec/applConv/ObjectJc_allocStartup_emC.c ...
      main/cpp/src_emC/emC/Base/Assert_emC.c ...
      main/cpp/src_emC/emC/Base/CheckStack_emC.c ...
      main/cpp/src_emC/emC/Base/DefPortTypes_emC.c ...
      main/cpp/src_emC/emC/Base/ExceptionCpp_emC.cpp ...
      main/cpp/src_emC/emC/Base/ExcThreadCxt_emC.c ...
      main/cpp/src_emC/emC/Base/MemC_emC.c ...
      main/cpp/src_emC/emC/Base/Memfree_ThreadAndBlockHeap.c ...
      main/cpp/src_emC/emC/Base/ObjectSimple_emC.c ...
      main/cpp/src_emC/emC/Base/ObjectRefl_emC.c ...
      main/cpp/src_emC/emC/Base/Time_emC.c ...
      main/cpp/src_emC/emC/Base/Timeconversions_emC.c ...
      main/cpp/src_emC/emC/Base/Reflection_emC.c ...
      main/cpp/src_emC/emC/Base/ReflectionBaseTypes_emC.c ...
      main/cpp/src_emC/emC/Base/StringBase_emC.c ...
      main/cpp/src_emC/emC/Base/Handle_ptr64_emC.c ...
      main/cpp/src_emC/emC/Base/Handle_ptr64_TimeMeas_emC.c ...
      main/cpp/src_emC/emC/Base/os_common.c ...
      main/cpp/src_emC/emC/OSAL/Environment_OSALemC.c ...
      main/cpp/src_emC/emC_srcOSALspec/osal_Windows/os_environment.c ...
      main/cpp/src_emC/emC_srcOSALspec/osal_Windows/os_file.c ...
      main/cpp/src_emC/emC_srcOSALspec/osal_Windows/os_mem.c ...
      main/cpp/src_emC/emC_srcOSALspec/osal_Windows/os_mutex.c ...
      main/cpp/src_emC/emC_srcOSALspec/osal_Windows/os_sharedmem.c ...
      main/cpp/src_emC/emC_srcOSALspec/osal_Windows/os_sync.c ...
      main/cpp/src_emC/emC_srcOSALspec/osal_Windows/os_thread.c ...
      main/cpp/src_emC/emC_srcOSALspec/osal_Windows/os_time.c ...