Skip to content
This repository was archived by the owner on Aug 19, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
PATH_GNL = ..

NAME = gnl_out
NAME_B = gnl_out
NAME_SUB = run_out
DIR_CPY = gnl_cpy
CC = gcc

all:
@echo "use \"bash run.sh\""
@echo "use \"bash run_bonus.sh\""

$(NAME): cp_f
@$(CC) main.c -o $(NAME)
bonus: cp_f_b
@$(CC) main.c -o $(NAME)

f:
@./$(NAME)
@rm -rf $(DIR_CPY)
@rm -rf $(NAME) $(NAME_SUB)

kk: $(NAME) f
kk_b: bonus f

cp_f: main.c gnl_main.c clean
@mkdir $(DIR_CPY)
@cp $(PATH_GNL)/get_next_line.c $(DIR_CPY)
@cp $(PATH_GNL)/get_next_line.h $(DIR_CPY)
@cp $(PATH_GNL)/get_next_line_utils.c $(DIR_CPY)
cp_f_b: main.c gnl_main.c clean
@mkdir $(DIR_CPY)
@cp $(PATH_GNL)/get_next_line_bonus.c $(DIR_CPY)/get_next_line.c
@cp $(PATH_GNL)/get_next_line_bonus.h $(DIR_CPY)/get_next_line.h
@cp $(PATH_GNL)/get_next_line_bonus.h $(DIR_CPY)
@cp $(PATH_GNL)/get_next_line_utils_bonus.c $(DIR_CPY)/get_next_line_utils.c

clean:
@rm -rf $(DIR_CPY)
fclean: clean
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# GET NEXT LINE TESTER
1 - EDIT Makefile PATH\
2 - bash run.sh
1 - EDIT Makefile PATH
2 - bash run.sh
3 - bash run_bonus.sh
11 changes: 11 additions & 0 deletions run_bonus.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
make cp_f_b
gcc -Wall -Werror -Wextra compi_main.c gnl_cpy/*.c > cmp_error.txt -D BUFFER_SIZE=50 2>&1
check=$(cat cmp_error.txt | wc -l | tr -d " ")
if [ $check -gt 0 ]; then
gcc -Wall -Werror -Wextra compi_main.c gnl_cpy/*.c -D BUFFER_SIZE=50
else
./a.out
rm ./a.out
make kk_b
fi
rm -f cmp_error.txt