-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
42 lines (30 loc) · 1 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
NAME = minishell
SRC = ./src/main.c \
./src/parsing/*.c \
./src/env_init/*.c \
./src/cmdgroup_init/*.c \
./src/execution/*.c \
./src/builtins/*.c \
./src/ft_free/*.c \
./src/signals/*.c
CC = gcc
CFLAGS = -g -Werror -Wextra -Wall
RDLIB = -I/opt/homebrew/Cellar/readline/8.2.1/include -L/opt/homebrew/Cellar/readline/8.2.1/lib -lreadline
# RDLIB = -lreadline
# RDLIB = -I $(HOME)/goinfre/.brew/opt/readline/include/ -L $(HOME)/goinfre/.brew/opt/readline/lib/ -lreadline
LIB_DIR = ./library/libft/
LIBFT = ./library/libft/libft.a
all: $(NAME)
GREEN = $(shell tput setaf 2) # Sets the color to green
RESET = $(shell tput sgr0) # Resets to the default color
$(NAME): $(SRC) $(LIBFT)
@$(CC) $(SRC) $(CFLAGS) $(RDLIB) $(LIBFT) -o $(NAME)
@echo "$(GREEN)minishell compiled successfully, now run ./minishell$(RESET)"
$(LIBFT):
@make -C $(LIB_DIR)
clean:
@make clean -C $(LIB_DIR)
fclean: clean
@make fclean -C $(LIB_DIR)
@rm -rf $(NAME)
re: fclean all