
%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 "lib_Sfn\+mkSfn\emC_rtwmakecfg.m$" "lib_Sfn\mex\rtwmakecfg.m"');
  

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

  system('mkdir lib_Sfn\\mex\tlc_c');
  system('copy "lib_Sfn\\+genSfn\\src_C\*.tlc" "lib_Sfn\\mex\tlc_c\*.tlc"');


disp('mex stepDummyHandle_Smlk_SfOp.c to lib_Sfn/mex'); 
 
  disp('-IemC/..');
 
  disp('-IemC_Ctrl');
 
  disp('-IemC/genRefl');
 
  disp('-IemC/incApplSpecific/stdef_SmlkSfuncExcH');
 
  disp('-IemC/incComplSpecific/cc_SmlkSfunc_64bit');
 
  disp('-Ilib_Sfn');



mex COMPFLAGS='$COMPFLAGS -TP -EHa' -outdir lib_Sfn/mex/ ...
  -Lc:\Programs\MSC15_adaptSmlk\missingLibSDK8_10 ...
      -IemC/.. ...
      -IemC_Ctrl ...
      -IemC/genRefl ...
      -IemC/incApplSpecific/stdef_SmlkSfuncExcH ...
      -IemC/incComplSpecific/cc_SmlkSfunc_64bit ...
      -Ilib_Sfn ...
    lib_Sfn/+genSfn/src_C/stepDummyHandle_Smlk_SfOp.c ...
      lib_Sfn/src_C/OObasics_Smlk.c ...
      emC/sourceApplSpecific/applConv/ApplThrowOnFatalError_emC.c ...
      emC/sourceApplSpecific/applConv/Exception_emC.c ...
      emC/sourceApplSpecific/applConv/ExceptionPrintStacktrace_emC.c ...
      emC/sourceApplSpecific/applConv/ExcThCxtStacksize.c ...
      emC/sourceApplSpecific/SimpleNumCNoExc/ThreadContextSingle_emC.c ...
      emC/sourceApplSpecific/applConv/ThreadContextUserBuffer_emC.c ...
      emC/Base/MemC_emC.c ...
      emC/Base/Memfree_ThreadAndBlockHeap.c ...
      emC/Base/Object_emC.c ...
      emC/Base/CheckStack_emC.c ...
      emC/Base/DefPortTypes_emC.c ...
      emC/Base/Time_emC.c ...
      emC/Base/Reflection_emC.c ...
      emC/Base/ReflectionBaseTypes_emC.c ...
      emC/Base/StringBase_emC.c ...
      emC/Base/Handle_ptr64_emC.c ...
      emC/Base/Handle_ptr64_TimeMeas_emC.c ...
      emC/Base/os_common.c ...
      emC/sourceSpecials/osal_Windows/os_sharedmem.c ...
      emC/sourceSpecials/osal_Windows/os_file.c ...
      emC/sourceSpecials/osal_Windows/os_mem.c ...
      emC/sourceSpecials/osal_Windows/os_time.c ...