refactor: fix the makefile problems
This commit is contained in:
36
real_tests/Makefile
Normal file
36
real_tests/Makefile
Normal 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
5
real_tests/main.c
Normal file
@@ -0,0 +1,5 @@
|
||||
#include "tests.h"
|
||||
|
||||
int main(void) {
|
||||
strlen_launcher();
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user