-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (32 loc) · 832 Bytes
/
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
##
## EPITECH PROJECT, 2018
## Makefile
## File description:
## my make file
##
NAME = my_gc
SRCS = ./src/garbage_collector.c \
./src/main.c \
OBJS = $(SRCS:.c=.o)
NBR_OF_FILES := $(words $(SRCS))
CC = gcc
RM = rm -f
CFLAGS = -I ./include/
CFLAGS += -W -Wall -Wextra -Werror
all: $(NAME)
$(NAME): $(OBJS)
@ echo "\033[1;36m[ FILES COMPILED ] \033[0m \033[1;34m$(NBR_OF_FILES)\033[0m"
@ $(CC) -o $(NAME) $(OBJS)
@ echo "\033[1;34mBinary : \033[1;32m$(NAME)\033[1;34m created sucesfully.\033[0m"
clean:
@ echo "\033[3;31mRemoving: \033[0m"
@ echo "\033[3;31m$(OBJS)\033[0m" | tr ' ' '\n'
@ $(RM) $(OBJS)
fclean: clean
@ echo "\033[3;31m./$(NAME)\033[0m"
@ $(RM) $(NAME)
re: fclean all
%.o: %.c
@ echo "\033[1;34m[ OK ]\033[0m Compiling" $<
@ $(CC) -o $@ -c $< $(CFLAGS)
.PHONY: all clean fclean re