refactor: fix the makefile problems

This commit is contained in:
airone01
2026-01-24 18:46:05 +01:00
parent 22de4eb11a
commit 856739af67
9 changed files with 119 additions and 31 deletions

36
real_tests/Makefile Normal file
View File

@@ -0,0 +1,36 @@
NAME = real_tests
CC = cc
CCFLAGS = -Wall -Wextra -Werror -MMD -MP
SRC = main.c
SRC += ft_strlen/00_launcher.c ft_strlen/01_basic.c ft_strlen/02_null.c ft_strlen/03_large.c
OBJ = $(SRC:.c=.o)
LIBS = -L.. -lunit -L../libft -lft
INC = -I. -I../framework -I../libft
all: $(NAME)
test: $(NAME)
./$(NAME)
%.o: %.c Makefile
$(CC) $(CCFLAGS) $(INC) -c $< -o $@
$(NAME): $(OBJ) | libunit
$(CC) $(CCFLAGS) $(INC) $(OBJ) $(LIBS) -o $(NAME)
libunit:
$(MAKE) -C ..
clean:
$(RM) $(OBJ) $(SRC:.c=.d)
fclean: clean
$(RM) $(NAME)
re: fclean all
-include $(SRC:.c=.d)
.PHONY: all clean fclean re libunit

5
real_tests/main.c Normal file
View File

@@ -0,0 +1,5 @@
#include "tests.h"
int main(void) {
strlen_launcher();
}

View File

@@ -6,7 +6,7 @@
/* By: elagouch <elagouch@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/01/24 15:32:30 by elagouch #+# #+# */
/* Updated: 2026/01/24 16:33:14 by elagouch ### ########.fr */
/* Updated: 2026/01/24 18:40:48 by elagouch ### ########.fr */
/* */
/* ************************************************************************** */
@@ -15,6 +15,9 @@
# include "libunit.h"
// LAUNCHERS
int strlen_launcher(void);
// strlen
int test_basic(void);
int test_null(void);