summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile26
1 files changed, 14 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 9839e5d..3ac6d22 100644
--- a/Makefile
+++ b/Makefile
@@ -13,34 +13,37 @@
SRCS_DIR = src/
SRCS = \
- ${SRCS_DIR}main.c
+ ${SRCS_DIR}main.c \
+ ${SRCS_DIR}ft_process_arg.c \
+ ${SRCS_DIR}ft_echo.c \
+ ${SRCS_DIR}ft_pwd.c
OBJS_DIR = obj/
OBJS = $(patsubst ${SRCS_DIR}%.c,${OBJS_DIR}%.o,${SRCS})
-INCS_DIR = -Linc/ \
- -Llibft/
-INCS = -iminishell.h \
- -ilibft.h
+INCS_DIR = -Iinc/ -Ilibft/
-LIB_DIR = libft/
-LIB = ft
+LIB_DIR = -Llibft/
+LIB = -lft
CC = gcc
CFLAGS = -Wall -Wextra -Werror
+DEBUG = -g3
+FSANITIZE = -fsanitize=address
+
NAME = minishell
RM = rm -rf
MKDIR = mkdir -p
-${OBJS_DIR}%.o: ${SRCS_DIR}%.c
+${OBJS_DIR}%.o: ${SRCS_DIR}%.c inc/minishell.h libft/libft.h
${MKDIR} ${OBJS_DIR}
- ${CC} ${CFLAGS} ${INCS_DIR} ${INCS} -o $@ -c $<
+ ${CC} ${CFLAGS} ${DEBUG} ${INCS_DIR} -o $@ -c $<
$(NAME): ${OBJS}
- ${CC} ${CFLAGS} -L${LIB_DIR} -l${LIB} -o ${NAME} ${OBJS}
+ ${CC} ${CFLAGS} ${DEBUG} ${LIB_DIR} ${LIB} -o ${NAME} ${OBJS}
all: ${NAME}
@@ -54,8 +57,7 @@ fclean: clean
re: fclean all
build: ${OBJS}
- ${CC} ${CFLAGS} -g3 -fsanitize=address -I./ -o a.out \
- ${OBJS}
+ ${CC} ${CFLAGS} ${DEBUG} ${FSANITIZE} ${LIB_DIR} ${LIB} -o a.out ${OBJS}
default: all