New rules

This commit is contained in:
lalgarra 2025-10-29 21:20:41 +01:00
parent ee59b93faa
commit 3e47560e13

View file

@ -6,7 +6,7 @@
# By: lalgarra <lalgarra@student.42madrid.com> +#+ +:+ +#+ # # By: lalgarra <lalgarra@student.42madrid.com> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2025/10/22 20:41:03 by lalgarra #+# #+# # # Created: 2025/10/22 20:41:03 by lalgarra #+# #+# #
# Updated: 2025/10/27 03:51:10 by lalgarra ### ########.fr # # Updated: 2025/10/29 21:20:10 by lalgarra ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #
@ -15,6 +15,8 @@ NAME = report
# Relative location of sources to test # Relative location of sources to test
LIBDIR = ../repo_algarra LIBDIR = ../repo_algarra
TIME = /usr/bin/time
GNL_SOURCES = get_next_line.c get_next_line_utils.c GNL_SOURCES = get_next_line.c get_next_line_utils.c
SOURCES = $(foreach f, $(GNL_SOURCES), $(LIBDIR)/$f) SOURCES = $(foreach f, $(GNL_SOURCES), $(LIBDIR)/$f)
#OBJECTS = $(SOURCES:.c=.o) #OBJECTS = $(SOURCES:.c=.o)
@ -33,22 +35,22 @@ test001: test001.c $(SOURCES)
report_01: test001.c $(SOURCES) report_01: test001.c $(SOURCES)
$(CC) $(CFLAGS) -D BUFFER_SIZE=42 $+ -o test001_01 $(CC) $(CFLAGS) -D BUFFER_SIZE=42 $+ -o test001_01
printf "==\n test001_01: BUFFER_SIZE=42: input001 vs output001\n" >> $@ printf "==\n test001_01: BUFFER_SIZE=42: input001 vs output001\n" >> $@
./test001_01 input001 > output001 $(TIME) ./test001_01 input001 > output001
diff -s input001 output001 >> $@ diff -s input001 output001 >> $@
printf "==\n test001_01: BUFFER_SIZE=42: input002 vs output002\n" >> $@ printf "==\n test001_01: BUFFER_SIZE=42: input002 vs output002\n" >> $@
./test001_01 input002 > output002 $(TIME) ./test001_01 input002 > output002
diff -s input002 output002 >> $@ diff -s input002 output002 >> $@
printf "==\n test001_01: BUFFER_SIZE=42: input003 vs output003\n" >> $@ printf "==\n test001_01: BUFFER_SIZE=42: input003 vs output003\n" >> $@
./test001_01 input003 > output003 $(TIME) ./test001_01 input003 > output003
diff -s input003 output003 >> $@ diff -s input003 output003 >> $@
printf "==\n test001_01: BUFFER_SIZE=42: input004 vs output004\n" >> $@ printf "==\n test001_01: BUFFER_SIZE=42: input004 vs output004\n" >> $@
./test001_01 input004 > output004 $(TIME) ./test001_01 input004 > output004
diff -s input004 output004 >> $@ diff -s input004 output004 >> $@
printf "==\n test001_01: BUFFER_SIZE=42: input005 vs output005\n" >> $@ printf "==\n test001_01: BUFFER_SIZE=42: input005 vs output005\n" >> $@
./test001_01 input005 > output005 $(TIME) ./test001_01 input005 > output005
diff -s input005 output005 >> $@ diff -s input005 output005 >> $@
printf "==\n test001_01: BUFFER_SIZE=42: input006 vs output006\n" >> $@ printf "==\n test001_01: BUFFER_SIZE=42: input006 vs output006\n" >> $@
./test001_01 input006 > output006 $(TIME) ./test001_01 input006 > output006
diff -s input006 output006 >> $@ diff -s input006 output006 >> $@
#$(NAME): $(OBJECTS) $(LIBDIR)/libftprintf.a #$(NAME): $(OBJECTS) $(LIBDIR)/libftprintf.a
@ -69,13 +71,15 @@ report_01: test001.c $(SOURCES)
# $(MAKE) -C $(LIBDIR) clean # $(MAKE) -C $(LIBDIR) clean
fclean: fclean:
rm -f test001 report_01 rm -f test001 test001_01 output* report_01
all: report_01
#all: $(NAME) #all: $(NAME)
## builds all ## builds all
#
#re: fclean all re: fclean all
## cleans and rebuild all
# #
## ##
##CFLAGS += -Wall -Wextra -Werror -g3 -iquote $(LIBDIR) \ ##CFLAGS += -Wall -Wextra -Werror -g3 -iquote $(LIBDIR) \