summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 3b2fd89b13b97e8f01deae151879b5d4a7bcfaf3 (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
# **************************************************************************** #
#                                                           LE - /             #
#                                                               /              #
#    Makefile                                         .::    .:/ .      .::    #
#                                                  +:+:+   +:    +:  +:+:+     #
#    By: rbousset <marvin@le-101.fr>                +:+   +:    +:    +:+      #
#                                                  #+#   #+    #+    #+#       #
#    Created: 2019/10/08 15:04:55 by rbousset     #+#   ##    ##    #+#        #
#    Updated: 2019/10/13 14:01:21 by rbousset    ###    #+. /#+    ###.fr      #
#                                                          /                   #
#                                                         /                    #
# **************************************************************************** #

SRCS_DIR		= src/
SRCS			= \
				${SRCS_DIR}main.c

OBJS_DIR		= obj/
OBJS			= $(patsubst ${SRCS_DIR}%.c,${OBJS_DIR}%.o,${SRCS})

INCS_DIR		= inc/

CC				= gcc
CFLAGS			= -Wall -Wextra -Werror

NAME			= minishell

RM				= rm -f
MKDIR			= mkdir -p


${OBJS_DIR}%.o:		${SRCS_DIR}%.c
	${MKDIR} ${OBJS_DIR}
	${CC} ${CFLAGS} -I${INCS_DIR} -o $@ -c $< 

$(NAME):		${OBJS}
	${CC} ${CFLAGS} -I${INCS_DIR} -o ${NAME} ${OBJS}

all:			${NAME}

clean: 
	${RM} ${OBJS} ${B_OBJS}

fclean:			clean
	${RM} ${NAME}

re:				fclean all

build:			${OBJS}
	${CC} ${CFLAGS} -g3 -fsanitize=address -I./ -o a.out \
		${OBJS}

default: all

.PHONY:	all clean clean fclean re bonus run