-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (40 loc) · 1.75 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: aachhoub <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/11/15 15:09:59 by aachhoub #+# #+# #
# Updated: 2022/11/15 16:18:48 by aachhoub ### ########.fr #
# #
# **************************************************************************** #
SRC = $(addprefix src/, pipex.c utils.c)
BSRC = $(addprefix src/, pipex_bonus.c utils.c utils_bonus.c)
LIBFT = ./libft/libft.a
NAME = pipex
CC = cc
CFLAGS = -Wall -Wextra -Werror
RM = rm -rf
MAKE = make
all: ${NAME}
${NAME}: ${LIBFT}
@${CC} ${CFLAGS} ${SRC} ${LIBFT} -o ${NAME}
@echo "\033[1;33mpipex: pipex program compiled successfully!\033[0m"
${LIBFT}:
@${MAKE} -C ./libft; ${MAKE} clean -C ./libft
bonus: fclean
@${MAKE} -C ./libft; ${MAKE} clean -C ./libft
@${CC} ${CFLAGS} ${BSRC} ${LIBFT} -o ${NAME}
@echo "\033[1;33mpipex: pipex bonus program compiled successfully!\033[0m"
clean:
@${RM} */*.o
@${RM} *.o
@${MAKE} clean -C libft
@echo "\033[1;31mpipex: Removed all .o files!\033[0m"
fclean: clean
@${RM} ${NAME}
@${MAKE} fclean -C libft
@echo "\033[1;31mpipex: Removed pipex program!\033[0m"
re: fclean all
@echo "\033[1;32mpipex: Re-creating pipex program!\033[0m"