-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (47 loc) · 1.78 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
53
54
55
56
57
58
59
60
61
62
63
# **************************************************************************** #
# #
# :::::::: #
# Makefile :+: :+: #
# +:+ #
# By: lde-la-h <[email protected]> +#+ #
# +#+ #
# Created: 2021/11/30 13:24:16 by lde-la-h #+# #+# #
# Updated: 2021/12/17 12:40:44 by lde-la-h ######## odam.nl #
# #
# **************************************************************************** #
# //= Variables =// #
NAME = philo
CFLAGS = -Wextra -Werror -Wall -Wunreachable-code -g # -fsanitize=thread
# //= Colors =// #
BOLD = \e[1m
GREEN = \x1b[32m
RESET = \033[0m
RED = \x1b[31m
# Define the header location
HEADERS = -I ./include
# //= Files =// #
# TODO: Add files, remove shell command.
SRCS = $(shell find ./src -iname "*.c")
OBJS = ${SRCS:.c=.o}
# //= Rules =// #
## //= Compile =// #
all: $(NAME)
%.o: %.c
@printf "$(GREEN)$(BOLD)\rCompiling: $(notdir $<) 🔨 $(RESET)"
@$(CC) $(CFLAGS) -o $@ -c $< $(HEADERS)
$(NAME): $(OBJS)
@$(CC) $(OBJS) $(HEADERS) $(ARCHIVES) -o $(NAME)
@echo "$(GREEN)Done ✅$(RESET)"
## //= Commands =// #
# Clean
clean:
@echo "$(RED)Cleaning 🧹$(RESET)"
@rm -f $(OBJS)
# Full clean
fclean: clean
@rm -f $(NAME)
# Re-compile
re: fclean all
## //= Misc =// #
# Phonies as not to confuse make, these are actual commands, not files.
.PHONY: all, clean, fclean, re