2021-10-22 10:26:25 +02:00
|
|
|
# libft
|
|
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
2021-10-24 00:48:53 +02:00
|
|
|
Clone [42test](https://vogsphere.baco.net/baco/42test)
|
2021-10-27 10:18:58 +02:00
|
|
|
```
|
|
|
|
|
git clone --recurse-submodules https://vogsphere.baco.net/baco/42test.git 42test
|
2021-10-27 10:23:54 +02:00
|
|
|
|
2021-10-27 10:18:58 +02:00
|
|
|
cd 42test
|
2021-10-27 10:23:54 +02:00
|
|
|
|
2021-10-27 10:18:58 +02:00
|
|
|
git config pull.rebase false
|
|
|
|
|
git config user.name "${USER-marvin}"
|
|
|
|
|
git config user.email "${MAIL-marvin@student.42lausanne.ch}"
|
|
|
|
|
```
|
2021-10-24 00:48:53 +02:00
|
|
|
|
2021-10-22 10:26:25 +02:00
|
|
|
Create a link to the base of your libft
|
|
|
|
|
(the one with libft.a and all ft_ and Makefile files)
|
|
|
|
|
```
|
2021-10-23 10:37:02 +02:00
|
|
|
cd libft
|
2021-10-22 10:33:46 +02:00
|
|
|
|
2021-10-23 10:37:02 +02:00
|
|
|
make setup
|
2021-10-22 10:26:25 +02:00
|
|
|
|
2021-10-23 10:37:02 +02:00
|
|
|
# You can also specify the path to your libft manually
|
|
|
|
|
ln -snvf $HOME/libft libft
|
2021-10-22 10:26:25 +02:00
|
|
|
```
|
|
|
|
|
|
2021-10-27 10:18:58 +02:00
|
|
|
**Only for Linux**
|
2021-10-22 11:19:43 +00:00
|
|
|
```
|
2021-10-27 07:13:52 +02:00
|
|
|
sudo apt-get install -qq -y make gcc clang valgrind build-essential
|
|
|
|
|
|
|
|
|
|
# for make d (alelievr/libft-unit-test)
|
|
|
|
|
sudo apt-get install -qq -y libbsd-dev libncurses-dev
|
|
|
|
|
vi 42test/libft/libft/Makefile
|
|
|
|
|
LIB = libft.so
|
|
|
|
|
so: $(OBJ) $(OBJ_BONUS)
|
|
|
|
|
@$(CC) $(CFLAGS) -shared -fPIC -o $(LIB) $(OBJ) $(OBJ_BONUS)
|
|
|
|
|
:wq
|
2021-10-22 11:19:43 +00:00
|
|
|
```
|
|
|
|
|
|
2021-10-22 10:26:25 +02:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
```
|
2021-10-22 16:07:10 +02:00
|
|
|
# Display various options
|
|
|
|
|
make help
|
|
|
|
|
|
2021-10-23 22:29:53 +02:00
|
|
|
# Tripouille/libftTester (straight to the point)
|
2021-10-22 10:26:25 +02:00
|
|
|
make b
|
2021-10-22 16:07:10 +02:00
|
|
|
|
2021-10-23 22:29:53 +02:00
|
|
|
# jtoty/Libftest (cool layout)
|
2021-10-22 10:26:25 +02:00
|
|
|
make c
|
2021-10-22 11:54:26 +00:00
|
|
|
|
2021-10-23 22:29:53 +02:00
|
|
|
# nemequ/µnit w/ my own Unit Testing (beta software not complete)
|
2021-10-22 11:54:26 +00:00
|
|
|
make a
|
|
|
|
|
|
2021-10-23 22:29:53 +02:00
|
|
|
# alelievr/libft-unit-test (mind the protect == NULL)
|
2021-10-27 10:23:54 +02:00
|
|
|
# Linux: please install libbsd-dev and setup so: in your libft/Makefile (check info above)
|
|
|
|
|
# MacOS X: ft_memmove and ft_strrchr will crash on Apple Silicon M1 and work on Intel
|
2021-10-22 10:26:25 +02:00
|
|
|
make d
|
2021-10-27 09:52:43 +02:00
|
|
|
make e
|
|
|
|
|
|
|
|
|
|
# ysoroko/ft_split_tester
|
|
|
|
|
make f
|
2021-10-22 11:54:26 +00:00
|
|
|
|
2021-10-24 17:43:39 +02:00
|
|
|
# test bonuses
|
|
|
|
|
make bonus
|
|
|
|
|
|
2021-10-27 09:52:43 +02:00
|
|
|
# launch a b c d e f (All you can eat)
|
2021-10-22 11:54:26 +00:00
|
|
|
make test
|
2021-10-22 10:26:25 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## External Subprojects
|
|
|
|
|
|
2021-10-22 16:00:36 +02:00
|
|
|
- a: [nemequ/µnit](https://nemequ.github.io/munit/)
|
|
|
|
|
- b: [Tripouille/libftTester](https://github.com/Tripouille/libftTester)
|
|
|
|
|
- c: [jtoty/Libftest](https://github.com/jtoty/Libftest)
|
2021-10-23 22:29:53 +02:00
|
|
|
- d: [alelievr/libft-unit-test (tests)](https://github.com/alelievr/libft-unit-test)
|
|
|
|
|
- e: [alelievr/libft-unit-test (bench)](https://github.com/alelievr/libft-unit-test)
|
2021-10-27 09:52:43 +02:00
|
|
|
- f: [ysoroko/ft_split_tester](https://github.com/Ysoroko/FT_SPLIT_TESTER)
|
2021-10-22 10:26:25 +02:00
|
|
|
|
2021-10-27 10:18:58 +02:00
|
|
|
## Update
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
cd libft
|
|
|
|
|
|
|
|
|
|
make update
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## REFERENCES
|
|
|
|
|
|
|
|
|
|
How to add submodules (already done)
|
2021-10-22 10:26:25 +02:00
|
|
|
```
|
2021-10-27 10:18:58 +02:00
|
|
|
cd libft
|
|
|
|
|
git submodule add -f https://github.com/jtoty/Libftest.git
|
|
|
|
|
git submodule add -f https://github.com/alelievr/libft-unit-test.git
|
|
|
|
|
git submodule add -f https://github.com/Tripouille/libftTester.git
|
|
|
|
|
git submodule add -f https://github.com/nemequ/munit.git
|
|
|
|
|
git submodule add -f https://github.com/Ysoroko/FT_SPLIT_TESTER.git
|
|
|
|
|
|
|
|
|
|
vi ../.gitignore
|
|
|
|
|
libft/Libftest
|
|
|
|
|
libft/libft-unit-test
|
|
|
|
|
libft/libftTester
|
|
|
|
|
libft/munit
|
|
|
|
|
libft/FT_SPLIT_TESTER
|
|
|
|
|
:wq
|
|
|
|
|
|
|
|
|
|
# add ignore
|
|
|
|
|
vi ../.gitmodules
|
|
|
|
|
[submodule "libft/Libftest"]
|
|
|
|
|
ignore = dirty
|
|
|
|
|
[submodule "libft/libft-unit-test"]
|
|
|
|
|
ignore = dirty
|
|
|
|
|
[submodule "libft/libfttester"]
|
|
|
|
|
ignore = dirty
|
|
|
|
|
[submodule "libft/munit"]
|
|
|
|
|
ignore = dirty
|
|
|
|
|
[submodule "libft/FT_SPLIT_TESTER"]
|
|
|
|
|
ignore = dirty
|
|
|
|
|
:wq
|
2021-10-22 10:26:25 +02:00
|
|
|
```
|
|
|
|
|
|