-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (37 loc) · 1.51 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: shinckel <shinckel@student.42lisboaom +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/10/31 16:56:57 by shinckel #+# #+# #
# Updated: 2022/10/31 16:59:50 by shinckel ### ########.fr #
# #
# **************************************************************************** #
NAME = libft.a
SRC = $(wildcard src/*.c)
OBJ = $(SRC:.c=.o)
BONUS = $(wildcard bonus/*.c)
BONUS_OBJ = $(BONUS:.c=.o)
CC = gcc
RM = rm -f
CFLAGS = -Wall -Werror -Wextra -Iheader -g
#CFLAGS += -fsanitize=address
# Define colors
RED := \033[1;30;41m
GREEN := \033[1;30;42m
RESET := \033[0m
all: $(NAME)
$(NAME): $(OBJ)
@ar rc $(NAME) $(OBJ)
@echo "$(GREEN) Libft compiled $(RESET)"
bonus: $(OBJ) $(BONUS_OBJ)
@ar rc $(NAME) $(OBJ) $(BONUS_OBJ)
@echo "$(GREEN) Libft & bonus compiled $(RESET)"
clean:
fclean: clean
@$(RM) $(OBJ) $(BONUS_OBJ) $(NAME)
@echo "$(RED) Remove objects & $(NAME) $(RESET)"
re: fclean all
.PHONY: all bonus clean fclean re