Functional Makefile done
This commit is contained in:
parent
2d02955697
commit
61486dac3a
1 changed files with 11 additions and 8 deletions
19
Makefile
19
Makefile
|
|
@ -5,23 +5,25 @@
|
||||||
# +:+ +:+ +:+ #
|
# +:+ +:+ +:+ #
|
||||||
# By: lalgarra <lalgarra@student.42madrid.com> +#+ +:+ +#+ #
|
# By: lalgarra <lalgarra@student.42madrid.com> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2025/09/29 11:35:48 by lalgarra #+# #+# #
|
# Created: 2025/10/03 18:03:12 by lalgarra #+# #+# #
|
||||||
# Updated: 2025/10/01 21:14:37 by lalgarra ### ########.fr #
|
# Updated: 2025/10/03 18:10:11 by lalgarra ### ########.fr #
|
||||||
# #
|
# #
|
||||||
# **************************************************************************** #
|
# **************************************************************************** #
|
||||||
|
|
||||||
|
# Location of your libft.a; it must already exist
|
||||||
LIBDIR = ../repo_libft_algarra
|
LIBDIR = ../repo_libft_algarra
|
||||||
#LIBDIR = ../repo_algarra
|
#LIBDIR = ../repo_algarra
|
||||||
#CFLAGS += -Wall -Wextra -Werror -g3 -fsanitize=address
|
|
||||||
CFLAGS += -Wall -Wextra -Werror -g3 -iquote $(LIBDIR) -L$(LIBDIR) -lft
|
CFLAGS += -Wall -Wextra -Werror -g3 -iquote $(LIBDIR) -L$(LIBDIR) -lft
|
||||||
|
|
||||||
TESTS:= isalpha_test isdigit_test isalnum_test isascii_test
|
TESTS:= isalpha_test isdigit_test isalnum_test isascii_test
|
||||||
|
|
||||||
%_actual.output : %_test
|
%_actual.output : %_test
|
||||||
./$*_test > ./$*_actual.output ;
|
@./$*_test > ./$*_actual.output ;
|
||||||
|
|
||||||
%_report : %_test %_actual.output
|
%_report : %_test %_actual.output
|
||||||
-(diff -a $*_expected.output $*_actual.output && echo "Test OK") > $*_report
|
-(diff -a $*_expected.output $*_actual.output && \
|
||||||
|
echo "Test OK") > $*_report
|
||||||
|
|
||||||
EXES = $(TESTS)
|
EXES = $(TESTS)
|
||||||
|
|
||||||
|
|
@ -31,16 +33,17 @@ ACT_REPORTS = $(TESTS:_test=_report)
|
||||||
|
|
||||||
.SECONDARY = $(ACT_REPORTS) $(ACT_OUTPUTS)
|
.SECONDARY = $(ACT_REPORTS) $(ACT_OUTPUTS)
|
||||||
|
|
||||||
|
# Rule to create a 'report' file with info about the execution of
|
||||||
|
# tests in $(TEST)
|
||||||
report : $(EXES) $(ACT_OUTPUTS) $(ACT_REPORTS)
|
report : $(EXES) $(ACT_OUTPUTS) $(ACT_REPORTS)
|
||||||
rm -f report ;
|
@rm -f report ;
|
||||||
$(foreach E, $(TESTS), \
|
@$(foreach E, $(TESTS), \
|
||||||
$(eval T = $(subst _test,,$(E))) \
|
$(eval T = $(subst _test,,$(E))) \
|
||||||
$(eval R = $(subst _test,_report,$(E))) \
|
$(eval R = $(subst _test,_report,$(E))) \
|
||||||
echo "=== $(T) ===" >> report ; \
|
echo "=== $(T) ===" >> report ; \
|
||||||
cat $(R) >> report ; \
|
cat $(R) >> report ; \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
fclean:
|
fclean:
|
||||||
rm -f report $(ACT_REPORTS) $(ACT_OUTPUTS) $(EXES)
|
rm -f report $(ACT_REPORTS) $(ACT_OUTPUTS) $(EXES)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue