Libft is a 42 Madrid Common Core project in which you will learn to build your own C library that will be useful for future projects.
In the Libft project you will make your own set of functions based in the C standard library as well as other functions that do not belong to it.
- You will have to recode some of the C standard library
libc
functions. - The functions will have the same prototypes and will behave like the original ones.
- The functions must stick to the
man
official software documentation descriptions. - The functions nomenclature will begin with
ft_
. - For example:
strlen
will beft_strlen
.
- You will have to code new functions or some of those in the C standard library
libc
but in a different way. - Some of this functions may be useful to finish coding some of the Mandatory Part I functions.
- The use of global variables is forbidden.
- If you have to split your function into others, make sure that they are static functions so that they cannot be used outside the script.
- All files must be in the repository root folder.
- The delivery of unused files is forbidden.
- The program must compile with the
-Wall -Wextra -Werror
compiler flags. - You must use the
ar
command to create the library.libtool
is strictly forbidden. - The
libft.a
file must be created in the repository root folder.
- C compiler:
gcc
,cc
, etc... make
utility.
make
: compile project.make clean
: deletes compilation files except the executables.make fclean
: deletes all compilation files.make re
: executesmake fclean
andmake
.
-
Clone the repository:
git clone https://github.com/RaulSoftDev/libft.git
-
Build the project:
make
-
Use the library in your project:
#include "libft/libft.h"
-
Compile your project:
gcc -Wall -Wextra -Werror *.c libft/libft.a