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