-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
39 lines (30 loc) · 873 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
NAME = sample.out
SRC = main.c window.c image.c color.c hooks.c
OBJ = $(SRC:.c=.o)
FLAGS = -Wall -Wextra -Werror
LINKS = -lmlx -framework OpenGL -framework AppKit
NONE='\033[0m'
GREEN='\033[32m'
GRAY='\033[2;37m'
CURSIVE='\033[3m'
all: $(NAME)
$(NAME): $(OBJ)
@echo $(CURSIVE)$(GRAY) " - Compiling $(NAME)..." $(NONE)
@gcc $(FLAGS) $(OBJ) $(LINKS) -o $(NAME)
@echo $(GREEN)"- Compiled -"$(NONE)
@rm $(OBJ)
@echo $(CURSIVE)$(GRAY) " Deleted object files" $(NONE)
$(OBJ): $(SRC)
@echo $(CURSIVE)$(GRAY) " - Making object files..." $(NONE)
@gcc $(FLAGS) -c $(SRC)
exe: all
@echo " - Executing $(NAME)... \n"
@./$(NAME)
@echo "\n - Done -"
clean:
@echo $(CURSIVE)$(GRAY) " - Removing object files..." $(NONE)
@rm -rf $(OBJ)
fclean: clean
@echo $(CURSIVE)$(GRAY) " - Removing $(NAME)..." $(NONE)
@rm -rf $(NAME)
re: fclean all