-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (37 loc) · 1.43 KB
/
Makefile
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: tkomeno <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/04/30 02:45:29 by tkomeno #+# #+# #
# Updated: 2022/09/17 16:33:56 by tkomeno ### ########.fr #
# #
# **************************************************************************** #
NAME = get_next_line
CFLAGS = -Wall -Wextra -Werror -I includes
FILES = main.c \
get_next_line.c \
get_next_line_utils.c
BFILES = main.c \
get_next_line_bonus.c \
get_next_line_utils_bonus.c
SRCS = $(addprefix sources/,$(FILES))
BSRCS = $(addprefix sources/bonus/,$(BFILES))
OBJS = $(SRCS:.c=.o)
BOBJS = $(BSRCS:.c=.o)
ifdef WITH_BONUS
OBJS = $(BOBJS)
endif
all: $(NAME)
$(NAME): $(OBJS)
$(CC) $(OBJS) -o $(NAME)
bonus:
@make WITH_BONUS=TRUE
clean:
$(RM) $(OBJS) $(BOBJS)
fclean: clean
$(RM) $(NAME)
re: fclean all
.PHONY: all bonus clean fclean re