You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
885 B

NAME = minishell
LIBFT = libft.a
SRCS = minishell.c lexer.c lexer_2.c lexer_3.c parser.c caller.c
SRCS += built-in.c env.c utils.c errors.c
3 years ago
OBJS = ${SRCS:.c=.o}
3 years ago
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Linux)
LIB = -lreadline -lhistory -L. -lft
endif
ifeq ($(UNAME_S), Darwin)
READLINE_INC = -I ~/.brew/opt/readline/include
LIB = -L ~/.brew/lib -lreadline -L ~/.brew/lib -lhistory -L. -lft
endif
3 years ago
3 years ago
all: $(NAME)
$(VERBOSE).SILENT:
$(NAME): $(LIBFT) $(OBJS)
3 years ago
echo Making Minishell...
gcc -g ${OBJS} ${LIB} -o ${NAME}
echo
3 years ago
$(LIBFT):
3 years ago
${MAKE} -C ./libft
cp ./libft/libft.a .
3 years ago
%.o: %.c
3 years ago
gcc -Werror -Wextra -Wall -g -c $< ${READLINE_INC}
3 years ago
clean:
3 years ago
echo Cleaning objects...
rm -rf ${OBJS}
echo
fclean: clean
${MAKE} -C ./libft fclean
rm -rf libft.a
echo Cleaning binary...
rm -rf ${NAME}
echo
3 years ago
re: fclean all
.PHONY: all clean fclean re