From 721eb1f55dd7b49c3d3ea7d7cd0b5a589d5b44a8 Mon Sep 17 00:00:00 2001 From: Naej <0mindstorming@gmail.com> Date: Wed, 9 Nov 2016 11:06:10 +0100 Subject: [PATCH 1/2] Added a first ver of the makefile --- Makefile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bf4ff53 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +CXX = gcc +TARGET = exe +SOURCEFILE = main +CFLAGS = -Wall -Werror -I. -ansi -pedantic -fpic -g +LIST_LIBRARY = matrix/libMatrix + +#Generating the executable +$(TARGET): $(SOURCEFILE).o + @echo "Generating the executable" + $(CXX) $(CFLAGS) $(SOURCEFILE).o -o $(TARGET) + +$(SOURCEFILE).o: $(LIST_LIBRARY).so + @echo "Generating $(SOURCEFILE).o" + $(CXX) $(CFLAGS) -Lmatrix -lmatrix -c $(SOURCEFILE).c -o $@ -LlibMatrix -llibMatrix.so + +$(LIST_LIBRARY).so:clean + @echo "Generating libMatrix.so" $@ + #gcc matrix.c -I. -Wall -Werror -fpic -shared -o $(LIST_LIBRARY).so + $(CXX) -Wall -Werror -ansi -pedantic -I. matrix.c -o $(LIST_LIBRARY).so -shared -fpic + + +#Cleaning the executable +clean: + @echo "Cleaning temporary files and libMatrix.so" + rm -rf *.o *- *.so $(TARGET) + rm -rf $(LIST_LIBRARY).so +#Generating library +lib: + @echo "Generating libMatrix.so" + $(CXX) -Wall -Werror -ansi -pedantic -I. matrix.c -o $(LIST_LIBRARY).so -shared -fpic + +release: + @echo "Generating a release version of the program" + make CFLAGS= '-Wall -Werror -I. -ansi -pedantic -fpic' + From ab06b30f00c9b9af3ae8305c51d6c175cc305078 Mon Sep 17 00:00:00 2001 From: Naej <0mindstorming@gmail.com> Date: Tue, 15 Nov 2016 14:13:50 +0100 Subject: [PATCH 2/2] Added the declaration of the cellElement and Bool types --- CellElement.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 CellElement.h diff --git a/CellElement.h b/CellElement.h new file mode 100644 index 0000000..83c7111 --- /dev/null +++ b/CellElement.h @@ -0,0 +1,44 @@ +#ifndef CELLELMNT_H +#define CELLELMNT_H + + +/*---bool--- +*@true : 1 +*@false : 0 +*/ +typedef enum Bool{ + + true = 1; + false = 0; + +} bool; + + +/*---cellElement--- +*Pointer on a cell of the matrix +* +*@colIndex : index (int) of the column of this cell +*@rowIndex : index (int) of the row of this cell +* +*@value : a boolean that is the content of the cell +* +*@nextCol : pointer on the next cellElement in the same column +*@nextRow : pointer on the next cellElement in the same row +* +*/ +struct cellElement { + + int colIndex; + int rowIndex; + + bool value; + + struct cellElement * nextCol; + struct cellElement * nextRow; + +}; +typedef struct cellElement * cellElement; + + + +#endif \ No newline at end of file