-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (75 loc) · 2.66 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
68
69
70
71
72
73
74
75
76
77
78
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: jaleman <jraleman@student.42.us.org> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/02/15 18:18:00 by jaleman #+# #+# #
# Updated: 2019/02/15 18:18:01 by jaleman ### ########.fr #
# #
# **************************************************************************** #
NAME = minishell
SRC = src/main.c \
src/builtins.c \
src/builtins/cmd_cd.c \
src/builtins/cmd_echo.c \
src/builtins/cmd_env.c \
src/builtins/cmd_exit.c \
src/builtins/cmd_help.c \
src/builtins/cmd_pwd.c \
src/builtins/cmd_setenv.c \
src/builtins/cmd_unsetenv.c \
src/builtins/cmd_squirtle.c \
src/execute.c \
src/minishell.c \
src/utils/ft_bzero.c \
src/utils/ft_error.c \
src/utils/ft_find_env.c \
src/utils/ft_memalloc.c \
src/utils/ft_memset.c \
src/utils/ft_putchar.c \
src/utils/ft_putendl.c \
src/utils/ft_putstr.c \
src/utils/ft_strcat.c \
src/utils/ft_strchr.c \
src/utils/ft_strclr.c \
src/utils/ft_strcmp.c \
src/utils/ft_strcpy.c \
src/utils/ft_strdup.c \
src/utils/ft_strjoin.c \
src/utils/ft_strlen.c \
src/utils/ft_strncat.c \
src/utils/ft_strncmp.c \
src/utils/ft_strncpy.c \
src/utils/ft_strnew.c \
src/utils/ft_strrchr.c \
src/utils/ft_strsub.c \
src/utils/ft_strtok.c \
src/utils/ft_tabfree.c \
src/utils/ft_tablen.c \
src/utils/get_next_line.c
INC = includes/
CC = gcc
CFLAGS = -Wall -Werror -Wextra -I $(INC)
OBJ = $(SRC:.c=.o)
DEBUG = -g3 -fsanitize=address
all: $(NAME)
%.o: %.c
@printf "[minishell] Compiling [.:]\r"
@$(CC) $(CFLAGS) -c $< -o $@
@printf "[minishell] Compiling [:.]\r"
$(NAME): $(OBJ)
@printf "[minishell] Compiled successfuly! [OK]\n"
@gcc $(CFLAGS) $(OBJ) -o $(NAME)
debug: $(OBJ)
@printf "[minishell] Compiled debug successfuly! [OK]\n"
@gcc $(CFLAGS) $(DEBUG) $(OBJ) -o $(NAME)
clean:
@/bin/rm -f $(OBJ)
@printf "[minishell] Removed object files!\n"
fclean: clean
@/bin/rm -f $(NAME)
@printf "[minishell] Removed minishell binary!\n"
re: fclean all
.PHONY: all clean fclean re