-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (42 loc) · 1.02 KB
/
Makefile
File metadata and controls
53 lines (42 loc) · 1.02 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
NAME = inf0
CC = gcc
CFLAGS = -g
SRC_FOLDER = 0x_srcs
SRCS = $(wildcard $(SRC_FOLDER)/*.c)
OBJS = $(SRCS:.c=.o)
# Colors
GREEN = \033[0;32m
BLUE = \033[0;34m
YELLOW = \033[1;33m
NC = \033[0m
all: show_art $(NAME) build_extract0r auto_clean
@echo "$(GREEN)✓ $(NAME) compiled successfully!$(NC)"
show_art:
@clear
@echo "$(GREEN)"
@cat art/low.tix 2>/dev/null || echo "ASCII art not found"
@echo "$(NC)"
@sleep 1
$(NAME): $(OBJS)
@echo "$(YELLOW)Linking $(NAME)...$(NC)"
@$(CC) $(CFLAGS) $(OBJS) -o $@
%.o: %.c
@echo "$(BLUE)Compiling $<$(NC)"
@$(CC) $(CFLAGS) -c $< -o $@
auto_clean:
@rm -f $(OBJS)
@echo "$(GREEN)Object files cleaned automatically$(NC)"
clean:
@rm -f $(OBJS)
@echo "$(GREEN)Object files cleaned$(NC)"
fclean: clean
@rm -f $(NAME)
@echo "$(GREEN)Executable removed$(NC)"
@$(MAKE) -C .extract0r fclean
re: fclean all
# Build extract0r
build_extract0r:
@echo "$(YELLOW)Building extract0r...$(NC)"
@sleep 1
@$(MAKE) -C .extract0r/
.PHONY: all clean fclean re show_art auto_clean build_extract0r