-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (35 loc) · 815 Bytes
/
Makefile
File metadata and controls
47 lines (35 loc) · 815 Bytes
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
NAME = minishell
SRC_DIR = src/
OBJ_DIR = obj/
LIBFT_DIR = libft/
CFLAG = -Wall -Wextra -Werror
INC = -Iincludes
ALL_SRC = minishell.c \
mini_command.c \
mini_help.c \
mini_help2.c \
mini_jump.c \
mini_free.c \
mini_envmod.c \
mini_pathmod.c \
mini_cd.c \
mini_echo.c \
mini_ctrl.c \
mini_error.c \
SRC = $(addprefix $(SRC_DIR), $(ALL_SRC))
OBJ = $(addprefix $(OBJ_DIR), $(ALL_SRC:.c=.o))
all: $(NAME)
$(NAME): $(OBJ)
make -C $(LIBFT_DIR)
gcc $(CFLAG) $(OBJ) $(INC) -L $(LIBFT_DIR) -lft -o $(NAME)
$(OBJ_DIR)%.o: $(SRC_DIR)%.c
mkdir -p obj
gcc -c $(CFLAG) $(INC) $< -o $@
clean:
make -C $(LIBFT_DIR)/ clean
/bin/rm -rf $(OBJ_DIR)
fclean: clean
make -C $(LIBFT_DIR)/ fclean
/bin/rm -rf $(NAME)
re: fclean all
.PHONY: all, clean, fclean, re