1
0
mirror of https://gitlab.com/klmp200/LO27.git synced 2024-11-22 22:13:19 +00:00

Deleted files + fixed makefile

This commit is contained in:
Antoine Bartuccio 2016-12-10 05:04:13 +01:00
parent 9d57b532f6
commit 99cf913820
10 changed files with 78 additions and 19 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
Libs/

27
LibCell/Makefile Normal file
View File

@ -0,0 +1,27 @@
CC=gcc
CFLAGS=-Wall -Werror -pedantic -fpic -g
LIBSDIR=-L/usr/lib -L../Libs
INCLUDEDIR=-I/usr/include -I.
#Library variables
LIBTARGET=libCellElement.so
LIBSOURCE=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

View File

@ -2,14 +2,14 @@
* @Author: klmp200
* @Date: 2016-12-10 01:32:50
* @Last Modified by: klmp200
* @Last Modified time: 2016-12-10 01:33:40
* @Last Modified time: 2016-12-10 04:29:48
*/
#include <stdio.h>
#include <stdlib.h>
#include <CellElment.h>
#include <CellElement.h>
void freeCellElement(cellElement* element) {
void FreeCellElement(cellElement* element) {
if (element != NULL){
free(element);
}

View File

@ -8,8 +8,8 @@
*/
typedef enum Bool{
true = 1;
false = 0;
true = 1,
false = 0
} bool;
@ -40,6 +40,6 @@ struct cellElement {
typedef struct cellElement * cellElement;
void freeCellElement(cellElement* element);
void FreeCellElement(cellElement* element);
#endif

30
LibList/Makefile Normal file
View File

@ -0,0 +1,30 @@
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"
mkdir -p ../Libs
$(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

View File

@ -9,7 +9,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <CellElment.h>
#include <CellElement.h>
#include <list.h>
#define SUCCESS 0
@ -36,7 +36,7 @@ int unshift(List *list, cellElement *data){
ListElement *newElement = malloc(sizeof(*newElement));
if (list != NULL && newElement != NULL && newData != NULL){
memcpy(newData, data, size);
memcpy(newData, data, sizeof(cellElement));
newElement->data = newData;
/* Insert the element at the begining of the list */
@ -71,7 +71,7 @@ int push(List *list, cellElement *data){
ListElement *newElement = malloc(sizeof(*newElement));
if(list != NULL && newElement != NULL && newData != NULL){
memcpy(newData, data, size);
memcpy(newData, data, sizeof(cellElement));
newElement->data = newData;
newElement->next = NULL;
if (list->tail == NULL){
@ -145,7 +145,7 @@ int PopPtnList(List *list, ListElement *element){
}
if (element->data != NULL){
freeCellElement(element->data);
FreeCellElement(element->data);
}
free(element);
list->size = list->size - 1;
@ -187,10 +187,10 @@ int DeleteListContent(List *list){
current = current->next;
if (toDelete->data != NULL){
freeCellElement(toDelete->data);
FreeCellElement(toDelete->data);
}
freeCellElement(toDelete);
free(toDelete);
}
list->head = NULL;
list->tail = NULL;

View File

@ -1,7 +1,7 @@
#ifndef LIST_H
#define LIST_H
#import <CellElement.h>
#include <CellElement.h>
#define SUCCESS 0
#define FAILURE 1
@ -41,7 +41,7 @@ int unshift(List* list, cellElement* data);
* @param size size of the data
* @return status of the operation
*/
int push(List* list, cellElement* data, int size);
int push(List* list, cellElement* data);
/*
* Get an element in a given list

View File

@ -3,7 +3,7 @@
# export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:./Libs
CC=gcc
CFLAGS=-Wall -Werror -ansi -pedantic -fpic -g
CFLAGS=-Wall -Werror -pedantic -fpic -g
LIBSDIR=-L/usr/lib -L./Libs
@ -34,6 +34,7 @@ $(TARGET): $(SOURCEOFILE) $(DEPENDENCELIST) lib
#Generating the library binary
lib:
@echo "\n Generating the automaton library binary"
mkdir -p Libs
$(MAKE) -C LibCell
$(DEPENDENCELIST):
@ -51,6 +52,6 @@ $(DEPENDENCELIST):
clean:
@echo "\n Cleaning"
rm -rf *.o ./Libs/*.so *.exe
$(MAKE) -C LibPoly clean
$(MAKE) -C LibCell clean
$(MAKE) -C LibList clean

BIN
main

Binary file not shown.

BIN
main.o

Binary file not shown.