-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (47 loc) · 1.8 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: jcheel-n <[email protected] +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/09/13 12:21:20 by jcheel-n #+# #+# #
# Updated: 2022/09/13 12:23:57 by jcheel-n ### ########.fr #
# #
# **************************************************************************** #
NAME = pipex
CFLAGS = -W -Wall -Wextra -Werror
XFLAGS = -fsanitize=address -g2
AR = ar -rcs
RM = rm -f
MD = mkdir -p
CP = cp -f
MDT_DIR = Mandatory/
SRC_DIR = src/
INC_DIR = inc/
OBJ_DIR = obj/
INCLUDE = -I $(INC_DIR)
PPX_SRC = pipex.c errors.c commands.c \
pipex_utils.c pipex_utils_2.c pipex_utils_3.c \
script_arg.c ft_split_script.c ft_split_quotes.c \
execution.c ignore_backslash.c
SRCS += $(addprefix $(MDT_DIR), $(addprefix $(SRC_DIR), $(PPX_SRC)))
OBJS = $(addprefix $(OBJ_DIR), $(SRCS:.c=.o))
DEPS = $(addsuffix .d, $(basename $(OBJS)))
$(OBJ_DIR)%.o: %.c Makefile
@$(MD) $(dir $@)
@echo " Compiling: $<"
@$(CC) -MT $@ -MMD -MP $(CFLAGS) $(INCLUDE) -c $< -o $@
all: ${NAME}
${NAME}: $(OBJS)
@$(CC) $(CFLAGS) $(XFLAGS) $(OBJS) -o $(NAME)
@echo "Pipex compiled."
clean:
@$(RM) -r $(OBJ_DIR)
fclean: clean
@${RM} ${NAME}
re: fclean all
norm:
norminette $(SRCS)
-include $(DEPS)
.PHONY: norm clean fclean re all