
%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);
  

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

  system('mkdir test\\mex\tlc_c');
  system('copy "test\\+ObjOModule_ExmplCtrl\\+genSfn\\Sfn\*.tlc" "test\\mex\tlc_c\*.tlc"');


disp('mex step_MeasPrep_ProgrSimpleExmplA_SfH.c to test/mex'); 
 
  disp('-Itest/+ObjOModule_ExmplCtrl');
 
  disp('-Iemc/source');
 
  disp('-Iemc/incApplSpecific/stdef_SmlkSfuncExcH');
 
  disp('-Iemc/incComplSpecific/cc_SmlkSfunc_64bit');
 
  disp('-Iemc');
 
  disp('-I.');
 
  disp('-IgenRefl');



mex -outdir test/mex/ ...
      -Itest/+ObjOModule_ExmplCtrl ...
      -Iemc/source ...
      -Iemc/incApplSpecific/stdef_SmlkSfuncExcH ...
      -Iemc/incComplSpecific/cc_SmlkSfunc_64bit ...
      -Iemc ...
      -I. ...
      -IgenRefl ...
    test/+ObjOModule_ExmplCtrl/+genSfn/Sfn/step_MeasPrep_ProgrSimpleExmplA_SfH.c ...
      test/+ObjOModule_ExmplCtrl/srcC_Model/MeasPrep.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/applConv/ThreadContextSingle_emC.c ...
      emc/sourceApplSpecific/applConv/ThreadContextUserBuffer_emC.c ...
      emc/source/emC/MemC_emC.c ...
      emc/source/emC/Memfree_ThreadAndBlockHeap.c ...
      emc/source/emC/Object_emC.c ...
      emc/source/emC/CheckStack_emC.c ...
      emc/source/emC/DefPortTypes_emC.c ...
      emc/source/emC/time_emC.c ...
      emc/source/emC/Reflection_emC.c ...
      emc/source/emC/ReflectionBaseTypes_emC.c ...
      emc/source/emC/StringBase_emC.c ...
      emc/source/emC/Handle_ptr64_emC.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_Msc15/os_time.c ...

disp('mex out_MeasPrep_ProgrSimpleExmplA_SfOp.c to test/mex'); 
 
  disp('-Itest/+ObjOModule_ExmplCtrl');
 
  disp('-Iemc/source');
 
  disp('-Iemc/incApplSpecific/stdef_SmlkSfuncExcH');
 
  disp('-Iemc/incComplSpecific/cc_SmlkSfunc_64bit');
 
  disp('-Iemc');
 
  disp('-I.');
 
  disp('-IgenRefl');



mex -outdir test/mex/ ...
      -Itest/+ObjOModule_ExmplCtrl ...
      -Iemc/source ...
      -Iemc/incApplSpecific/stdef_SmlkSfuncExcH ...
      -Iemc/incComplSpecific/cc_SmlkSfunc_64bit ...
      -Iemc ...
      -I. ...
      -IgenRefl ...
    test/+ObjOModule_ExmplCtrl/+genSfn/Sfn/out_MeasPrep_ProgrSimpleExmplA_SfOp.c ...
      test/+ObjOModule_ExmplCtrl/srcC_Model/MeasPrep.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/applConv/ThreadContextSingle_emC.c ...
      emc/sourceApplSpecific/applConv/ThreadContextUserBuffer_emC.c ...
      emc/source/emC/MemC_emC.c ...
      emc/source/emC/Memfree_ThreadAndBlockHeap.c ...
      emc/source/emC/Object_emC.c ...
      emc/source/emC/CheckStack_emC.c ...
      emc/source/emC/DefPortTypes_emC.c ...
      emc/source/emC/time_emC.c ...
      emc/source/emC/Reflection_emC.c ...
      emc/source/emC/ReflectionBaseTypes_emC.c ...
      emc/source/emC/StringBase_emC.c ...
      emc/source/emC/Handle_ptr64_emC.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_Msc15/os_time.c ...