-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·56 lines (42 loc) · 1.61 KB
/
Makefile
File metadata and controls
executable file
·56 lines (42 loc) · 1.61 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: akaseris <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/11/08 16:05:02 by akaseris #+# #+# #
# Updated: 2018/02/28 13:38:21 by akaseris ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
FT = ft_printf ft_assign ft_alpha ft_handle ft_process ft_form ft_snb1 ft_snb2 \
ft_unb1 ft_unb2 ft_printbuf ft_sprint
LIB = libft/libft.a
SRC = src/
INC = includes/
LIBPATH = libft/
OBJ = objects/
FLAGS = -Wall -Werror -Wextra
FT_C = $(patsubst %,$(SRC)%.c,$(FT))
FT_O = $(patsubst %,%.o,$(FT))
FT_O_OBJ = $(patsubst %,$(OBJ)%.o,$(FT))
.PHONY: all clean fclean re
all: $(NAME)
$(LIB):
make -C $(LIBPATH) all
cp $(LIB) $(NAME)
$(FT_O_OBJ): $(LIB)
gcc -I $(INC) $(FLAGS) -c $(FT_C)
mkdir $(OBJ) 2> /dev/null || true
mv $(FT_O) $(OBJ)
$(NAME): $(FT_O_OBJ)
ar rc $(NAME) $(FT_O_OBJ)
ranlib $(NAME)
clean:
make -C $(LIBPATH) clean
/bin/rm -rf $(OBJ)
fclean: clean
/bin/rm -f $(LIB)
/bin/rm -f $(NAME)
re: fclean all