-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.common
125 lines (103 loc) · 4.72 KB
/
Makefile.common
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# -*- mode: makefile -*-
##=====================================================================
## OpenGLCppWrapper: A C++11 OpenGL 'Core' wrapper.
## Copyright 2019 Quentin Quadrat <[email protected]>
##
## This file is part of OpenGLCppWrapper.
##
## OpenGLCppWrapper is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with OpenGLCppWrapper. If not, see <http://www.gnu.org/licenses/>.
##=====================================================================
PROJECT = OpenGLCppWrapper
STANDARD = --std=c++14
include $(M)/Makefile.header
###################################################
# OpenGL: glfw and glew libraries
ifeq ($(ARCHI),Darwin)
INCLUDES += -I/usr/local/include -I/opt/local/include
LINKER_FLAGS += -framework OpenGL -framework Cocoa
LINKER_FLAGS += -framework IOKit -framework CoreVideo
LINKER_FLAGS += -L/usr/local/lib -L/opt/local/lib
LINKER_FLAGS += -lGLEW -lglfw
else ifeq ($(ARCHI),Linux)
PKG_LIBS += glew --static glfw3
else
$(error Unknown architecture)
endif
###################################################
# SOIL (image loader for OpenGL texturing)
THIRDPART_LIBS += $(abspath $(THIRDPART)/SOIL/build/libSOIL.a)
INCLUDES += -I$(THIRDPART)/SOIL/include
VPATH += $(THIRDPART)/SOIL/src
###################################################
# Dear IM Gui (immediate mode rendering GUI)
THIRDPART_OBJS += imgui.o imgui_draw.o imgui_tables.o imgui_widgets.o
THIRDPART_OBJS += imgui_impl_glfw.o imgui_impl_opengl3.o
INCLUDES += -I$(THIRDPART)/imgui
VPATH += $(THIRDPART)/imgui $(THIRDPART)/imgui/backends
# FIXME: temporary
DEFINES += -Wno-old-style-cast -Wno-conversion -Wno-float-equal -Wno-sign-conversion -Wno-cast-qual
###################################################
# Bullet3 (3d physics)
THIRDPART_LIBS += $(abspath $(THIRDPART)/bullet3/usr/local/lib/libBulletSoftBody.a)
THIRDPART_LIBS += $(abspath $(THIRDPART)/bullet3/usr/local/lib/libBulletDynamics.a)
THIRDPART_LIBS += $(abspath $(THIRDPART)/bullet3/usr/local/lib/libBulletCollision.a)
THIRDPART_LIBS += $(abspath $(THIRDPART)/bullet3/usr/local/lib/libLinearMath.a)
INCLUDES += -I$(THIRDPART)/bullet3/usr/local/include
INCLUDES += -I$(THIRDPART)/bullet3/usr/local/include/bullet
###################################################
# Units library
INCLUDES += -I$(THIRDPART)/units/include
###################################################
# JSON parser
INCLUDES += -I$(THIRDPART)/json/include
###################################################
# OpenGLCppWrapper defines.
#
# CHECK_OPENGL allows to check if bad parameters are
# passed to OpenGL routines. Produce an error message
# in the console but does not abort the program.
# ENABLE_DEBUG activate logs on the console.
DEFINES += -DCHECK_OPENGL -UENABLE_DEBUG
###################################################
# Inform Makefile where to find header files for third parts
#
INCLUDES += -I$(P)/include -I$(P)/src -I$(P)/src/Loaders/3D
INCLUDES += -I$(THIRDPART)
###################################################
# Inform Makefile where to find *.cpp and *.o files
#
VPATH += $(P)/src $(P)/src/Common $(P)/src/Math
VPATH += $(P)/src/OpenGL $(P)/src/OpenGL/Buffers
VPATH += $(P)/src/OpenGL/Context $(P)/src/OpenGL/Shaders
VPATH += $(P)/src/OpenGL/Textures $(P)/src/OpenGL/Variables
VPATH += $(P)/src/UI $(P)/src/Loaders/Textures $(P)/src/Loaders/3D
VPATH += $(P)/src/Components $(P)/src/Components/Physics
VPATH += $(P)/src/Scene/Material $(P)/src/Scene/Geometry $(P)/src/Scene
VPATH += $(P)/src/Scene/Camera
VPATH += $(THIRDPART)
###################################################
# Compiled objects files
#
OBJ_COMMON = Exception.o File.o Path.o
OBJ_OPENGL = OpenGL.o Variables.o EBO.o VBO.o VAO.o Texture2D.o Texture3D.o Textures.o Shader.o Program.o
OBJ_GUI = Window.o Layer.o DearImGui.o
OBJ_SCENE_GRAPH = SceneTree.o AnimatedModelNode.o
OBJ_CAMERA = Perspective.o Orthographic.o CameraNode.o CameraRigNode.o
OBJ_LOADERS = OBJ.o SOIL.o
OBJ_MATERIALS = Material.o DepthMaterial.o NormalsMaterial.o MeshBasicMaterial.o LineBasicMaterial.o Color.o
OBJ_GEOMETRIES = Axes.o Model.o Plane.o Tube.o Sphere.o Box.o
OBJ_PHYSICS = Components.o BulletWrapper.o
# Needed by MyMakefile
LIB_OBJS += $(OBJ_COMMON) $(OBJ_OPENGL) $(OBJ_GUI) $(OBJ_LOADERS) $(OBJ_MATERIALS)
LIB_OBJS += $(OBJ_GEOMETRIES) $(OBJ_PHYSICS) $(OBJ_CAMERA) $(OBJ_SCENE_GRAPH)