diff options
Diffstat (limited to 'script')
| -rwxr-xr-x | script/find_src.sh | 2 | ||||
| -rw-r--r-- | script/generate_rendu_makefile.sh | 5 | ||||
| -rw-r--r-- | script/template.makefile | 38 |
3 files changed, 44 insertions, 1 deletions
diff --git a/script/find_src.sh b/script/find_src.sh index 1d645a1..3773fc9 100755 --- a/script/find_src.sh +++ b/script/find_src.sh @@ -14,7 +14,7 @@ fi SRC_DIR=src -IGNORE_FIND_ARGS=`sed 's/.*/-not -path "&"/' $IGNORE_FILE | paste -sd " "` +IGNORE_FIND_ARGS=`sed 's/.*/-not -path "&"/' $IGNORE_FILE | paste -sd " " -` IGNORE_FIND_ARGS="$IGNORE_FIND_ARGS -not -name \"*inter*\"" sh -c "find $SRC_DIR $IGNORE_FIND_ARGS -name \"*.c\"" diff --git a/script/generate_rendu_makefile.sh b/script/generate_rendu_makefile.sh new file mode 100644 index 0000000..00a9e81 --- /dev/null +++ b/script/generate_rendu_makefile.sh @@ -0,0 +1,5 @@ +#!bin/sh + +SRC=`sh script/find_src.sh .libftignore` + +sed 's:\#INSERTSRC:'$SRC':g' template.makefile > rendu.makefile diff --git a/script/template.makefile b/script/template.makefile new file mode 100644 index 0000000..b0902ec --- /dev/null +++ b/script/template.makefile @@ -0,0 +1,38 @@ +# **************************************************************************** # +# # +# ::: :::::::: # +# Makefile :+: :+: :+: # +# +:+ +:+ +:+ # +# By: cacharle <marvin@42.fr> +#+ +:+ +#+ # +# +#+#+#+#+#+ +#+ # +# Created: 2019/10/08 15:45:53 by cacharle #+# #+# # +# Updated: 2020/01/31 06:51:18 by cacharle ### ########.fr # +# # +# **************************************************************************** # + +RM = rm -f +LIB = ar rcs + +CC = gcc +CCFLAGS = -Iinclude -Wall -Wextra -Werror + +#INSERTSRC + +OBJ = $(SRC:.c=.o) +NAME = libft.a + +all: $(NAME) + +$(NAME): $(OBJ) + $(LIB) $@ $(OBJ) + +%.o: %.c + $(CC) $(CCFLAGS) -c -o $@ $< + +clean: + $(RM) -r $(OBJ_DIR) + +fclean: clean + $(RM) $(NAME) + +re: fclean all |
