diff options
author | imushir | 2016-01-18 14:10:56 +0530 |
---|---|---|
committer | imushir | 2016-01-18 14:10:56 +0530 |
commit | 9fdbe6b47b95468bce7c0ae162aff138ec0b9b94 (patch) | |
tree | 16a96221aba82ce30ff8d2daeca19112e55800c3 /macros/CCodeGeneration | |
parent | c3cc6d1d15d8cf60a27f253205424adb9e498e6e (diff) | |
parent | 304ad0ee30ad83db53a76a76d7bb4f3392779eb4 (diff) | |
download | scilab2c-9fdbe6b47b95468bce7c0ae162aff138ec0b9b94.tar.gz scilab2c-9fdbe6b47b95468bce7c0ae162aff138ec0b9b94.tar.bz2 scilab2c-9fdbe6b47b95468bce7c0ae162aff138ec0b9b94.zip |
merged pulled
Diffstat (limited to 'macros/CCodeGeneration')
-rw-r--r-- | macros/CCodeGeneration/C_GenerateFunName.bin | bin | 5444 -> 6288 bytes | |||
-rw-r--r-- | macros/CCodeGeneration/C_GenerateFunName.sci | 36 | ||||
-rw-r--r-- | macros/CCodeGeneration/C_GenerateMakefile.sci | 22 |
3 files changed, 37 insertions, 21 deletions
diff --git a/macros/CCodeGeneration/C_GenerateFunName.bin b/macros/CCodeGeneration/C_GenerateFunName.bin Binary files differindex 6551c7f7..4f3c5917 100644 --- a/macros/CCodeGeneration/C_GenerateFunName.bin +++ b/macros/CCodeGeneration/C_GenerateFunName.bin diff --git a/macros/CCodeGeneration/C_GenerateFunName.sci b/macros/CCodeGeneration/C_GenerateFunName.sci index 9d40d2b9..657258a9 100644 --- a/macros/CCodeGeneration/C_GenerateFunName.sci +++ b/macros/CCodeGeneration/C_GenerateFunName.sci @@ -23,22 +23,30 @@ function CFunName = C_GenerateFunName(FunctionName,InArg,NInArg,OutArg,NOutArg) // ------------------------------ SCI2CNInArgCheck(argn(2),5,5); CFunName = ''; +if(IsAVRSupportFunction(FunctionName)) +//If current function is an AVR function, then function name can be just plain +//function name without any input/output arguments types -for tmpcnt = 1:NInArg - if (InArg(tmpcnt).Dimension == 1) - CFunName = CFunName+InArg(tmpcnt).Type+'2'; - else - CFunName = CFunName+InArg(tmpcnt).Type+SCI2Cstring(InArg(tmpcnt).Dimension); - end -end + CFunName = CFunName+FunctionName; + +else + + for tmpcnt = 1:NInArg + if (InArg(tmpcnt).Dimension == 1) + CFunName = CFunName+InArg(tmpcnt).Type+'2'; + else + CFunName = CFunName+InArg(tmpcnt).Type+SCI2Cstring(InArg(tmpcnt).Dimension); + end + end -CFunName = CFunName+FunctionName; + CFunName = CFunName+FunctionName; -for tmpcnt = 1:NOutArg - if (OutArg(tmpcnt).Dimension == 1) - CFunName = CFunName+OutArg(tmpcnt).Type+'2'; - else - CFunName = CFunName+OutArg(tmpcnt).Type+SCI2Cstring(OutArg(tmpcnt).Dimension); - end + for tmpcnt = 1:NOutArg + if (OutArg(tmpcnt).Dimension == 1) + CFunName = CFunName+OutArg(tmpcnt).Type+'2'; + else + CFunName = CFunName+OutArg(tmpcnt).Type+SCI2Cstring(OutArg(tmpcnt).Dimension); + end + end end endfunction diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci index 320d8035..b998257a 100644 --- a/macros/CCodeGeneration/C_GenerateMakefile.sci +++ b/macros/CCodeGeneration/C_GenerateMakefile.sci @@ -1,3 +1,5 @@ +//Removed 4 lines code from end that causes ot generate the Makefile.mak file that is not needed with cygwin +//Changed at line 52 function C_GenerateMakefile(FileInfo,SharedInfo) // function C_GenerateMakefile(FileInfo,SharedInfo) // ----------------------------------------------------------------- @@ -49,11 +51,19 @@ PrintStringInfo('HSRCDIR = '+makehsrcdir,FileInfo.MakefileFilename,'file','y PrintStringInfo('ISRCDIR = '+makeisrcdir,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 getos() == 'Windows' then + // 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 = -L./ -lblasplus -llapack -lm',FileInfo.MakefileFilename,'file','y','y'); //Added -L./ and -lblasplus(previously it was -lblas) + +else + // 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'); +end // Binary definition PrintStringInfo('EXEFILENAME = mytest.exe',FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('EXEFILE = $(SCI2CDIR)/$(EXEFILENAME)', FileInfo.MakefileFilename,'file','y','y'); @@ -107,8 +117,6 @@ PrintStringInfo('\t@echo ""==========================""',FileInfo.MakefileFilena PrintStringInfo('\trm -rf $(EXEFILE)',FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('\t@echo "" ""',FileInfo.MakefileFilename,'file','y','y'); -if getos() == 'Windows' then - C_GenerateMakefile_msvc(FileInfo,SharedInfo); -end + endfunction |