diff options
25 files changed, 140 insertions, 108 deletions
diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin Binary files differindex 13eec962..5baa2e21 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci index 4dfaec9a..3a6d225a 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci @@ -193,11 +193,15 @@ global STACKDEDUG FileInfo.GlobalVarFileName); end else - //Change the scope of function name from variable to string, - //as it is passed as string to C function. Also enter this function - //in conversion list also. + //If a function is passed as input argument, Change the scope of function name from variable to string, + //as it is passed as string to C function. Also enter this function in conversion list also. if(ASTFunName == 'ode') - InArg(4).Scope = 'String'; + disp(NInArg) + if NInArg == 4 + InArg(4).Scope = 'String'; + ODEFunName = InArg(4).Name; + disp(ODEFunName) + end end [InArg,SharedInfo] = ST_GetInArgInfo(InArg,NInArg,FileInfo,SharedInfo); end @@ -469,4 +473,12 @@ global STACKDEDUG //NUT: e' piu' ordinato. //#RNU_RES_E + //If current function being converted is 'ode', call 'scilab2c' again to convert + //function containing differential equations. It is passed as one of the input + //arguements to 'ode'. + if ASTFunName == 'ode' then + temp = ODEFunName + '.sci' + scilab2c( '/home/siddhesh/Documents/Scilab/ODE/ODE_test/try_ode.sci', FileInfo.OutCCCodeDir, FileInfo.UserSciFilesPaths,'FunCall','make','AVR') + end + endfunction diff --git a/2.3-1/macros/ASTManagement/AST_HandleHeader.bin b/2.3-1/macros/ASTManagement/AST_HandleHeader.bin Binary files differindex b2ef8575..b5e33b67 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleHeader.bin +++ b/2.3-1/macros/ASTManagement/AST_HandleHeader.bin diff --git a/2.3-1/macros/ASTManagement/AST_HandleHeader.sci b/2.3-1/macros/ASTManagement/AST_HandleHeader.sci index 661c740f..7346f321 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleHeader.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleHeader.sci @@ -95,7 +95,6 @@ else NOutArg = size(OutNames,1); end - //#RNU_RES_B // ------------------------------------- // --- Load the C function dat file. --- @@ -108,6 +107,16 @@ load(fullfile(FileInfo.FunctionList.FunInfoDatDir,SharedInfo.NextCFunName+'.dat' SharedInfo.CurrentFunInfo = FunInfo; clear FunInfo +//Required if single file is being translated and has input/outputs +if(SharedInfo.RunMode == "FunCall") +[FunTypeAnnot,FunSizeAnnot] = FA_GetFunAnn(NInArg,NOutArg,FunctionName,FileInfo,SharedInfo); + if((nxtscifunname == SharedInfo.SCIMainFunName)) + SharedInfo.CurrentFunInfo.FunTypeAnnot = FunTypeAnnot; + SharedInfo.CurrentFunInfo.FunSizeAnnot = FunSizeAnnot; + end + disp(SharedInfo.CurrentFunInfo.FunSizeAnnot) + disp(SharedInfo.CurrentFunInfo.FunTypeAnnot) +end //#RNU_RES_B // ----------------------------------------------------------------------------- // --- Check coherence between In/Out names and In/Out Arg structure loaded. --- @@ -119,13 +128,15 @@ else NInArgDat = 0; end -if (NInArgDat == NInArg) + +if ((NInArgDat == NInArg)|(nxtscifunname == SharedInfo.SCIMainFunName)) for tmpcnt = 1:NInArg SharedInfo.CurrentFunInfo.InArg(tmpcnt).Name = InNames(tmpcnt); if (SharedInfo.CurrentFunInfo.InArg(tmpcnt).Dimension == 0) SharedInfo.CurrentFunInfo.InArg(tmpcnt).Size(1) = '1'; SharedInfo.CurrentFunInfo.InArg(tmpcnt).Size(2) = '1'; SharedInfo.CurrentFunInfo.InArg(tmpcnt).Value = %nan; + SharedInfo.CurrentFunInfo.InArg(tmpcnt).FindLike = 0; else //#RNU_RES_B //NUT: using approach 1: Setting for input and output arguments symbolic sizes. @@ -133,14 +144,14 @@ if (NInArgDat == NInArg) SharedInfo.CurrentFunInfo.InArg(tmpcnt).Size(1) = '__'+SharedInfo.CurrentFunInfo.InArg(tmpcnt).Name+'Size[0]'; SharedInfo.CurrentFunInfo.InArg(tmpcnt).Size(2) = '__'+SharedInfo.CurrentFunInfo.InArg(tmpcnt).Name+'Size[1]'; SharedInfo.CurrentFunInfo.InArg(tmpcnt).Value = %nan; + SharedInfo.CurrentFunInfo.InArg(tmpcnt).FindLike = 0; end end else error(9999, 'Number of input arguments specified in AST is different from the number specified in .dat file.'); end - -if (SharedInfo.CurrentFunInfo.NOutArg == NOutArg) +if ((SharedInfo.CurrentFunInfo.NOutArg == NOutArg)|(nxtscifunname == SharedInfo.SCIMainFunName)) for tmpcnt = 1:NOutArg SharedInfo.CurrentFunInfo.OutArg(tmpcnt).Name = OutNames(tmpcnt); end @@ -160,7 +171,6 @@ SharedInfo.CurrentFunInfo.OutArg = ... SharedInfo,... SharedInfo.CurrentFunInfo.FunPrecSpecifier,... SharedInfo.CurrentFunInfo.FunTypeAnnot,SharedInfo.CurrentFunInfo.FunSizeAnnot,ReportFileName); - //#RNU_RES_B // ------------------------------------------------------------------------- // --- Stores InArg structure into the temporary variables symbol table. --- @@ -206,7 +216,6 @@ for tmpcnt = 1:NOutArg PrintStringInfo(' Setting symbol ""'+SharedInfo.CurrentFunInfo.OutArg(tmpcnt).Name+'"" in '+SymbTableFileName+'.',ReportFileName,'file','y'); //#RNU_RES_E - ST_Set(SharedInfo.CurrentFunInfo.OutArg(tmpcnt).Name,... SharedInfo.CurrentFunInfo.OutArg(tmpcnt).Type,... SharedInfo.CurrentFunInfo.OutArg(tmpcnt).Size,... diff --git a/2.3-1/macros/CCodeGeneration/lib b/2.3-1/macros/CCodeGeneration/lib Binary files differindex f91bc268..9007df7e 100644 --- a/2.3-1/macros/CCodeGeneration/lib +++ b/2.3-1/macros/CCodeGeneration/lib diff --git a/2.3-1/macros/FunctionAnnotation/FA_GetFunAnn.bin b/2.3-1/macros/FunctionAnnotation/FA_GetFunAnn.bin Binary files differindex d3ca8c04..c94c675e 100644 --- a/2.3-1/macros/FunctionAnnotation/FA_GetFunAnn.bin +++ b/2.3-1/macros/FunctionAnnotation/FA_GetFunAnn.bin diff --git a/2.3-1/macros/FunctionAnnotation/FA_GetFunAnn.sci b/2.3-1/macros/FunctionAnnotation/FA_GetFunAnn.sci index e5fb8ac8..ffdfa7fb 100644 --- a/2.3-1/macros/FunctionAnnotation/FA_GetFunAnn.sci +++ b/2.3-1/macros/FunctionAnnotation/FA_GetFunAnn.sci @@ -194,6 +194,8 @@ else end
end
end
+
+
end
// --- End loop over the lines of the input file. ---
mclose(inclsfid);
diff --git a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin Binary files differindex 39d97b24..51ec64c2 100644 --- a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin +++ b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.bin diff --git a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci index 37e6d091..5db26236 100644 --- a/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci +++ b/2.3-1/macros/FunctionAnnotation/FA_GetOutArgInfo.sci @@ -46,17 +46,18 @@ for cntin = 1:NInArg end
end
DefaultPrecision = SharedInfo.DefaultPrecision;
-
// ---------------------------
// --- End Initialization. ---
// ---------------------------
if (FunTypeAnnot(1) == '')
NOutArg = 0;
+
else
NOutArg = max(size(FunTypeAnnot));
end
flagfindlike = 0;
+
for counterin = 1:NInArg
if (InArg(counterin).FindLike == 1 | InArg(counterin).FindLike == -1)
// #RNU_RES_B
@@ -68,9 +69,8 @@ for counterin = 1:NInArg flagfindlike = -1;
end
end
-
for counterout = 1:NOutArg
-
+
if(FunTypeAnnot == 'FA_TP_USER')
UpdatedOutArg(counterout).Type = FA_TP_USER(FunPrecSpecifier,DefaultPrecision);
else
diff --git a/2.3-1/macros/SymbolTable/ST_MatchSymbol.bin b/2.3-1/macros/SymbolTable/ST_MatchSymbol.bin Binary files differindex bf3fb985..278560d0 100644 --- a/2.3-1/macros/SymbolTable/ST_MatchSymbol.bin +++ b/2.3-1/macros/SymbolTable/ST_MatchSymbol.bin diff --git a/2.3-1/macros/SymbolTable/ST_MatchSymbol.sci b/2.3-1/macros/SymbolTable/ST_MatchSymbol.sci index 20f0bbe8..504379c2 100644 --- a/2.3-1/macros/SymbolTable/ST_MatchSymbol.sci +++ b/2.3-1/macros/SymbolTable/ST_MatchSymbol.sci @@ -34,7 +34,6 @@ TBFlagEqualSymbols = 0; // --- Find symbol (If exists). ---
[TBFlagfound,tmpType,tmpSize,tmpValue,tmpFindLike,tmpDimension] = ...
ST_Get(TBName,SymbolTableFileName);
-
if (TBFlagfound == 1)
if (tmpType == 'GBLToBeDefined')
TBFlagfound = 2;
diff --git a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin Binary files differindex eed0cd8f..8a5667d5 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin +++ b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.sci b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.sci index c213db9f..c24d4a1a 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.sci +++ b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.sci @@ -49,6 +49,8 @@ SharedInfo.NextSCIFileName = UserScilabMainFile; SharedInfo.SCIMainFunName = funname;
if (Target == 'Arduino')
SharedInfo.CMainFunName = 'loop_arduino';
+elseif (RunMode == 'Translate')
+ SharedInfo.CMainFunName = funname;
else
SharedInfo.CMainFunName = 'main';
end
@@ -67,6 +69,10 @@ SharedInfo.Annotations.FUNTYPE = '''OUT(''+string(SCI2C_nout)+'').TP='''; // Ty SharedInfo.Annotations.FUNSIZE = '''OUT(''+string(SCI2C_nout)+'').SZ(''+string(SCI2C_nelem)+'')= ''';
SharedInfo.Annotations.FUNCLASS = 'CLASS: ';
SharedInfo.Annotations.USERFUN = '//SCI2C: ';
+SharedInfo.Annotations.INTYPE = '''IN(''+string(SCI2C_nout)+'').TP='''; // Type includes also precision.
+SharedInfo.Annotations.INSIZE = '''IN(''+string(SCI2C_nout)+'').SZ(''+string(SCI2C_nelem)+'')= ''';
+
+
// #RNU_RES_B
// Note when you execute the following code:
// SCI2C_nout=1;
diff --git a/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin b/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin Binary files differindex ac8f7085..c1ee9ec0 100644 --- a/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin +++ b/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.sci b/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.sci index 93ebafbf..4d72ab78 100644 --- a/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.sci @@ -62,7 +62,9 @@ elseif (SharedInfoRunMode == 'Translate') rmdir(FileInfo.OutCCCodeDir,'s');
else
SCI2Cerror('Cannot continue, because you don''t want to delete: '+FileInfo.OutCCCodeDir);
- end
+ end
+elseif (SharedInfoRunMode == 'FunCall')
+ //Do nothing
else
disp('Unknown RunMode: ""'+SharedInfoRunMode+'"".');
disp('Please check RunMode parameter in the SCI2CInputParameters.sce file');
diff --git a/2.3-1/macros/findDeps/getAllHeaders.bin b/2.3-1/macros/findDeps/getAllHeaders.bin Binary files differindex 3c3b9374..3f2bf2db 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.bin +++ b/2.3-1/macros/findDeps/getAllHeaders.bin diff --git a/2.3-1/macros/findDeps/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci index d97d04c3..6338fe22 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.sci +++ b/2.3-1/macros/findDeps/getAllHeaders.sci @@ -135,8 +135,8 @@ function allHeaders = getAllHeaders(Target) "src/c/signalProcessing/includes/dynlib_signalprocessing.h" "src/c/signalProcessing/includes/crossCorr.h" "src/c/implicitList/dynlib_implicitlist.h" - "src/c/implicitList/implicitList.h" - "src/c/differential_calculus/includes/ode.h"]; + "src/c/implicitList/implicitList.h"]; + //"src/c/differential_calculus/includes/ode.h"]; //Header files required for "Arduino" output Arduino_headers = [ diff --git a/2.3-1/macros/findDeps/getAllInterfaces.bin b/2.3-1/macros/findDeps/getAllInterfaces.bin Binary files differindex b0b53347..0121eb9e 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.bin +++ b/2.3-1/macros/findDeps/getAllInterfaces.bin diff --git a/2.3-1/macros/findDeps/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci index 9818071f..5bef0c6f 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -129,8 +129,8 @@ function allInterfaces = getAllInterfaces(Target) "src/c/signalProcessing/interfaces/int_fftshift.h" "src/c/signalProcessing/interfaces/int_fft.h" "src/c/signalProcessing/interfaces/int_lev.h" - "src/c/implicitList/int_OpColon.h" - "src/c/differential_calculus/interfaces/int_ode.h"]; + "src/c/implicitList/int_OpColon.h"]; + //"src/c/differential_calculus/interfaces/int_ode.h"]; //Interface files required for "Arduino" output Arduino_interfaces = [ diff --git a/2.3-1/macros/findDeps/getAllSources.bin b/2.3-1/macros/findDeps/getAllSources.bin Binary files differindex a25aa618..0796a3bb 100644 --- a/2.3-1/macros/findDeps/getAllSources.bin +++ b/2.3-1/macros/findDeps/getAllSources.bin diff --git a/2.3-1/macros/findDeps/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci index 8fc0d310..631edd25 100644 --- a/2.3-1/macros/findDeps/getAllSources.sci +++ b/2.3-1/macros/findDeps/getAllSources.sci @@ -897,8 +897,8 @@ function allSources = getAllSources(Target) "src/c/implicitList/zimplicitLists.c" "src/c/implicitList/dimplicitLists.c" "src/c/implicitList/cimplicitLists.c" - "src/c/implicitList/simplicitLists.c" - "src/c/differential_calculus/ode/ode.c"]; + "src/c/implicitList/simplicitLists.c"]; + //"src/c/differential_calculus/ode/ode.c"]; //Files to be inserted only if output format selected is 'Arduino'. Arduino_files = ["src/c/scilab-arduino/cmd_digital_out/u8cmd_digital_outs.c" diff --git a/2.3-1/macros/runsci2c.bin b/2.3-1/macros/runsci2c.bin Binary files differindex 90bd8861..b7eba521 100644 --- a/2.3-1/macros/runsci2c.bin +++ b/2.3-1/macros/runsci2c.bin diff --git a/2.3-1/macros/runsci2c.sci b/2.3-1/macros/runsci2c.sci index 41495cb4..83cf7081 100644 --- a/2.3-1/macros/runsci2c.sci +++ b/2.3-1/macros/runsci2c.sci @@ -74,7 +74,7 @@ INIT_LoadLibraries(FileInfoDatFile); // ----------------------------------
// --- Perform SCI2C Translation. ---
// ----------------------------------
-if (RunMode == 'All' | RunMode == 'Translate')
+if (RunMode == 'All' | RunMode == 'Translate' | RunMode == "FunCall")
FlagContinueTranslation = 1;
while(FlagContinueTranslation == 1)
UpdateSCI2CInfo(FileInfoDatFile);
@@ -90,93 +90,95 @@ end // ---------------------------
// --- Copy library files. ---
// ---------------------------
-global SCI2CHOME
-
-allSources = SCI2CHOME + "/" + getAllSources(Target);
-allHeaders = SCI2CHOME + "/" +getAllHeaders(Target);
-allInterfaces = SCI2CHOME + "/" + getAllInterfaces(Target);
-allLibraries = SCI2CHOME + "/" + getAllLibraries(Target);
-
-mkdir(SCI2COutputPath+"/src/");
-mkdir(SCI2COutputPath+"/src/c/");
-mkdir(SCI2COutputPath+"/includes/");
-mkdir(SCI2COutputPath+"/interfaces/");
-mkdir(SCI2COutputPath+"/libraries/");
-
-// -- Sources
-PrintStepInfo('Copying sources', FileInfo.GeneralReport,'both');
-for i = 1:size(allSources, "*")
- // DEBUG only
- //disp("Copying "+allSources(i)+" in "+SCI2COutputPath+"/src/c/");
- copyfile(allSources(i), SCI2COutputPath+"/src/c/");
-end
-
-// -- Includes
-PrintStepInfo('Copying headers', FileInfo.GeneralReport,'both');
-for i = 1:size(allHeaders, "*")
- // DEBUG only
- //disp("Copying "+allHeaders(i)+" in "+SCI2COutputPath+"/includes/");
- copyfile(allHeaders(i), SCI2COutputPath+"/includes/");
-end
-
-// -- Interfaces
-PrintStepInfo('Copying interfaces', FileInfo.GeneralReport,'both');
-for i = 1:size(allInterfaces, "*")
- // DEBUG only
- //disp("Copying "+allInterfaces(i)+" in "+SCI2COutputPath+"/interfaces/");
- copyfile(allInterfaces(i), SCI2COutputPath+"/interfaces/");
-end
-
-// -- Libraries
-PrintStepInfo('Copying libraries', FileInfo.GeneralReport,'both');
-for i = 1:size(allLibraries, "*")
- // DEBUG only
- //disp("Copying "+allInterfaces(i)+" in "+SCI2COutputPath+"/interfaces/");
- copyfile(allLibraries(i), SCI2COutputPath+"/libraries/");
-end
+if(RunMode <> "FunCall")
+
+ global SCI2CHOME
+
+ allSources = SCI2CHOME + "/" + getAllSources(Target);
+ allHeaders = SCI2CHOME + "/" +getAllHeaders(Target);
+ allInterfaces = SCI2CHOME + "/" + getAllInterfaces(Target);
+ allLibraries = SCI2CHOME + "/" + getAllLibraries(Target);
+
+ mkdir(SCI2COutputPath+"/src/");
+ mkdir(SCI2COutputPath+"/src/c/");
+ mkdir(SCI2COutputPath+"/includes/");
+ mkdir(SCI2COutputPath+"/interfaces/");
+ mkdir(SCI2COutputPath+"/libraries/");
+
+ // -- Sources
+ PrintStepInfo('Copying sources', FileInfo.GeneralReport,'both');
+ for i = 1:size(allSources, "*")
+ // DEBUG only
+ //disp("Copying "+allSources(i)+" in "+SCI2COutputPath+"/src/c/");
+ copyfile(allSources(i), SCI2COutputPath+"/src/c/");
+ end
-// --------------------------
-// --- Generate Makefile. ---
-// --------------------------
-//If output format is chosen as 'Arduino', then copy makefile for arduino from
-//default folder, else generate makefile for standalone c code
-
-if (Target == 'Arduino')
-
- GenerateSetupFunction(FileInfo);
- mkdir(SCI2COutputPath+"/arduino/");
- mkdir(SCI2COutputPath+"/arduino/sci2c_arduino");
- //Copy arduino makefile
- arduinoFiles = SCI2CHOME + "/" + getArduinoFiles();
- PrintStepInfo('Copying arduino files', FileInfo.GeneralReport,'both');
- copyfile(arduinoFiles(1), SCI2COutputPath);
- for i = 2:size(arduinoFiles, "*")
- // DEBUG only
- //disp("Copying "+arduinoFiles(i)+" in "+SCI2COutputPath+"/arduino/sci2carduino");
- copyfile(arduinoFiles(i), SCI2COutputPath+"/arduino/sci2c_arduino/");
- end
+ // -- Includes
+ PrintStepInfo('Copying headers', FileInfo.GeneralReport,'both');
+ for i = 1:size(allHeaders, "*")
+ // DEBUG only
+ //disp("Copying "+allHeaders(i)+" in "+SCI2COutputPath+"/includes/");
+ copyfile(allHeaders(i), SCI2COutputPath+"/includes/");
+ end
-else
+ // -- Interfaces
+ PrintStepInfo('Copying interfaces', FileInfo.GeneralReport,'both');
+ for i = 1:size(allInterfaces, "*")
+ // DEBUG only
+ //disp("Copying "+allInterfaces(i)+" in "+SCI2COutputPath+"/interfaces/");
+ copyfile(allInterfaces(i), SCI2COutputPath+"/interfaces/");
+ end
- if BuildTool == "make"
- C_GenerateMakefile(FileInfo,SharedInfo);
- copyBlasLapackLibs(FileInfo,SharedInfo); //Previously .dll files and blas,lapack library not creating for cygwin by additing this works fine
- end
- if BuildTool == "nmake"
- copyBlasLapackLibs(FileInfo,SharedInfo);
- C_GenerateMakefile_msvc(FileInfo,SharedInfo);
- end
-end
+ // -- Libraries
+ PrintStepInfo('Copying libraries', FileInfo.GeneralReport,'both');
+ for i = 1:size(allLibraries, "*")
+ // DEBUG only
+ //disp("Copying "+allInterfaces(i)+" in "+SCI2COutputPath+"/interfaces/");
+ copyfile(allLibraries(i), SCI2COutputPath+"/libraries/");
+ end
+ // --------------------------
+ // --- Generate Makefile. ---
+ // --------------------------
+ //If output format is chosen as 'Arduino', then copy makefile for arduino from
+ //default folder, else generate makefile for standalone c code
+
+ if (Target == 'Arduino')
+
+ GenerateSetupFunction(FileInfo);
+ mkdir(SCI2COutputPath+"/arduino/");
+ mkdir(SCI2COutputPath+"/arduino/sci2c_arduino");
+ //Copy arduino makefile
+ arduinoFiles = SCI2CHOME + "/" + getArduinoFiles();
+ PrintStepInfo('Copying arduino files', FileInfo.GeneralReport,'both');
+ copyfile(arduinoFiles(1), SCI2COutputPath);
+ for i = 2:size(arduinoFiles, "*")
+ // DEBUG only
+ //disp("Copying "+arduinoFiles(i)+" in "+SCI2COutputPath+"/arduino/sci2carduino");
+ copyfile(arduinoFiles(i), SCI2COutputPath+"/arduino/sci2c_arduino/");
+ end
+
+ else
+
+ if BuildTool == "make"
+ C_GenerateMakefile(FileInfo,SharedInfo);
+ copyBlasLapackLibs(FileInfo,SharedInfo); //Previously .dll files and blas,lapack library not creating for cygwin by additing this works fine
+ end
+ if BuildTool == "nmake"
+ copyBlasLapackLibs(FileInfo,SharedInfo);
+ C_GenerateMakefile_msvc(FileInfo,SharedInfo);
+ end
+ end
-// ------------------------------
-// --- Generate SCI2C Header. ---
-// ------------------------------
-// FIXME : Give the user the ability to set this prefix
-FunctionPrefix = "SCI2C";
-C_GenerateSCI2CHeader(SCI2COutputPath+"/includes/", FunctionPrefix);
+ // ------------------------------
+ // --- Generate SCI2C Header. ---
+ // ------------------------------
+ // FIXME : Give the user the ability to set this prefix
+ FunctionPrefix = "SCI2C";
+ C_GenerateSCI2CHeader(SCI2COutputPath+"/includes/", FunctionPrefix);
+end // RunMode <> FunCall
// -----------------
// --- Epilogue. ---
diff --git a/2.3-1/macros/scilab2c.bin b/2.3-1/macros/scilab2c.bin Binary files differindex ff634b64..91140d1a 100644 --- a/2.3-1/macros/scilab2c.bin +++ b/2.3-1/macros/scilab2c.bin diff --git a/2.3-1/macros/scilab2c.sci b/2.3-1/macros/scilab2c.sci index 118232ea..f352d1c5 100644 --- a/2.3-1/macros/scilab2c.sci +++ b/2.3-1/macros/scilab2c.sci @@ -66,8 +66,8 @@ function scilab2c(varargin) return end end - if varargin(4) <> "All" & varargin(4) <> "Translate" & varargin(4) <> "GenLibraryStructure" - error(msprintf(gettext("%s: argument #%d must be: ""All"", ""Translate"" or ""GenLibraryStructure"".\n"),"scilab2c",4)); + if varargin(4) <> "All" & varargin(4) <> "Translate" & varargin(4) <> "GenLibraryStructure" & varargin(4) <> "FunCall" + error(msprintf(gettext("%s: argument #%d must be: ""All"", ""Translate"",""GenLibraryStructure"" or ""FunCall"".\n"),"scilab2c",4)); return end UserScilabMainFile = varargin(1); @@ -87,8 +87,8 @@ function scilab2c(varargin) return end end - if varargin(4) <> "All" & varargin(4) <> "Translate" & varargin(4) <> "GenLibraryStructure" - error(msprintf(gettext("%s: argument #%d must be: ""All"", ""Translate"" or ""GenLibraryStructure"".\n"),"scilab2c",4)); + if varargin(4) <> "All" & varargin(4) <> "Translate" & varargin(4) <> "GenLibraryStructure" & varargin(4) <> "FunCall" + error(msprintf(gettext("%s: argument #%d must be: ""All"", ""Translate"",""GenLibraryStructure"" or ""FunCall"".\n"),"scilab2c",4)); return end if varargin(5) <> "make" & varargin(5) <> "nmake" @@ -112,8 +112,8 @@ function scilab2c(varargin) return end end - if varargin(4) <> "All" & varargin(4) <> "Translate" & varargin(4) <> "GenLibraryStructure" - error(msprintf(gettext("%s: argument #%d must be: ""All"", ""Translate"" or ""GenLibraryStructure"".\n"),"scilab2c",4)); + if varargin(4) <> "All" & varargin(4) <> "Translate" & varargin(4) <> "GenLibraryStructure" & varargin(4) <> "FunCall" + error(msprintf(gettext("%s: argument #%d must be: ""All"", ""Translate"" ,""GenLibraryStructure"" or ""FunCall"".\n"),"scilab2c",4)); return end if varargin(5) <> "make" & varargin(5) <> "nmake" |