summaryrefslogtreecommitdiff
path: root/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci
diff options
context:
space:
mode:
authorsiddhu89902016-08-29 10:47:52 +0530
committersiddhu89902016-08-29 10:47:52 +0530
commit53ddbeb8c94cd71d37064d6d7e8ac56fef7ae5af (patch)
treeb002757ff60da2d674fc8690fcabbc544e0f7f2f /2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci
parent425ae9b5508196bc39ab98f12696550dfa6f872c (diff)
downloadScilab2C-53ddbeb8c94cd71d37064d6d7e8ac56fef7ae5af.tar.gz
Scilab2C-53ddbeb8c94cd71d37064d6d7e8ac56fef7ae5af.tar.bz2
Scilab2C-53ddbeb8c94cd71d37064d6d7e8ac56fef7ae5af.zip
OpenCV interface changed from c to c++
Diffstat (limited to '2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci')
-rw-r--r--2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci59
1 files changed, 35 insertions, 24 deletions
diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci
index f184c39c..7ea24437 100644
--- a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/2.3-1/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');