
%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\\Ctrl\*.tlc" "lib_Sfn\\mex\tlc_c\*.tlc"');


disp('mex startTime_Clock_MinMaxTime_SfOp.c to lib_Sfn/mex'); 
 
  disp('-I.');
 
  disp('-IemC/..');
 
  disp('-IemC/genRefl');
 
  disp('-IemC/incApplSpecific/stdef_SmlkSfuncExcH');
 
  disp('-IemC/incComplSpecific/cc_SmlkSfunc_64bit');
 
  disp('-IemC');



mex COMPFLAGS='$COMPFLAGS -TP -EHa' -outdir lib_Sfn/mex/ ...
  -Lc:\Programs\MSC15_adaptSmlk\missingLibSDK8_10 ...
      -I. ...
      -IemC/.. ...
      -IemC/genRefl ...
      -IemC/incApplSpecific/stdef_SmlkSfuncExcH ...
      -IemC/incComplSpecific/cc_SmlkSfunc_64bit ...
      -IemC ...
    lib_Sfn/+genSfn/Ctrl/startTime_Clock_MinMaxTime_SfOp.c ...
      emc/Base/time_emC.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/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 ...

disp('mex measTime_Clock_MinMaxTime_SfOp.c to lib_Sfn/mex'); 
 
  disp('-I.');
 
  disp('-IemC/..');
 
  disp('-IemC/genRefl');
 
  disp('-IemC/incApplSpecific/stdef_SmlkSfuncExcH');
 
  disp('-IemC/incComplSpecific/cc_SmlkSfunc_64bit');
 
  disp('-IemC');



mex COMPFLAGS='$COMPFLAGS -TP -EHa' -outdir lib_Sfn/mex/ ...
  -Lc:\Programs\MSC15_adaptSmlk\missingLibSDK8_10 ...
      -I. ...
      -IemC/.. ...
      -IemC/genRefl ...
      -IemC/incApplSpecific/stdef_SmlkSfuncExcH ...
      -IemC/incComplSpecific/cc_SmlkSfunc_64bit ...
      -IemC ...
    lib_Sfn/+genSfn/Ctrl/measTime_Clock_MinMaxTime_SfOp.c ...
      emc/Base/time_emC.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/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 ...