-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
70 lines (57 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
### OUTPUT ###
BUILD = Build
### SOURCES ###
SRC = Src/main\
Src/Game/Game\
Src/Shader/Shader\
Src/Texture/Texture\
Src/ResourceManager/ResourceManager\
Src/SpriteRenderer/SpriteRenderer\
Src/StbImage/stb_image\
Src/GameObject/GameObject\
Src/GameLevel/GameLevel\
Src/BallObject/BallObject\
Src/Json/Json\
Src/ParticleGenerator/ParticleGenerator
### OBJECTS ###
OBJ = $(addsuffix .o, $(addprefix $(BUILD)/, $(SRC)))
### INCLUDES ###
INC = -ID:/MartinFW/Development/OpenGL/Glfw/include/GLFW\
-ID:/MartinFW/Development/OpenGL/Glew/glew-2.1.0/include/GL\
-ID:/MartinFW/Development/OpenGL/Glm/glm-0.9.9.8/glm\
-ID:/MartinFW/Development/irrKlang-32bit-1.6.0/irrKlang-1.6.0/include\
-ISrc/Game\
-ISrc/Shader\
-ISrc/Texture\
-ISrc/ResourceManager\
-ISrc/SpriteRenderer\
-ISrc/StbImage\
-ISrc/GameObject\
-ISrc/GameLevel\
-ISrc/BallObject\
-ISrc/Errors\
-ISrc/Json\
-ISrc/ParticleGenerator
### LINKER FLAGS ###
LDFLAGS = -LD:/MartinFW/Development/OpenGL/Glew/glew-2.1.0/lib/Release/Win32\
-LD:/MartinFW/Development/OpenGL/Glfw/lib-mingw\
-LD:/MartinFW/Development/irrKlang-32bit-1.6.0/irrKlang-1.6.0/lib/Win32-gcc
LDLIBS = -lglew32s -lglfw3 -lopengl32 -lgdi32 -lirrKlang
### COMPILER FLAGS
CFLAGS = $(INC)
### COMPILER ###
CC = g++
all: $(BUILD)/test.exe
$(BUILD)/test.exe: $(OBJ)
@echo LINKING $^
@$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
$(BUILD)/%.o: %.cpp
@echo COMPILING $<
@mkdir -p $(subst /,\,$(dir $@))
@$(CC) $(CFLAGS) -M -MT $@ -o $(patsubst %.o, %.d, $@) $<
@$(CC) $(CFLAGS) -o $@ -c $<
-include $(OBJ:.o=.d)
.PHONY: clean
clean:
@echo CLEANING......
@rm -rf $(BUILD)/*