
%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 lib_Sfn\\mex');

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


disp('mex in1out1_ProgrFunc_Smlk_SfOp.c to lib_Sfn/mex'); 
 
  disp('-Iemc/source');
 
  disp('-Iemc/incApplSpecific/stdef_SmlkSfuncExcH');
 
  disp('-Iemc/incComplSpecific/cc_SmlkSfunc_64bit');
 
  disp('-Iemc');
 
  disp('-Ilib_Sfn');



mex COMPFLAGS='$COMPFLAGS -TP -EHa' -outdir lib_Sfn/mex/ ...
      -Iemc/source ...
      -Iemc/incApplSpecific/stdef_SmlkSfuncExcH ...
      -Iemc/incComplSpecific/cc_SmlkSfunc_64bit ...
      -Iemc ...
      -Ilib_Sfn ...
    lib_Sfn/+genSfn/src_C/in1out1_ProgrFunc_Smlk_SfOp.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/time_emC.c ...
      emc/source/emC/DefPortTypes_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 out1_ProgrFunc_Smlk_SfOp.c to lib_Sfn/mex'); 
 
  disp('-Iemc/source');
 
  disp('-Iemc/incApplSpecific/stdef_SmlkSfuncExcH');
 
  disp('-Iemc/incComplSpecific/cc_SmlkSfunc_64bit');
 
  disp('-Iemc');
 
  disp('-Ilib_Sfn');



mex COMPFLAGS='$COMPFLAGS -TP -EHa' -outdir lib_Sfn/mex/ ...
      -Iemc/source ...
      -Iemc/incApplSpecific/stdef_SmlkSfuncExcH ...
      -Iemc/incComplSpecific/cc_SmlkSfunc_64bit ...
      -Iemc ...
      -Ilib_Sfn ...
    lib_Sfn/+genSfn/src_C/out1_ProgrFunc_Smlk_SfOp.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/time_emC.c ...
      emc/source/emC/DefPortTypes_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 ...