diff --git a/C_Piscine_C_07/Makefile b/C_Piscine_C_07/Makefile new file mode 100644 index 0000000..f285651 --- /dev/null +++ b/C_Piscine_C_07/Makefile @@ -0,0 +1,23 @@ + +# +# Copyright (c) 2021 Guy Baconniere. +# +## How to use this Makefile +# +# cd git +# mkdir ex00 +# cd ex00 +# make -f ../../Makefile ex00 +# + +clone: + @git clone git@vogsphere.42lausanne.ch:vogsphere/intra-uuid-e21d9203-b7f1-4e41-bc8e-18d34fc85e5d-3728040 git + +cc: + @norminette -R CheckForbiddenSourceHeader + @gcc -Wall -Wextra -Werror -o a.out *.c + @./a.out + @rm -f a.out + +all: clone + diff --git a/C_Piscine_C_07/fr.subject.pdf b/C_Piscine_C_07/fr.subject.pdf new file mode 100644 index 0000000..f323a90 Binary files /dev/null and b/C_Piscine_C_07/fr.subject.pdf differ diff --git a/C_Piscine_C_07/git/ex00/ft_print_program_name.c b/C_Piscine_C_07/git/ex00/ft_print_program_name.c new file mode 100644 index 0000000..4f8d211 --- /dev/null +++ b/C_Piscine_C_07/git/ex00/ft_print_program_name.c @@ -0,0 +1,26 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_print_program_name.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: gbaconni +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2021/08/17 10:58:23 by gbaconni #+# #+# */ +/* Updated: 2021/08/17 11:35:04 by gbaconni ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include + +int main(int argc, char *argv[]) +{ + int size; + + size = 0; + while (argc != -1 && argv[0][++size] != '\0') + continue ; + write(1, argv[0], size); + write(1, "\n", 1); + return (0); +} diff --git a/C_Piscine_C_07/git/ex00/main.sh b/C_Piscine_C_07/git/ex00/main.sh new file mode 100755 index 0000000..292faee --- /dev/null +++ b/C_Piscine_C_07/git/ex00/main.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e +#norminette -R CheckForbiddenSourceHeader ft_*.c +norminette -R CheckForbiddenSourceHeader +gcc -Wall -Wextra -Werror -o a.out *.c +echo $(basename $PWD): +./a.out +rm -f a.out