-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (55 loc) · 2.1 KB
/
Makefile
File metadata and controls
74 lines (55 loc) · 2.1 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
################################################################################
# CONFIG #
################################################################################
NAME := push_swap
CC := gcc
FLAGS := -Wall -Wextra -Werror
################################################################################
# PROGRAM'S SRCS #
################################################################################
SRCS := arrays.c \
list_utils_2.c \
list_utils.c \
solvers_2.c \
counters.c \
init.c \
moves.c \
push_swap.c \
lis_utils.c \
various_utils.c \
solvers.c \
free_and_errors.c \
OBJS := $(SRCS:.c=.o)
.c.o:
${CC} ${FLAGS} -c $< -o ${<:.c=.o}
################################################################################
# Makefile objs #
################################################################################
CLR_RMV := \033[0m
RED := \033[1;31m
GREEN := \033[1;32m
YELLOW := \033[1;33m
BLUE := \033[1;34m
CYAN := \033[1;36m
RM := rm -f
${NAME}: ${OBJS}
@echo "$(GREEN)Compilation ${CLR_RMV}of ${YELLOW}$(NAME) ${CLR_RMV}..."
${CC} ${FLAGS} -o ${NAME} ${OBJS}
@echo "$(GREEN)$(NAME) created[0m ✔️"
all: ${NAME}
bonus: all
cd bonus && $(MAKE)
clean:
@ ${RM} *.o */*.o */*/*.o
@ echo "$(RED)Deleting $(CYAN)$(NAME) $(CLR_RMV)objs ✔️"
bonusclean: clean
cd bonus && $(MAKE) clean
fclean: clean
@ ${RM} ${NAME}
@ echo "$(RED)Deleting $(CYAN)$(NAME) $(CLR_RMV)binary ✔️"
bonusfclean: fclean
cd bonus && $(MAKE) fclean
re: fclean all
bonusre: re
cd bonus && $(MAKE) re
.PHONY: all clean fclean re bonus bonusclean bonusfclean bonusre