summaryrefslogtreecommitdiff
path: root/2.3-1/macros/runsci2c.sci
diff options
context:
space:
mode:
authorsiddhu89902015-09-11 02:28:56 +0530
committersiddhu89902015-09-11 02:28:56 +0530
commited0947602f9b92489be97219e36eb284804dab0a (patch)
tree0972e6c28e60c026fb4e84d9e7ed6b0f922e6066 /2.3-1/macros/runsci2c.sci
parent48097fd488521bbb915c301a313ca0a7f0b6eb17 (diff)
downloadScilab2C-ed0947602f9b92489be97219e36eb284804dab0a.tar.gz
Scilab2C-ed0947602f9b92489be97219e36eb284804dab0a.tar.bz2
Scilab2C-ed0947602f9b92489be97219e36eb284804dab0a.zip
Changes made for making directory 'arduino' in output folder'
Diffstat (limited to '2.3-1/macros/runsci2c.sci')
-rw-r--r--2.3-1/macros/runsci2c.sci48
1 files changed, 36 insertions, 12 deletions
diff --git a/2.3-1/macros/runsci2c.sci b/2.3-1/macros/runsci2c.sci
index fbdad316..ee7510ef 100644
--- a/2.3-1/macros/runsci2c.sci
+++ b/2.3-1/macros/runsci2c.sci
@@ -1,4 +1,4 @@
-function runsci2c(UserScilabMainFile, UserSciFilesPaths, SCI2COutputPath, Runmode, BuildTool)
+function runsci2c(UserScilabMainFile, UserSciFilesPaths, SCI2COutputPath, Runmode, BuildTool,OutFormat)
// function runsci2c(SCI2CInputPrmFile)
// -----------------------------------------------------------------
// === hArtes/PoliBa/GAP SCI2C tool ===
@@ -51,7 +51,7 @@ disp(RunSci2CMainDir);
// --- Initialize the SCI2C tool directories and files. ---
[FileInfoDatFile,SharedInfoDatFile] = INIT_SCI2C(UserScilabMainFile, ...
- UserSciFilesPaths, SCI2COutputPath, RunMode);
+ UserSciFilesPaths, SCI2COutputPath, RunMode, OutFormat);
// -- Load FileInfo and SharedInfo
load(SharedInfoDatFile,'SharedInfo');
@@ -124,6 +124,37 @@ for i = 1:size(allInterfaces, "*")
copyfile(allInterfaces(i), SCI2COutputPath+"/interfaces/");
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 (OutFormat == 'Arduino')
+ mkdir(SCI2COutputPath+"/arduino/");
+ mkdir(SCI2COutputPath+"/arduino/sci2c_arduino");
+ //Copy arduino makefile
+ arduinoFiles = SCI2CHOME + "/" + getArduinoFiles();
+ PrintStepInfo('Copying arduino files', FileInfo.GeneralReport,'both');
+ for i = 1: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);
+ end
+ if BuildTool == "nmake"
+ copyBlasLapackLibs(FileInfo,SharedInfo);
+ C_GenerateMakefile_msvc(FileInfo,SharedInfo);
+ end
+end
+
+
// ------------------------------
// --- Generate SCI2C Header. ---
// ------------------------------
@@ -131,16 +162,7 @@ end
FunctionPrefix = "SCI2C";
C_GenerateSCI2CHeader(SCI2COutputPath+"/includes/", FunctionPrefix);
-// --------------------------
-// --- Generate Makefile. ---
-// --------------------------
-if BuildTool == "make"
- C_GenerateMakefile(FileInfo,SharedInfo);
-end
-if BuildTool == "nmake"
- copyBlasLapackLibs(FileInfo,SharedInfo);
- C_GenerateMakefile_msvc(FileInfo,SharedInfo);
-end
+
// -----------------
// --- Epilogue. ---
@@ -150,6 +172,8 @@ if (RunMode == 'All' | RunMode == 'Translate')
elseif (RunMode == 'GenLibraryStructure')
PrintStepInfo('Library Structure Successfully Created!!!',FileInfo.GeneralReport,'both');
end
+
+
endfunction