-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (35 loc) · 1.49 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: hgabriel <hgabriel@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/05/08 18:41:06 by hgabriel #+# #+# #
# Updated: 2022/06/15 05:11:21 by hgabriel ### ########.fr #
# #
# **************************************************************************** #
NAME = ${LIB}
SRCS = handle_c.c handle_id.c handle_ptr.c handle_str.c handle_u.c handle_xX.c \
ft_printf_parser.c ft_printf_utils.c ft_printf.c \
SRCSDIR = srcs/
OBJSDIR = obj/
OBJS = $(addprefix $(OBJSDIR), ${SRCS:.c=.o})
LIB = libftprintf.a
LIBFT = libft/
INCLUDES = includes
CC = gcc
CFLAGS = -Wall -Wextra -Werror
all: ${NAME}
${NAME}: ${OBJS}
make re -C ${LIBFT}
ar rcs ${LIB} ${OBJS} ${LIBFT}*.o
$(OBJSDIR)%.o: $(SRCSDIR)%.c
@mkdir -p $(OBJSDIR)
${CC} ${CFLAGS} -I ${INCLUDES} -c $< -o $@
clean:
rm -rf ${OBJSDIR}
fclean: clean
rm -f ${LIB}
re: fclean all
.PHONY: all clean fclean re bonus