From db464f35f5a10b58d9ed1085e0b462689adee583 Mon Sep 17 00:00:00 2001
From: Siddhesh Wani
Date: Mon, 25 May 2015 14:46:31 +0530
Subject: Original Version

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 112 ++++++++++++++++++++++++++
 1 file changed, 112 insertions(+)
 create mode 100644 macros/CCodeGeneration/C_GenerateMakefile.sci

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
new file mode 100644
index 00000000..8956d51d
--- /dev/null
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -0,0 +1,112 @@
+function C_GenerateMakefile(FileInfo,SharedInfo)
+// function C_GenerateMakefile(FileInfo,SharedInfo)
+// -----------------------------------------------------------------
+// Generate the makefile.
+//
+// Input data:
+// //NUT: add description here
+//
+// Output data:
+// //NUT: add description here
+//
+// Status:
+// 26-Jan-2008 -- Raffaele Nutricato: Author.
+//
+// Copyright 2007 Raffaele Nutricato.
+// Contact: raffaele.nutricato@tiscali.it
+// -----------------------------------------------------------------
+
+// ------------------------------
+// --- Check input arguments. ---
+// ------------------------------
+SCI2CNInArgCheck(argn(2),2,2);
+
+// -----------------------
+// --- Initialization. ---
+// -----------------------
+PrintStepInfo('Generating Builder '+FileInfo.MakefileFilename,...
+   FileInfo.GeneralReport,'both');
+// ---------------------------
+// --- End Initialization. ---
+// ---------------------------
+
+PrintStringInfo('# SCI2C Makefile',FileInfo.MakefileFilename,'file','y');
+PrintStringInfo('# hArtes EU Project.',FileInfo.MakefileFilename,'file','y');
+PrintStringInfo('# Authors: PoliBa & Inria',FileInfo.MakefileFilename,'file','y');
+PrintStringInfo('# -----------------------',FileInfo.MakefileFilename,'file','y');
+PrintStringInfo('# --- USER PARAMETERS ---',FileInfo.MakefileFilename,'file','y');
+PrintStringInfo('# -----------------------',FileInfo.MakefileFilename,'file','y');
+PrintStringInfo('# --- DIRECTORIES AND FILES ---',FileInfo.MakefileFilename,'file','y');
+
+makecsrcdir  = pathconvert('src/c', %f, %f, 'u');
+makehsrcdir  = pathconvert('includes', %f, %f, 'u');
+makeisrcdir  = pathconvert('interfaces', %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('SCI2CDIR    = .',FileInfo.MakefileFilename,'file','y','y');
+
+// Compiler definition
+PrintStringInfo('CC     = gcc',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('CFLAGS = -Wall -pedantic -I $(HSRCDIR) -I $(ISRCDIR)',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('LDFLAGS = -lblas -llapack -lm',FileInfo.MakefileFilename,'file','y','y');
+
+// Binary definition
+PrintStringInfo('EXEFILENAME = mytest.exe',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('EXEFILE = $(SCI2CDIR)/$(EXEFILENAME)', FileInfo.MakefileFilename,'file','y','y');
+
+// Sources
+PrintStringInfo('SRC = \\', FileInfo.MakefileFilename,'file','y','y');
+allSources = getAllSources();
+nbSources = size(allSources);
+for i = 1:(nbSources(1) - 1)
+  [tmppath,tmpfile,tmpext] = fileparts(allSources(i));
+  PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
+end
+[tmppath,tmpfile,tmpext] = fileparts(allSources(nbSources(1)));
+PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext, FileInfo.MakefileFilename,'file','y','y');
+
+// Objects
+PrintStringInfo('OBJ = $(SRC:.c=.o)', FileInfo.MakefileFilename,'file','y','y');
+
+// Rules
+PrintStringInfo('# ---------------',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('# --- TARGETS ---',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('# ---------------',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('compileexecute: $(OBJ)',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo "" ""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo ""============================""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo ""Generation of the executable""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo ""============================""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t$(CC) $(CFLAGS) $(OBJ) *.c $(LDFLAGS) -o $(EXEFILE)',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo "" ""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo ""==============""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo ""Executing code""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo ""==============""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t$(EXEFILE)',FileInfo.MakefileFilename,'file','y','y');
+
+PrintStringInfo('clean:',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo "" ""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo ""=============================""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo ""Removing only exe + obj files""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo ""=============================""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\trm -rf $(EXEFILE)',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\trm -rf $(OBJ)',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo "" ""',FileInfo.MakefileFilename,'file','y','y');
+
+PrintStringInfo('distclean: clean',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo "" ""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo ""==========================""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo ""Removing only the exe file""',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t@echo ""==========================""',FileInfo.MakefileFilename,'file','y','y');
+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
\ No newline at end of file
-- 
cgit 


From 222a3e39441ad408dacdc39d46d687dee5a6bf3c Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Thu, 20 Aug 2015 01:20:26 +0530
Subject: Support for disp added

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index 8956d51d..e2fe6036 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -51,7 +51,7 @@ PrintStringInfo('SCI2CDIR    = .',FileInfo.MakefileFilename,'file','y','y');
 
 // Compiler definition
 PrintStringInfo('CC     = gcc',FileInfo.MakefileFilename,'file','y','y');
-PrintStringInfo('CFLAGS = -Wall -pedantic -I $(HSRCDIR) -I $(ISRCDIR)',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');
 
 // Binary definition
@@ -109,4 +109,4 @@ if getos() == 'Windows' then
   C_GenerateMakefile_msvc(FileInfo,SharedInfo);
 end
 
-endfunction
\ No newline at end of file
+endfunction
-- 
cgit 


From dd343609eabf4afcee2aa8eeeda3a383333d30e5 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Mon, 28 Sep 2015 14:10:44 +0530
Subject: Extension compatible with both - standalone and Arduino outputs.

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index e2fe6036..320d8035 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -59,8 +59,10 @@ PrintStringInfo('EXEFILENAME = mytest.exe',FileInfo.MakefileFilename,'file','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;
 PrintStringInfo('SRC = \\', FileInfo.MakefileFilename,'file','y','y');
-allSources = getAllSources();
+allSources = getAllSources(outformat);
 nbSources = size(allSources);
 for i = 1:(nbSources(1) - 1)
   [tmppath,tmpfile,tmpext] = fileparts(allSources(i));
-- 
cgit 


From cad39eb3d3f3509eb44e87e2aeac210e9328fdc0 Mon Sep 17 00:00:00 2001
From: Mushirahmed
Date: Fri, 15 Jan 2016 16:42:49 +0530
Subject: added -L./ -lblasplus for windows and removed Makefile.mak generation

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

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
-- 
cgit 


From 5df6d1cb2868abdc8df66755f76c997ee36c0b49 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Mon, 1 Feb 2016 11:05:35 +0530
Subject: Support for RPi gpios added

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index 320d8035..424c8216 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/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));
-- 
cgit 


From 7c5fc74b8ea4a27dac0b44d681d36e46ac08d8fa Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Wed, 2 Mar 2016 14:20:36 +0530
Subject: Intermediate commit

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 35 ++++++++++++++-------------
 1 file changed, 18 insertions(+), 17 deletions(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index 1ef5a411..4817af1e 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -56,25 +56,26 @@ PrintStringInfo('LIBDIR     = '+makelibdir,FileInfo.MakefileFilename,'file','y',
 PrintStringInfo('SCI2CDIR    = .',FileInfo.MakefileFilename,'file','y','y');
 
 if getos() == 'Windows' then   
-
-    // Compiler definition
-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
-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');
+     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 
+	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
 end
+
 // Binary definition
 PrintStringInfo('EXEFILENAME = mytest.exe',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('EXEFILE = $(SCI2CDIR)/$(EXEFILENAME)', FileInfo.MakefileFilename,'file','y','y');
-- 
cgit 


From 212c54043e454e41ca4b23a5b965d4dbd4b683fe Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Fri, 27 May 2016 11:50:04 +0530
Subject: Support for basic ODE function added

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index 4817af1e..fecbf915 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -75,6 +75,10 @@ else
 		PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y');
 	end
 end
+//If ode function is used, add libgsl.
+if(size(SharedInfo.ODElist) <> 0)
+	PrintStringInfo('LDFLAGS += -lgsl',FileInfo.MakefileFilename,'file','y','y');
+end
 
 // Binary definition
 PrintStringInfo('EXEFILENAME = mytest.exe',FileInfo.MakefileFilename,'file','y','y');
-- 
cgit 


From c75fb67154fb5679d6ede9a52d5f5ae15600f9f9 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Mon, 6 Jun 2016 09:18:33 +0530
Subject: File handling functions added

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index fecbf915..94b36964 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -90,10 +90,19 @@ target = SharedInfo.Target;
 PrintStringInfo('SRC = \\', FileInfo.MakefileFilename,'file','y','y');
 allSources = getAllSources(target);
 nbSources = size(allSources);
+
 for i = 1:(nbSources(1) - 1)
   [tmppath,tmpfile,tmpext] = fileparts(allSources(i));
-  PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
+  
+  if(~isempty(strstr(allSources(i),'ode')))
+    if(size(SharedInfo.ODElist) <> 0)
+       PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
+    end
+  else
+    PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
+  end
 end
+
 [tmppath,tmpfile,tmpext] = fileparts(allSources(nbSources(1)));
 PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext, FileInfo.MakefileFilename,'file','y','y');
 
-- 
cgit 


From 169db0082ebd07baea82d00213db6ffd4dee7cf6 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Mon, 27 Jun 2016 19:16:41 +0530
Subject: test commit

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index 94b36964..b1c1e71e 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -120,11 +120,12 @@ PrintStringInfo('\t@echo ""Generation of the executable""',FileInfo.MakefileFile
 PrintStringInfo('\t@echo ""============================""',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('\t$(CC) $(CFLAGS) $(OBJ) *.c $(LDFLAGS) -o $(EXEFILE)',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('\t@echo "" ""',FileInfo.MakefileFilename,'file','y','y');
-PrintStringInfo('\t@echo ""==============""',FileInfo.MakefileFilename,'file','y','y');
-PrintStringInfo('\t@echo ""Executing code""',FileInfo.MakefileFilename,'file','y','y');
-PrintStringInfo('\t@echo ""==============""',FileInfo.MakefileFilename,'file','y','y');
-PrintStringInfo('\t$(EXEFILE)',FileInfo.MakefileFilename,'file','y','y');
-
+if(target == "StandAlone")
+  PrintStringInfo('\t@echo ""==============""',FileInfo.MakefileFilename,'file','y','y');
+  PrintStringInfo('\t@echo ""Executing code""',FileInfo.MakefileFilename,'file','y','y');
+  PrintStringInfo('\t@echo ""==============""',FileInfo.MakefileFilename,'file','y','y');
+  PrintStringInfo('\t$(EXEFILE)',FileInfo.MakefileFilename,'file','y','y');
+end
 PrintStringInfo('clean:',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('\t@echo "" ""',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('\t@echo ""=============================""',FileInfo.MakefileFilename,'file','y','y');
-- 
cgit 


From 24fbba33153e7758df4a990cb4c21ae8e53e6f3e Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Mon, 25 Jul 2016 15:59:40 +0530
Subject: WiringPi used for RaspberryPi (Gpio, serial, Threads, ISRs)

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index b1c1e71e..29e8a084 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -70,14 +70,16 @@ else
 	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');
+		PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lm -lwiringPi',FileInfo.MakefileFilename,'file','y','y');
 	else
 		PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y');
 	end
 end
 //If ode function is used, add libgsl.
-if(size(SharedInfo.ODElist) <> 0)
+if(size(SharedInfo.Includelist) <> 0)
+  if((mtlb_strcmp(part(SharedInfo.Includelist(1),1:5),'odefn') == %T))
 	PrintStringInfo('LDFLAGS += -lgsl',FileInfo.MakefileFilename,'file','y','y');
+  end
 end
 
 // Binary definition
@@ -95,8 +97,10 @@ for i = 1:(nbSources(1) - 1)
   [tmppath,tmpfile,tmpext] = fileparts(allSources(i));
   
   if(~isempty(strstr(allSources(i),'ode')))
-    if(size(SharedInfo.ODElist) <> 0)
-       PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
+    if(size(SharedInfo.Includelist) <> 0)
+        if((mtlb_strcmp(part(SharedInfo.Includelist(1),1:5),'odefn') == %T))
+          PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
+        end
     end
   else
     PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
-- 
cgit 


From c8fd6991786ccddb44547b619178bb391f3f9b96 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Thu, 18 Aug 2016 15:47:18 +0530
Subject: RPi-PWM and basic imaage processing

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index 29e8a084..a9156168 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -65,15 +65,14 @@ if getos() == 'Windows' then
 else 
 	if (target == 'RPi')
 		PrintStringInfo('CC     = arm-linux-gnueabihf-gcc ',FileInfo.MakefileFilename,'file','y','y');
-	else
+	  PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
+    PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lm -lwiringPi',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 -lwiringPi',FileInfo.MakefileFilename,'file','y','y');
-	else
-		PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y');
-	end
+    PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
+	  PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y');
+  end 
+	
 end
 //If ode function is used, add libgsl.
 if(size(SharedInfo.Includelist) <> 0)
@@ -82,21 +81,26 @@ if(size(SharedInfo.Includelist) <> 0)
   end
 end
 
+if(SharedInfo.OpenCVUsed == %T)
+  PrintStringInfo('LDFLAGS += `pkg-config --libs opencv`',FileInfo.MakefileFilename,'file','y','y');
+  PrintStringInfo('CFLAGS += `pkg-config --cflags opencv`',FileInfo.MakefileFilename,'file','y','y');
+end
+
 // Binary definition
-PrintStringInfo('EXEFILENAME = mytest.exe',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('EXEFILENAME = '+SharedInfo.SCIMainFunName,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
 target = SharedInfo.Target;
 PrintStringInfo('SRC = \\', FileInfo.MakefileFilename,'file','y','y');
-allSources = getAllSources(target);
+allSources = getAllSources(SharedInfo);
 nbSources = size(allSources);
 
 for i = 1:(nbSources(1) - 1)
   [tmppath,tmpfile,tmpext] = fileparts(allSources(i));
   
-  if(~isempty(strstr(allSources(i),'ode')))
+  if(~isempty(strstr(allSources(i),'dode')))
     if(size(SharedInfo.Includelist) <> 0)
         if((mtlb_strcmp(part(SharedInfo.Includelist(1),1:5),'odefn') == %T))
           PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
-- 
cgit 


From ea1e22e36a9559448919d7ae2dd24a25743861ec Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Thu, 25 Aug 2016 10:29:32 +0530
Subject: Basic image prcessing working for RPi

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index a9156168..f184c39c 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -66,11 +66,21 @@ else
 	if (target == 'RPi')
 		PrintStringInfo('CC     = arm-linux-gnueabihf-gcc ',FileInfo.MakefileFilename,'file','y','y');
 	  PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
-    PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lm -lwiringPi',FileInfo.MakefileFilename,'file','y','y');
+    PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lwiringPi',FileInfo.MakefileFilename,'file','y','y');
+    if(SharedInfo.OpenCVUsed == %T)
+      PrintStringInfo('LDFLAGS += -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann',FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('LDFLAGS += -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml',FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('LDFLAGS += -lopencv_nonfree -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching',FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('LDFLAGS += -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab -lrt -lpthread -lm -ldl', FileInfo.MakefileFilename,'file','y','y');
+    end
   else
 		PrintStringInfo('CC     = gcc',FileInfo.MakefileFilename,'file','y','y');
     PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
 	  PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y');
+    if(SharedInfo.OpenCVUsed == %T)
+      PrintStringInfo('LDFLAGS += `pkg-config --libs opencv`',FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('CFLAGS += `pkg-config --cflags opencv`',FileInfo.MakefileFilename,'file','y','y');
+    end
   end 
 	
 end
@@ -81,11 +91,6 @@ if(size(SharedInfo.Includelist) <> 0)
   end
 end
 
-if(SharedInfo.OpenCVUsed == %T)
-  PrintStringInfo('LDFLAGS += `pkg-config --libs opencv`',FileInfo.MakefileFilename,'file','y','y');
-  PrintStringInfo('CFLAGS += `pkg-config --cflags opencv`',FileInfo.MakefileFilename,'file','y','y');
-end
-
 // Binary definition
 PrintStringInfo('EXEFILENAME = '+SharedInfo.SCIMainFunName,FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('EXEFILE = $(SCI2CDIR)/$(EXEFILENAME)', FileInfo.MakefileFilename,'file','y','y');
-- 
cgit 


From 2790257d385a9d7d9e0dab9205baf4b3df0dd8c8 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Mon, 29 Aug 2016 10:47:52 +0530
Subject: OpenCV interface changed from c to c++

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 59 ++++++++++++++++-----------
 1 file changed, 35 insertions(+), 24 deletions(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index f184c39c..7ea24437 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -59,27 +59,35 @@ if getos() == 'Windows' then
   
      // Compiler definition
      PrintStringInfo('CC     = gcc',FileInfo.MakefileFilename,'file','y','y');
+     PrintStringInfo('CXX     = g++',FileInfo.MakefileFilename,'file','y','y');
      PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR)',FileInfo.MakefileFilename,'file','y','y');
+     PrintStringInfo('CXXFLAGS = -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 
 	if (target == 'RPi')
 		PrintStringInfo('CC     = arm-linux-gnueabihf-gcc ',FileInfo.MakefileFilename,'file','y','y');
+    PrintStringInfo('CXX     = arm-linux-gnueabihf-g++ ',FileInfo.MakefileFilename,'file','y','y');
 	  PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
+    PrintStringInfo('CXXFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
     PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lwiringPi',FileInfo.MakefileFilename,'file','y','y');
     if(SharedInfo.OpenCVUsed == %T)
-      PrintStringInfo('LDFLAGS += -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann',FileInfo.MakefileFilename,'file','y','y');
-      PrintStringInfo('LDFLAGS += -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml',FileInfo.MakefileFilename,'file','y','y');
-      PrintStringInfo('LDFLAGS += -lopencv_nonfree -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching',FileInfo.MakefileFilename,'file','y','y');
-      PrintStringInfo('LDFLAGS += -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab -lrt -lpthread -lm -ldl', FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('LDFLAGS += -lopencv_calib3d -lopencv_contrib -lopencv_features2d -lopencv_flann -lopencv_gpu',FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('LDFLAGS += -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree',FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('LDFLAGS += -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres',FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('LDFLAGS += -lopencv_ts -lopencv_video -lopencv_videostab -lopencv_core -lrt -lpthread -lm -ldl', FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('LDFLAGS += -lIlmImf -ljpeg -ljasper -ltiff -lpng -lzlib -lstdc++',FileInfo.MakefileFilename,'file','y','y');
     end
   else
 		PrintStringInfo('CC     = gcc',FileInfo.MakefileFilename,'file','y','y');
+    PrintStringInfo('CXX     = g++',FileInfo.MakefileFilename,'file','y','y');
     PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
+    PrintStringInfo('CXXFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
 	  PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y');
     if(SharedInfo.OpenCVUsed == %T)
       PrintStringInfo('LDFLAGS += `pkg-config --libs opencv`',FileInfo.MakefileFilename,'file','y','y');
       PrintStringInfo('CFLAGS += `pkg-config --cflags opencv`',FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('CXXFLAGS += `pkg-config --cflags opencv`',FileInfo.MakefileFilename,'file','y','y');
     end
   end 
 	
@@ -98,40 +106,42 @@ PrintStringInfo('EXEFILE = $(SCI2CDIR)/$(EXEFILENAME)', FileInfo.MakefileFilenam
 // Sources
 //Check the output format selected and insert files according to it
 target = SharedInfo.Target;
-PrintStringInfo('SRC = \\', FileInfo.MakefileFilename,'file','y','y');
-allSources = getAllSources(SharedInfo);
-nbSources = size(allSources);
+PrintStringInfo('SRC = $(wildcard $(CSRCDIR)/*.c)', FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('SRCC = $(wildcard $(CSRCDIR)/*.cpp)', FileInfo.MakefileFilename,'file','y','y');
+// allSources = getAllSources(SharedInfo);
+// nbSources = size(allSources);
 
-for i = 1:(nbSources(1) - 1)
-  [tmppath,tmpfile,tmpext] = fileparts(allSources(i));
+// for i = 1:(nbSources(1) - 1)
+//   [tmppath,tmpfile,tmpext] = fileparts(allSources(i));
   
-  if(~isempty(strstr(allSources(i),'dode')))
-    if(size(SharedInfo.Includelist) <> 0)
-        if((mtlb_strcmp(part(SharedInfo.Includelist(1),1:5),'odefn') == %T))
-          PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
-        end
-    end
-  else
-    PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
-  end
-end
-
-[tmppath,tmpfile,tmpext] = fileparts(allSources(nbSources(1)));
-PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext, FileInfo.MakefileFilename,'file','y','y');
+//   if(~isempty(strstr(allSources(i),'dode')))
+//     if(size(SharedInfo.Includelist) <> 0)
+//         if((mtlb_strcmp(part(SharedInfo.Includelist(1),1:5),'odefn') == %T))
+//           PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
+//         end
+//     end
+//   else
+//     PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
+//   end
+// end
+
+// [tmppath,tmpfile,tmpext] = fileparts(allSources(nbSources(1)));
+// PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext, FileInfo.MakefileFilename,'file','y','y');
 
 // Objects
 PrintStringInfo('OBJ = $(SRC:.c=.o)', FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('OBJC = $(SRCC:.cpp=.o)', FileInfo.MakefileFilename,'file','y','y');
 
 // Rules
 PrintStringInfo('# ---------------',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('# --- TARGETS ---',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('# ---------------',FileInfo.MakefileFilename,'file','y','y');
-PrintStringInfo('compileexecute: $(OBJ)',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('compileexecute: $(OBJ) $(OBJC)',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('\t@echo "" ""',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('\t@echo ""============================""',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('\t@echo ""Generation of the executable""',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('\t@echo ""============================""',FileInfo.MakefileFilename,'file','y','y');
-PrintStringInfo('\t$(CC) $(CFLAGS) $(OBJ) *.c $(LDFLAGS) -o $(EXEFILE)',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\t$(CXX) $(CFLAGS) $(OBJ) $(OBJC) *.c $(LDFLAGS) -o $(EXEFILE)',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('\t@echo "" ""',FileInfo.MakefileFilename,'file','y','y');
 if(target == "StandAlone")
   PrintStringInfo('\t@echo ""==============""',FileInfo.MakefileFilename,'file','y','y');
@@ -146,6 +156,7 @@ PrintStringInfo('\t@echo ""Removing only exe + obj files""',FileInfo.MakefileFil
 PrintStringInfo('\t@echo ""=============================""',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('\trm -rf $(EXEFILE)',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('\trm -rf $(OBJ)',FileInfo.MakefileFilename,'file','y','y');
+PrintStringInfo('\trm -rf $(OBJC)',FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('\t@echo "" ""',FileInfo.MakefileFilename,'file','y','y');
 
 PrintStringInfo('distclean: clean',FileInfo.MakefileFilename,'file','y','y');
-- 
cgit 


From c7e9597db39140c1d982f796a8e1f03bb54e7905 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Mon, 24 Apr 2017 14:08:37 +0530
Subject: Fixed float.h issue. OpenCV with built libraries working for linux
 x64

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index 7ea24437..07891c56 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -85,9 +85,14 @@ else
     PrintStringInfo('CXXFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
 	  PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y');
     if(SharedInfo.OpenCVUsed == %T)
-      PrintStringInfo('LDFLAGS += `pkg-config --libs opencv`',FileInfo.MakefileFilename,'file','y','y');
-      PrintStringInfo('CFLAGS += `pkg-config --cflags opencv`',FileInfo.MakefileFilename,'file','y','y');
-      PrintStringInfo('CXXFLAGS += `pkg-config --cflags opencv`',FileInfo.MakefileFilename,'file','y','y');
+      //PrintStringInfo('LDFLAGS += `pkg-config --libs opencv`',FileInfo.MakefileFilename,'file','y','y');
+      //PrintStringInfo('CFLAGS += `pkg-config --cflags opencv`',FileInfo.MakefileFilename,'file','y','y');
+      //PrintStringInfo('CXXFLAGS += `pkg-config --cflags opencv`',FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('LDFLAGS += -lopencv_calib3d -lopencv_contrib -lopencv_features2d -lopencv_flann -lopencv_gpu',FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('LDFLAGS += -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree',FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('LDFLAGS += -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres',FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('LDFLAGS += -lopencv_ts -lopencv_video -lopencv_videostab -lopencv_core -lrt -lpthread -lm -ldl', FileInfo.MakefileFilename,'file','y','y');
+      PrintStringInfo('LDFLAGS += -lIlmImf -ljpeg -ljasper -ltiff -lpng -lzlib -lstdc++',FileInfo.MakefileFilename,'file','y','y');
     end
   end 
 	
-- 
cgit 


From e36eac94dd517bb69d3e5782516ee58942451991 Mon Sep 17 00:00:00 2001
From: Siddhesh Wani
Date: Thu, 4 May 2017 16:15:18 +0530
Subject: Basic functions and image processing working with MSVC on windows x64

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 37 +++------------------------
 1 file changed, 3 insertions(+), 34 deletions(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index 07891c56..7dfb4da4 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -71,31 +71,20 @@ else
 	  PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
     PrintStringInfo('CXXFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
     PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lwiringPi',FileInfo.MakefileFilename,'file','y','y');
-    if(SharedInfo.OpenCVUsed == %T)
-      PrintStringInfo('LDFLAGS += -lopencv_calib3d -lopencv_contrib -lopencv_features2d -lopencv_flann -lopencv_gpu',FileInfo.MakefileFilename,'file','y','y');
-      PrintStringInfo('LDFLAGS += -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree',FileInfo.MakefileFilename,'file','y','y');
-      PrintStringInfo('LDFLAGS += -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres',FileInfo.MakefileFilename,'file','y','y');
-      PrintStringInfo('LDFLAGS += -lopencv_ts -lopencv_video -lopencv_videostab -lopencv_core -lrt -lpthread -lm -ldl', FileInfo.MakefileFilename,'file','y','y');
-      PrintStringInfo('LDFLAGS += -lIlmImf -ljpeg -ljasper -ltiff -lpng -lzlib -lstdc++',FileInfo.MakefileFilename,'file','y','y');
-    end
   else
 		PrintStringInfo('CC     = gcc',FileInfo.MakefileFilename,'file','y','y');
     PrintStringInfo('CXX     = g++',FileInfo.MakefileFilename,'file','y','y');
     PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
     PrintStringInfo('CXXFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
 	  PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y');
-    if(SharedInfo.OpenCVUsed == %T)
-      //PrintStringInfo('LDFLAGS += `pkg-config --libs opencv`',FileInfo.MakefileFilename,'file','y','y');
-      //PrintStringInfo('CFLAGS += `pkg-config --cflags opencv`',FileInfo.MakefileFilename,'file','y','y');
-      //PrintStringInfo('CXXFLAGS += `pkg-config --cflags opencv`',FileInfo.MakefileFilename,'file','y','y');
+  end 
+	if(SharedInfo.OpenCVUsed == %T)
       PrintStringInfo('LDFLAGS += -lopencv_calib3d -lopencv_contrib -lopencv_features2d -lopencv_flann -lopencv_gpu',FileInfo.MakefileFilename,'file','y','y');
       PrintStringInfo('LDFLAGS += -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree',FileInfo.MakefileFilename,'file','y','y');
       PrintStringInfo('LDFLAGS += -lopencv_objdetect -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres',FileInfo.MakefileFilename,'file','y','y');
       PrintStringInfo('LDFLAGS += -lopencv_ts -lopencv_video -lopencv_videostab -lopencv_core -lrt -lpthread -lm -ldl', FileInfo.MakefileFilename,'file','y','y');
       PrintStringInfo('LDFLAGS += -lIlmImf -ljpeg -ljasper -ltiff -lpng -lzlib -lstdc++',FileInfo.MakefileFilename,'file','y','y');
-    end
-  end 
-	
+  end
 end
 //If ode function is used, add libgsl.
 if(size(SharedInfo.Includelist) <> 0)
@@ -110,28 +99,8 @@ PrintStringInfo('EXEFILE = $(SCI2CDIR)/$(EXEFILENAME)', FileInfo.MakefileFilenam
 
 // Sources
 //Check the output format selected and insert files according to it
-target = SharedInfo.Target;
 PrintStringInfo('SRC = $(wildcard $(CSRCDIR)/*.c)', FileInfo.MakefileFilename,'file','y','y');
 PrintStringInfo('SRCC = $(wildcard $(CSRCDIR)/*.cpp)', FileInfo.MakefileFilename,'file','y','y');
-// allSources = getAllSources(SharedInfo);
-// nbSources = size(allSources);
-
-// for i = 1:(nbSources(1) - 1)
-//   [tmppath,tmpfile,tmpext] = fileparts(allSources(i));
-  
-//   if(~isempty(strstr(allSources(i),'dode')))
-//     if(size(SharedInfo.Includelist) <> 0)
-//         if((mtlb_strcmp(part(SharedInfo.Includelist(1),1:5),'odefn') == %T))
-//           PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
-//         end
-//     end
-//   else
-//     PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
-//   end
-// end
-
-// [tmppath,tmpfile,tmpext] = fileparts(allSources(nbSources(1)));
-// PrintStringInfo('    $(CSRCDIR)/'+tmpfile+tmpext, FileInfo.MakefileFilename,'file','y','y');
 
 // Objects
 PrintStringInfo('OBJ = $(SRC:.c=.o)', FileInfo.MakefileFilename,'file','y','y');
-- 
cgit 


From fad32de9c3df04a8fb032f9c604c79c89d062154 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Tue, 20 Jun 2017 15:26:40 +0530
Subject: Bug fixed for GSL library

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index 7dfb4da4..893ec938 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -78,6 +78,25 @@ else
     PrintStringInfo('CXXFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
 	  PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y');
   end 
+
+  //If ode function is used, add libgsl.
+  if(size(SharedInfo.Includelist) <> 0)
+    if((mtlb_strcmp(part(SharedInfo.Includelist(1),1:5),'odefn') == %T))
+      if(target == 'RPi')
+        PrintStringInfo('LDFLAGS = -lgsl -lcblas',FileInfo.MakefileFilename,'file','y','y');
+      else
+        PrintStringInfo('LDFLAGS = -lgsl',FileInfo.MakefileFilename,'file','y','y');
+      end
+        
+    end
+  end
+
+  if (target == 'RPi')
+    PrintStringInfo('LDFLAGS += -llapack -lrefblas -lgfortran -lwiringPi',FileInfo.MakefileFilename,'file','y','y');
+  else
+    PrintStringInfo('LDFLAGS += -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y');
+  end 
+
 	if(SharedInfo.OpenCVUsed == %T)
       PrintStringInfo('LDFLAGS += -lopencv_calib3d -lopencv_contrib -lopencv_features2d -lopencv_flann -lopencv_gpu',FileInfo.MakefileFilename,'file','y','y');
       PrintStringInfo('LDFLAGS += -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree',FileInfo.MakefileFilename,'file','y','y');
-- 
cgit 


From aef4e8398f2b1848b0e4cdd9580dbbe93e4006f9 Mon Sep 17 00:00:00 2001
From: Jorawar Singh
Date: Fri, 30 Jun 2017 11:28:58 +0530
Subject: Help files, modified Raspberry Pi code conversion

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index 7dfb4da4..f209b382 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -70,7 +70,7 @@ else
     PrintStringInfo('CXX     = arm-linux-gnueabihf-g++ ',FileInfo.MakefileFilename,'file','y','y');
 	  PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
     PrintStringInfo('CXXFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
-    PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lwiringPi',FileInfo.MakefileFilename,'file','y','y');
+    PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lwiringPi -lwiringPiDev -lrt -lpthread',FileInfo.MakefileFilename,'file','y','y');
   else
 		PrintStringInfo('CC     = gcc',FileInfo.MakefileFilename,'file','y','y');
     PrintStringInfo('CXX     = g++',FileInfo.MakefileFilename,'file','y','y');
-- 
cgit 


From 1dc99d862fe3178a3a6e72e2c1338000545ec859 Mon Sep 17 00:00:00 2001
From: Ankitr19
Date: Fri, 7 Jul 2017 12:47:56 +0530
Subject: Demos and RPi compiler compatibility

---
 macros/CCodeGeneration/C_GenerateMakefile.sci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'macros/CCodeGeneration/C_GenerateMakefile.sci')

diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index 3b977bd6..dbdae9d3 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -70,7 +70,7 @@ else
     PrintStringInfo('CXX     = arm-linux-gnueabihf-g++ ',FileInfo.MakefileFilename,'file','y','y');
 	  PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
     PrintStringInfo('CXXFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y');
-    PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lwiringPi -lwiringPiDev -lrt -lpthread',FileInfo.MakefileFilename,'file','y','y');
+    PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lwiringPi -lwiringPiDev -lrt -lpthread -lRPIwfi',FileInfo.MakefileFilename,'file','y','y');
   else
 		PrintStringInfo('CC     = gcc',FileInfo.MakefileFilename,'file','y','y');
     PrintStringInfo('CXX     = g++',FileInfo.MakefileFilename,'file','y','y');
-- 
cgit