-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
69 lines (49 loc) · 1.33 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
64
65
66
67
68
69
##
## Makefile for Makefile in /home/nicolas/bin/Makefile
##
## Made by Nicolas Polomack
## Login <[email protected]>
##
## Started on Tue Nov 15 09:05:43 2016 Nicolas Polomack
## Last update Mon Sep 10 19:38:34 2017 nicolaspolomack
##
SRC = main.cpp \
init.cpp \
display.cpp \
shaders.cpp
OBJ = $(SRC:.cpp=.o)
CPPFLAGS= -Iinclude -lsfml-graphics -lsfml-window -lsfml-system -lGLEW -lGL -lm -O2
REDDARK = \033[31;2m
RED = \033[31;1m
GREEN = \033[32;1m
YEL = \033[33;1m
BLUE = \033[34;1m
PINK = \033[35;1m
CYAN = \033[36;1m
RES = \033[0m
NAME = app
PROJ = SFML+OpenGL
UPPER = $(shell echo $(PROJ) | tr a-z A-Z)
all: $(NAME)
$(NAME):$(OBJ)
@echo
@echo -e "$(GREEN)Everything compiled smoothly. Now compiling dependancies...$(RES)"
@echo
@echo -en "$(CYAN)Linking $(PROJ)...$(RES)"
@g++ -o $(NAME) $(OBJ) $(CPPFLAGS)
@echo -e "\t$(GREEN)OK$(RES)$(CYAN)!$(RES)"
@echo
@echo -e "$(GREEN)---- $(UPPER) READY ----$(RES)"
@echo
clean:
@$(foreach var, $(OBJ), if [ -e $(var) ] ; then \
printf "[$(RED)RM$(RES)] $(YEL)$(var)$(RES)\n" \
&& $(RM) $(var) ; fi ;)
fclean: clean
@if [ -e $(NAME) ] ; then \
printf "[$(RED)RM EXEC$(RES)] $(YEL)$(NAME)$(RES)\n" \
&& rm -f $(NAME) ; fi
re: fclean all
%.o: %.cpp
@echo -e "[$(RED)COMPILE$(RES)] $(YEL)$<$(RES) $(BLUE)=>$(RES) $(YEL)$@$(RES)"
@g++ $(CPPFLAGS) -o $@ -c $<