minishell/Makefile
Tanguy MAZE f04da8b91f WIP cd options
Nearly there ^^
added cd options

need to iron out bug with pwd that only shows physical path
2019-01-30 17:04:15 +01:00

50 lines
1.5 KiB
Makefile

#******************************************************************************#
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/11/22 14:43:33 by tmaze #+# #+# #
# Updated: 2019/01/30 15:50:42 by tmaze ### ########.fr #
# #
#******************************************************************************#
CC := gcc
CCFLAGS := -Wall -Werror -Wextra -g
CCSTD :=
NAME := minishell
SRCS := main.c exec.c cmd_echo.c cmd_cd.c cmd_env.c cmd_setenv.c cmd_unsetenv.c ms_env.c
OBJS_DIR := objs
OBJS := $(SRCS:.c=.o)
INCLS := -Iincludes -Ilibft
LIBS := -Llibft -lft
.PHONY = all clean fclean re
all: $(NAME)
$(NAME): $(OBJS) libft/libft.a
$(CC) $(CCFLAGS) $(CCSTD) $(INCLS) $(OBJS) -o $(NAME) $(LIBS)
%.o: srcs/%.c includes/minishell.h
$(CC) $(CCFLAGS) $(CCSTD) $(INCLS) -c $< -o $@
$(OBJS_DIR):
mkdir $(OBJS_DIR)
libft/libft.a:
$(MAKE) -Clibft all
clean:
rm -rf $(OBJS)
$(MAKE) -Clibft clean
fclean: clean
rm -f $(NAME)
$(MAKE) -Clibft fclean
re: fclean all