forked from angeluriot/Galaxy_simulation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
115 lines (102 loc) · 3.84 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
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
###################################################
# Project definition
#
PROJECT = Janus
TARGET = $(PROJECT)
DESCRIPTION = Galaxy simulation
STANDARD = --std=c++14
BUILD_TYPE = release
###################################################
# Location of the project directory and Makefiles
#
P := .
M := $(P)/.makefile
include $(M)/Makefile.header
###################################################
# Inform Makefile where to find *.cpp files
#
VPATH += $(P)/src
###################################################
# Inform Makefile where to find header files
#
INCLUDES += -I$(P)/include -I$(P)/src -I$(P)/external
###################################################
# Project defines
#
DEFINES += -DDATADIR=\"$(DATADIR):$(abspath $(P))/data/:data/\"
###################################################
# Reduce warnings
#
CCFLAGS += -Wno-sign-conversion -Wno-float-equal
CXXFLAGS += -Wno-undef -Wno-switch-enum -Wno-enum-compare
###################################################
# Set thirdpart glm
#
DEFINES += -DGLM_ENABLE_EXPERIMENTAL
###################################################
# Set thirdpart Dimension3D
#
INCLUDES += -I$(THIRDPART)/Dimension3D/includes
INCLUDES += -I$(THIRDPART)/Dimension3D/includes/dim/cameras
INCLUDES += -I$(THIRDPART)/Dimension3D/includes/dim/controllers
INCLUDES += -I$(THIRDPART)/Dimension3D/includes/dim/lights
INCLUDES += -I$(THIRDPART)/Dimension3D/includes/dim/objects
INCLUDES += -I$(THIRDPART)/Dimension3D/includes/dim/opengl
INCLUDES += -I$(THIRDPART)/Dimension3D/includes/dim/utils
INCLUDES += -I$(THIRDPART)/Dimension3D/includes/dim/vectors
INCLUDES += -I$(THIRDPART)/Dimension3D/includes/dim/windows
VPATH += $(THIRDPART)/Dimension3D/sources/cameras
VPATH += $(THIRDPART)/Dimension3D/sources/controllers
VPATH += $(THIRDPART)/Dimension3D/sources/lights
VPATH += $(THIRDPART)/Dimension3D/sources/objects
VPATH += $(THIRDPART)/Dimension3D/sources/opengl
VPATH += $(THIRDPART)/Dimension3D/sources/utils
VPATH += $(THIRDPART)/Dimension3D/sources/vectors
VPATH += $(THIRDPART)/Dimension3D/sources/windows
VPATH += $(THIRDPART)/Dimension3D/sources/
OBJS += Camera2D.o AmbientLight.o Shader.o Vector3int.o
OBJS += Camera.o DirectionalLight.o Texture.o Vector4.o
OBJS += OrthographicCamera.o Light.o VertexBuffer.o Vector4int.o
OBJS += PerspectiveCamera.o PointLight.o Color.o vectors.o
OBJS += Controller.o Material.o utils.o Scene.o
OBJS += DragController.o Mesh.o Vector2.o Window.o
OBJS += FlyController.o Object.o Vector2int.o OrbitController.o
OBJS += FrameBuffer.o Vector3.o dimension3D.o
###################################################
# Set thirdpart Dear ImGui
#
INCLUDES += -I$(THIRDPART)/imgui -I$(THIRDPART)/imgui/misc/cpp -I$(THIRDPART)/imgui-sfml
VPATH += $(THIRDPART)/imgui $(THIRDPART)/imgui-sfml $(THIRDPART)/imgui/misc/cpp
OBJS += imgui_widgets.o imgui_draw.o imgui_tables.o imgui.o imgui_stdlib.o imgui-SFML.o
###################################################
# 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)
LINKER_FLAGS += -lGLEW -lGL
PKG_LIBS += --static glfw3
else ifneq ($(ARCHI),Emscripten)
$(error Unknown architecture $(ARCHI) for OpenGL)
endif
###################################################
# Linkage
#
PKG_LIBS += sfml-graphics glm
LINKER_FLAGS += -ldl -lpthread
ifeq ($(ARCHI),Darwin)
PKG_LIBS += OpenCL OpenCL-CLHPP
else
PKG_LIBS += OpenCL
endif
###################################################
# Make the list of compiled files for the application
#
OBJS += Menu.o Computer.o Renderer.o Simulator.o ComputeShader.o main.o
###################################################
# Sharable informations between all Makefiles
include $(M)/Makefile.footer