-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (47 loc) · 1.93 KB
/
Copy pathMakefile
File metadata and controls
60 lines (47 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mbah <mbah@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/11/21 21:18:31 by mbah #+# #+# #
# Updated: 2024/11/24 13:54:57 by mbah ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
TESTER_DIR = tester
C_SRC = ft_print_char.c ft_print_string.c ft_print_decimal.c \
ft_print_hexadec.c ft_print_integer.c ft_print_percent.c \
ft_print_ptr.c ft_print_udecimal.c ft_printf.c \
ft_putunbr_fd.c ft_putunbr_base_fd.c
TEST_EXEC = ft_printf
C_OBJS = $(C_SRC:.c=.o)
CFLAGS = -Wall -Werror -Wextra -I ./
CC = cc
%.o: %.c ft_printf.h
$(CC) $(CFLAGS) -c $< -o $@
$(NAME): $(C_OBJS)
@echo "Execution du Makefile de la libft ..."
$(MAKE) -C ./libft
@echo "libft.a creer avec succees !"
cp libft/libft.a $(NAME)
ar rcs $(NAME) $(C_OBJS)
# exportation du tester
$(TESTER_DIR):
@echo "exportation du testeur ..."
@git clone git@github.com:mbah24-dev/tester.git
# Compilation de l'exécutable de test ft_printf
$(TEST_EXEC): $(NAME) $(TESTER_DIR)/ft_printf/main.c
$(CC) $(CFLAGS) -o $(TEST_EXEC) $(TESTER_DIR)/ft_printf/main.c $(NAME)
all: $(NAME)
clean:
$(MAKE) clean -C ./libft
rm -f $(C_OBJS)
fclean: clean
$(MAKE) fclean -C ./libft
rm -f $(NAME)
rm -rf $(TESTER_DIR)
rm -f $(TEST_EXEC)
re: fclean all
.PHONY: all clean fclean re