This repository has been archived by the owner on Oct 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (48 loc) · 1.68 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: vbrazas <vbrazas@student.unit.ua> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/12/28 19:24:02 by vbrazas #+# #+# #
# Updated: 2018/07/22 23:31:53 by vbrazas ### ########.fr #
# #
# **************************************************************************** #
NAME = pipex
SRC_PATH = src/
LIB_PATH = ft_printf/
INC_PATH = includes/
OBJ_PATH = obj/
C = clang
WFLAGS = -Wall -Werror -Wextra
IFLAGS = -I $(INC_PATH) -I $(LIB_PATH)
LIB = $(LIB_PATH)libftprintf.a
FILES = main opendir
SRCS = $(addprefix $(SRC_PATH), $(addsuffix .c, $(FILES)))
OBJ = $(addprefix $(OBJ_PATH), $(SRCS:%.c=%.o))
all: $(NAME)
$(NAME): $(LIB) $(OBJ)
$(C) $(WFLAGS) $(IFLAGS) $(OBJ) $(LIB) -o $(NAME)
$(LIB):
make -C $(LIB_PATH)
$(OBJ): | $(OBJ_PATH)
$(OBJ_PATH):
mkdir -p $(OBJ_PATH)$(SRC_PATH)
$(OBJ_PATH)%.o: %.c
$(C) $(WFLAGS) $(IFLAGS) -c $< -o $@
clean:
make clean -C $(LIB_PATH)
rm -f $(OBJ)
fclean:
make fclean -C $(LIB_PATH)
rm -f $(NAME)
rm -rf $(OBJ_PATH)
re: fclean all
mclean:
rm -f $(OBJ)
mfclean:
rm -f $(NAME)
rm -rf $(OBJ_PATH)
mre: mfclean all
.PHONY: all clean fclean re