aboutsummaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-31 08:08:59 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-31 08:48:42 +0100
commit9db52bc5ef545a3fa9973002e9a28a2ece68d029 (patch)
tree0a1f36d989c6c3cb74e3bc5d5997c6a4c3f058b9 /script
parent3b884e3836c70b1a19eb7778308fadbc608b0384 (diff)
downloadlibft-9db52bc5ef545a3fa9973002e9a28a2ece68d029.tar.gz
libft-9db52bc5ef545a3fa9973002e9a28a2ece68d029.tar.bz2
libft-9db52bc5ef545a3fa9973002e9a28a2ece68d029.zip
Setup unit test with unity
Diffstat (limited to 'script')
-rwxr-xr-xscript/find_src.sh2
-rw-r--r--script/generate_rendu_makefile.sh5
-rw-r--r--script/template.makefile38
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