summaryrefslogtreecommitdiff
path: root/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci
diff options
context:
space:
mode:
authorsiddhu89902016-02-01 11:05:35 +0530
committersiddhu89902016-02-01 11:05:35 +0530
commit3425c4fedbdbc7e1a3440df7502d9af93f466b84 (patch)
tree55f138b2e4c2133b1d01ce4959996452213e2d18 /2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci
parentef666a6b9ac74d5effe8b34179cc3ad0c247e7c3 (diff)
downloadScilab2C-3425c4fedbdbc7e1a3440df7502d9af93f466b84.tar.gz
Scilab2C-3425c4fedbdbc7e1a3440df7502d9af93f466b84.tar.bz2
Scilab2C-3425c4fedbdbc7e1a3440df7502d9af93f466b84.zip
Support for RPi gpios added
Diffstat (limited to '2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci')
-rw-r--r--2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci23
1 files changed, 17 insertions, 6 deletions
diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci
index 320d8035..424c8216 100644
--- a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -26,6 +26,8 @@ SCI2CNInArgCheck(argn(2),2,2);
// -----------------------
PrintStepInfo('Generating Builder '+FileInfo.MakefileFilename,...
FileInfo.GeneralReport,'both');
+
+target = SharedInfo.Target;
// ---------------------------
// --- End Initialization. ---
// ---------------------------
@@ -41,28 +43,37 @@ PrintStringInfo('# --- DIRECTORIES AND FILES ---',FileInfo.MakefileFilename,'fil
makecsrcdir = pathconvert('src/c', %f, %f, 'u');
makehsrcdir = pathconvert('includes', %f, %f, 'u');
makeisrcdir = pathconvert('interfaces', %f, %f, 'u');
+makelibdir = pathconvert('libraries', %f, %f, 'u');
makesci2cdir = FileInfo.CStyleOutCCCodeDir;
PrintStringInfo('CSRCDIR = '+makecsrcdir,FileInfo.MakefileFilename,'file','y','y');
PrintStringInfo('HSRCDIR = '+makehsrcdir,FileInfo.MakefileFilename,'file','y','y');
PrintStringInfo('ISRCDIR = '+makeisrcdir,FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('LIBDIR = '+makelibdir,FileInfo.MakefileFilename,'file','y','y');
PrintStringInfo('SCI2CDIR = .',FileInfo.MakefileFilename,'file','y','y');
// Compiler definition
-PrintStringInfo('CC = gcc',FileInfo.MakefileFilename,'file','y','y');
-PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR)',FileInfo.MakefileFilename,'file','y','y');
-PrintStringInfo('LDFLAGS = -lblas -llapack -lm',FileInfo.MakefileFilename,'file','y','y');
-
+if (target == 'RPi')
+ PrintStringInfo('CC = arm-linux-gnueabihf-gcc ',FileInfo.MakefileFilename,'file','y','y');
+else
+ PrintStringInfo('CC = gcc',FileInfo.MakefileFilename,'file','y','y');
+end
+PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
+if (target == 'RPi')
+ PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lm -lbcm2835',FileInfo.MakefileFilename,'file','y','y');
+else
+ PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y');
+end
// Binary definition
PrintStringInfo('EXEFILENAME = mytest.exe',FileInfo.MakefileFilename,'file','y','y');
PrintStringInfo('EXEFILE = $(SCI2CDIR)/$(EXEFILENAME)', FileInfo.MakefileFilename,'file','y','y');
// Sources
//Check the output format selected and insert files according to it
-outformat = SharedInfo.OutFormat;
+target = SharedInfo.Target;
PrintStringInfo('SRC = \\', FileInfo.MakefileFilename,'file','y','y');
-allSources = getAllSources(outformat);
+allSources = getAllSources(target);
nbSources = size(allSources);
for i = 1:(nbSources(1) - 1)
[tmppath,tmpfile,tmpext] = fileparts(allSources(i));