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.
 
 

38 lines
711 B

NAME = minishell
LIBFT = libft.a
SRCS = minishell.c lexer.c parser.c utils.c caller.c built-in.c env.c
OBJS = ${SRCS:.c=.o}
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
$(NAME): $(LIBFT) $(OBJS)
gcc ${OBJS} ${LIB} -o ${NAME}
$(LIBFT):
${MAKE} -C ./libft
cp ./libft/libft.a .
all: $(NAME)
%.o: %.c
gcc -Werror -Wextra -Wall -g -c $< ${READLINE_INC}
clean:
rm -rf ${OBJS}
fclean: clean
${MAKE} -C ./libft fclean
rm -rf libft.a
rm -rf ${NAME}
re: fclean all
.PHONY: all clean fclean re