From 77491c8e61f7d8e0580a35ad3e98cd7ef2ee7f68 Mon Sep 17 00:00:00 2001 From: klmp200 Date: Sat, 10 Dec 2016 02:28:10 +0100 Subject: [PATCH] Add true makefile + lists --- CellElemFunc.o | Bin 8752 -> 0 bytes Exe | Bin 12184 -> 0 bytes LibCell/Makefile | 27 +++++++ CellElemFunc.c => LibList/CellElement.c | 44 ++++------- CellElement.h => LibList/CellElement.h | 9 ++- LibList/Makefile | 29 +++++++ LibList/list.h | 99 ++++++++++++++++++++++++ Makefile | 68 ++++++++++++---- main.c | 28 +++++++ 9 files changed, 256 insertions(+), 48 deletions(-) delete mode 100644 CellElemFunc.o delete mode 100755 Exe create mode 100644 LibCell/Makefile rename CellElemFunc.c => LibList/CellElement.c (84%) rename CellElement.h => LibList/CellElement.h (94%) create mode 100644 LibList/Makefile create mode 100644 LibList/list.h create mode 100644 main.c diff --git a/CellElemFunc.o b/CellElemFunc.o deleted file mode 100644 index 96608af0cbafdb81c8bf19173a8df0fe65391999..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8752 zcmb`M3tWs@8^GThDN3cVA$C}a)aXL!W|C?m3K3yzswruj+Gce5NUL1RWu=5IL**m4TsL$hEM*ni^_}z1bH>}z?tb6*`_Aw8zUMsu=Q+>woXdNgNp|=4 z(A3aiNYP+im=6-64D-VDLtDr;g-l<@h?y-)uNS30<)={>CRemJdEr3TRpJE-_g7C7MmV{_A|Z zu@#g4GptlG(tOx9uoenKY{d%P?Wvj~wG!pi={jInvA?<}T2ejkc0id~Sy{QoO2i6D zC_h9ZmAXqMQ4*N~Q3f3mGPxvHF_z4bt zvrs-ik*#_%Qi(WBeRG(sg@?|l<%GPX?5e5RuBPRUZBDJ;8%G!A1{7&WwrW*Yj?FN< z_`>jt#LIQALC<4@6}yAWoV(o_60k`iUTQu0c-r(CgB;>4o1WY&Ez5O%wfNQ2oSg7; zG5W3VmN(@58XvapLC)Ij>a_uS*W@?vK3|=#UwkJ=>9T%f@0Et~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v+?Av4?= zP^?%MF2P+tFlmHLLb{-Mj36XB3jZ6z2xQR;i2(hqWF=RKLn5J*WKm#PtT;*nqx;`0 zKI)3skh|vCn-HH+p?~6qZKP77^FVaqttmtYx75H-6Xbb>zb$ZI@&hutKMe;Cw;i>M zLK=XEj&BJ*Y4iWIzYWCa?o}L$^k0PqPNC!D?>&~0fq|_JT(9#e$8`S*$iA!j%YYA| z{XJ9;@%-U6B4Nnj^q~63~Y9rLhhW=cJ+oT`idx25gjM)bLO{fmkFqz$` ze^>MOB_ytdKzRP}vw-v`^NP1AeeK~cLQ{NZn8T_{eWuc3$3y4N_QQ*XN*XBfZ&LV{ VLdVB@s;l_p;r^44^xQ(n|2O)IG(!LY diff --git a/Exe b/Exe deleted file mode 100755 index c2c0af90e4d800864c326702d4afaa6a9533fa41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12184 zcmeHNe{dAneSdp*I^9X)bdmrIu+7?li+|`Ofly_z%;~33u>cthJ9U8NbhnZYPIvO% z9=~FyxFT*;f{h#7!z48IxM{{yJ2PaGxN0FF2F5a-W{PK;gqb=m&cq&J>;w|*%GgHz zeBZuzx3@Yup6N{bPv6b$_xJaG-;aI!zHj%>JGwg^io#@Zu=^QN7hOTlGOvtXxPy~| z*TlRm$d)jbxxp#IKgcBnO-#Zm;aWnE&~pO1@NaUMj3!5rBNE~3nTX>16jlYtey-Q=HiA6UPM*Ocu?P!#iA{Amu5{KEquJp6Ru zM?c>B=H(y!W%PGDUU{jCS4Z};KA>Ny)IqDVfM)3|e2TM>{;jj{SAnnMZ!b52QOFNN zKSiip8rg8hNVDNoEMfGsp>RB&j4(|jv6eQ%DMK3y#}ceRrR!i13?&nSt+5BXyIR|{ z6@e82s@)-egi-&{k1;u(nT0VgN!r1qa;1D5hcq|jTp`Akg>Su|s{PwY%!={1_PuK1 ziz&_ZmRtBVp0d-40(~l8NpC=`Sq2a-mZ!9 zac_`?CQkQoF!A#u)G_bf5|v#mUyM#0+kn6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DljgzD #include -int main(int argc, char **argv){ - cellElement * tree = NULL; - tree = CreateCellElem(); - tree->colIndex = 1; - AddNextRow(tree); - tree->nextRow->colIndex = 2; - AddNextCol(tree); - tree->nextCol->colIndex = 3; - recursivePrint(tree); - removeNextRow(tree); - removeNextCol(tree); - - recursivePrint(tree); - - - return 0; - -} cellElement * CreateCellElem(){ cellElement * elem = NULL; elem = (cellElement*) malloc(sizeof(cellElement)); - + if (elem == NULL){ return NULL; } @@ -40,8 +22,8 @@ cellElement * CreateCellElem(){ elem->nextCol = NULL; elem->nextRow = NULL; - - return elem; + + return elem; } void freeCellElem(cellElement * elem){ @@ -53,7 +35,7 @@ int AddNextCol(cellElement* tree){ cellElement * elem = NULL; elem = (cellElement*) malloc(sizeof(cellElement)); - + if (elem == NULL){ return -1; } @@ -69,7 +51,7 @@ int AddNextCol(cellElement* tree){ }else{ return -2; } - + return 1; } @@ -78,7 +60,7 @@ int AddNextRow(cellElement* tree){ cellElement * elem = NULL; elem = (cellElement*) malloc(sizeof(cellElement)); - + if (elem == NULL){ return -1; } @@ -104,7 +86,7 @@ void removeNextCol(cellElement* tree){ free(elem); elem = NULL; tree->nextCol = NULL; - + } } @@ -117,7 +99,7 @@ void removeNextRow(cellElement* tree){ free(elem); elem =NULL; tree->nextRow = NULL; - + } } @@ -135,4 +117,10 @@ void recursivePrint(cellElement * tree){ } } -} \ No newline at end of file +} + +void FreeCellElement(cellElement* element) { + if (element != NULL){ + free(element); + } +} diff --git a/CellElement.h b/LibList/CellElement.h similarity index 94% rename from CellElement.h rename to LibList/CellElement.h index 67b0a9e..9c8f5e9 100644 --- a/CellElement.h +++ b/LibList/CellElement.h @@ -7,7 +7,7 @@ *@false : 0 */ typedef enum Bool{ - + true = 1, false = 0 @@ -27,7 +27,7 @@ typedef enum Bool{ * */ struct cellElement { - + int colIndex; int rowIndex; @@ -47,7 +47,8 @@ int AddNextRow(cellElement* tree); void removeNextCol(cellElement* list); void removeNextRow(cellElement* list); - void recursivePrint(cellElement * tree); -#endif \ No newline at end of file +void FreeCellElement(cellElement* element); + +#endif diff --git a/LibList/Makefile b/LibList/Makefile new file mode 100644 index 0000000..5f92df2 --- /dev/null +++ b/LibList/Makefile @@ -0,0 +1,29 @@ +CC=gcc +CFLAGS=-Wall -Werror -pedantic -fpic -g + + +LIBSDIR=-L/usr/lib -L../Libs +INCLUDEDIR=-I/usr/include -I. + +#Library variables +LIBTARGET=libList.so +LIBSOURCE=list CellElement +LIBSOURCECFILE=$(LIBSOURCE:=.c) +LIBSOURCEOFILE=$(LIBSOURCE:=.o) + +#Generating the library binary +$(LIBTARGET): $(LIBSOURCEOFILE) + @echo "\n Generating the library binary" + $(CC) $(CFLAGS) -shared $(LIBSOURCEOFILE) -o ../Libs/$(LIBTARGET) + +#Generating object files +.c.o: + @echo "\n Generating " $@ " from " $< + $(CC) $(CFLAGS) $(INCLUDEDIR) -c -o $@ $< + +#Cleaning +clean: + @echo "\n Cleaning" + rm -rf *.o *.exe *.so + + diff --git a/LibList/list.h b/LibList/list.h new file mode 100644 index 0000000..455c941 --- /dev/null +++ b/LibList/list.h @@ -0,0 +1,99 @@ +#ifndef LIST_H +#define LIST_H + +#include + +#define SUCCESS 0 +#define FAILURE 1 + +typedef struct ListElement ListElement; +struct ListElement { + void *data; + ListElement *next; + ListElement *previous; +}; + +typedef struct List { + ListElement *head; + ListElement *tail; + int size; +} List; + +/* + * Create a new list + * @return a pointer of list + */ +List * CreateList(); + +/* + * Insert an element at the begining of a list + * @param list pointer of a list + * @param data any type of data + * @param size size of the data + * @return status of the operation + */ +int unshift(List* list, cellElement* data); + +/* + * Insert an element at the end of a list + * @param list pointer of a list + * @param data any type of data + * @param size size of the data + * @return status of the operation + */ +int push(List* list, cellElement* data); + +/* + * Get an element in a given list + * @param list as a pointer + * @param nb the number of the element (can be negative) + * @return an element + */ +ListElement * GetElement(List *list, int nb); + +/* + * Delete an element with a pointer of element in the list + * @param list as a pointer + * @param element of the list as a pointer + * @return status of the operation + */ +int PopPtnList(List *list, ListElement *element); + +/* + * Delete an element with a position in the list + * @param list as a pointer + * @param position of the element + * @return status of the operation + */ +int RemoveElement(List *list, int nb); + +/* + * Delete the first element of the list + * @param list as a pointer + * @return status of the operation + */ +int shift(List *list); + +/* + * Delete the last element of the list + * @param list as a pointer + * @return status of the operation + */ +int pop(List *list); + +/* + * Delete every elements in a list + * @param list as a pointer + * @return status of the operation + */ +int DeleteListContent(List *list); + + +/* + * Free a list + * @param list as a pointer + * @return status of the operation + */ +int FreeList(List *list); + +#endif /* LIST_H */ diff --git a/Makefile b/Makefile index 6d01a5e..d7e22c6 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,57 @@ -CXX = gcc -TARGET = Exe -SOURCEFILE = CellElemFunc -CFLAGS = -Wall -Werror -ansi -pedantic -fpic -I. -g +# Makefile compiling the whole project +# Don't forget before the first compilation to run that command: +# export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:./Libs -#Generating the executable -$(TARGET): $(SOURCEFILE).o - @echo "Generating the executable" $@ - $(CXX) $(CFLAGS) $(SOURCEFILE).o -o $@ +CC=gcc +CFLAGS=-Wall -Werror -pedantic -fpic -g -$(SOURCEFILE).o: - @echo "Generating objectfiles" $@ - $(CXX) $(CFLAGS) -c $(SOURCEFILE).c -o $@ -#Cleaning the executable +LIBSDIR=-L/usr/lib -L./Libs +INCLUDEDIR=-I/usr/include -I. -I./LibCell -I./LibList + +#Exe test variables +TARGET=main.exe +SOURCE=main + +SOURCECFILE=$(SOURCE:=.c) +SOURCEOFILE=$(SOURCE:=.o) + +#Library variables +DEPENDENCE=libCellElement.so +DEPENDENCENAME=CellElement + +DEPENDENCELIST=libList.so +DEPENDENCENAMELIST=List + + +all: $(TARGET) + +#Generating the main.exe +$(TARGET): $(SOURCEOFILE) $(DEPENDENCELIST) lib + @echo "\n Generating the " $(TARGET) " binary" + $(CC) $(SOURCEOFILE) $(LIBSDIR) -l$(DEPENDENCENAME) -l$(DEPENDENCENAMELIST) -o $(TARGET) + +#Generating the library binary +lib: + @echo "\n Generating the automaton library binary" + mkdir -p Libs + $(MAKE) -C LibCell + +$(DEPENDENCELIST): + @echo "\n Generating the list library binary" + $(MAKE) -C LibList + + +#Generating object files +.c.o: + @echo "\n Generating " $@ " from " $< + $(CC) $(CFLAGS) $(INCLUDEDIR) -c -o $@ $< + + +#Cleaning clean: - @echo "Cleaning temporary files" - rm -rf *.o *- *.so $(TARGET) - + @echo "\n Cleaning" + rm -rf *.o ./Libs/*.so *.exe + $(MAKE) -C LibCell clean + $(MAKE) -C LibList clean - diff --git a/main.c b/main.c new file mode 100644 index 0000000..b1efa8a --- /dev/null +++ b/main.c @@ -0,0 +1,28 @@ +/********************************************************************************* +* File Name : main.c +* Created By : klmp200 +* Creation Date : [2016-12-10 01:06] +* Last Modified : [2016-12-10 01:07] +* Description : +**********************************************************************************/ + +#include +#include +#include + +int main(int argc, char **argv){ + cellElement * tree = NULL; + tree = CreateCellElem(); + tree->colIndex = 1; + AddNextRow(tree); + tree->nextRow->colIndex = 2; + AddNextCol(tree); + tree->nextCol->colIndex = 3; + recursivePrint(tree); + removeNextRow(tree); + removeNextCol(tree); + recursivePrint(tree); + + return 0; + +}