-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (40 loc) · 2.06 KB
/
Makefile
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: guilmira <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/06/12 08:51:50 by guilmira #+# #+# #
# Updated: 2021/09/23 08:41:13 by guilmira ### ########.fr #
# #
# **************************************************************************** #
#--------------------------------------------------------------------------------------------------------------COMPILER
NAME = libftprintf.a
CC = gcc
CFLAGS = -Wall -Wextra -Werror
#-g3 -fsanitize=address
#--------------------------------------------------------------------------------------------------------------LIBS
LIB = ./libft_submodule/libft.a
INCLUDES = -I ./0includes -I ./libft_submodule/0includes
#--------------------------------------------------------------------------------------------------------------SOURCES
SRCS = ft_printf.c ft_printf_tools_flag.c ft_printf_format.c ft_lib_fd.c \
ft_print_1strings.c ft_print_2pointers.c ft_print_3integers.c \
ft_print_4integers_unsigned.c ft_print_5hexa.c
OBJS = $(SRCS:.c=.o)
#--------------------------------------------------------------------------------------------------------------RULES
all: lib_submodule $(NAME)
lib_submodule:
@make -C ./libft_submodule
%.o: %.c
-@$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
$(NAME): $(OBJS) $(LIB)
ar rcs $(NAME) $(OBJS) $(LIB)
clean:
@rm -rf $(OBJS)
make clean -C ./libft_submodule
fclean: clean
@rm -rf $(NAME)
make fclean -C ./libft_submodule
re: fclean all
.PHONY: all clean fclean re