-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (43 loc) · 1.64 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: lfourque <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/11/04 08:44:51 by lfourque #+# #+# #
# Updated: 2016/11/16 17:31:47 by lfourque ### ########.fr #
# #
# **************************************************************************** #
SRC_DIR = src/
INC_DIR = inc/
OBJ_DIR = obj/
NAME = particle_system
SRC_FILES = main.cpp\
SDL.cpp\
Shader.cpp\
Camera.cpp\
OpenGL.cpp\
OpenCL.cpp\
ParticleSystem.cpp
SRC = $(addprefix $(SRC_DIR), $(SRC_FILES))
OBJ = $(subst $(SRC_DIR), $(OBJ_DIR), $(SRC:.cpp=.o))
CC = clang++
CFLAGS = -Wall -Wextra -Werror
SDL_LIB = `sdl2-config --libs`
SDL_INC = `sdl2-config --cflags`
GLM_INC = inc/glm
FWK = -framework OpenGL -framework OpenCL
all: $(NAME)
@echo "\033[32m•\033[0m $(NAME) ready"
$(NAME): $(OBJ)
$(CC) -o $(NAME) $(SDL_LIB) $(FWK) $^
$(OBJ_DIR)%.o: $(SRC_DIR)%.cpp
@mkdir -p $(@D)
$(CC) $(CFLAGS) -I $(INC_DIR) -I $(GLM_INC) $(SDL_INC) -o $@ -c $<
clean:
rm -rf $(OBJ_DIR)
fclean: clean
rm -rf $(NAME)
re: fclean all
.PHONY: all re fclean clean