-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (54 loc) · 2.08 KB
/
Copy pathMakefile
File metadata and controls
67 lines (54 loc) · 2.08 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
61
62
63
64
65
66
67
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: asuc <asuc@student.42angouleme.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/08/12 17:42:16 by asuc #+# #+# #
# Updated: 2023/08/12 17:42:16 by asuc ### ########.fr #
# #
# **************************************************************************** #
BGreen = $(shell echo "\033[1;32m")
RESET = $(shell echo "\033[0m")
BRed = $(shell echo "\033[1;31m")
NAME = libftprintf.a
COMP = gcc
CFLAGS = -Wall -Werror -Wextra
HEAD = includes/
libft = libft/
SRC = ft_printf.c\
ft_printf_utils.c\
ft_printf_fomat_utils.c\
OBJ = $(SRC:.c=.o)
all : $(NAME)
%.o : %.c
@$(COMP) -gdwarf-4 -fPIE $(CFLAGS) -o $@ -c $< -I $(HEAD)
$(NAME) : $(OBJ)
@make --no-print-directory -C $(libft)
@cp libft/libft.a $(NAME)
@ar -rcs $(NAME) $(OBJ)
@echo "$(BGreen)Compilation OK$(RESET)"
clean :
@make clean --no-print-directory -C $(libft)
@rm -f $(OBJ)
@echo "$(BRed)Erase .o files$(RESET)"
fclean : clean
@make fclean --no-print-directory -C $(libft)
@rm -f $(NAME) libft.a
@echo "$(BRed)Erase $(NAME) and libft.a$(RESET)"
test2 : re
@cp -rf ../ft_printf_tester ./ft_printf_tester
@make -C ./ft_printf_tester
@cd ./ft_printf_tester && ./tester m
@rm -rf ./ft_printf_tester
@cp -rf ../Tester ./Tester
@make -C ./Tester
@rm -rf ./Tester
@cp -rf ../pftTest ./pftTest
@make -C ./pftTest
@cd ./pftTest && ./test
@cp ./pftTest/results.txt ./results.txt
@rm -rf ./pftTest
re : fclean all
.PHONY: all fclean clean re