FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
LightSim3D/Makefile at main · ron-che-debugger/LightSim3D · GitHub
ron-che-debugger
/
LightSim3D
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
LightSim3D
/
Makefile
Copy path
More file actions
More file actions
Latest commit
History
History
History
101 lines (80 loc) · 3.77 KB
Breadcrumbs
LightSim3D
/
Makefile
Copy path
File metadata and controls
101 lines (80 loc) · 3.77 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#
Compiler
NVCC
= "D:/External Installations/bin/nvcc.exe"
#
Compute capability
CUDA_ARCH
= -gencode=arch=compute_52,code=\"sm_52,compute_52\"
#
Include directories
#
Replace "D:/External Installations/include" with your local CUDA installation directory
INCLUDES
= -I"./include"
\
-I"D:/External Installations/include"
\
-I"D:/External_Apps/GLEW/include"
\
-I"D:/External_Apps/GLFW/include"
\
-I"D:/External_Apps/JSON/json/include"
\
-I"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/include"
\
-I"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/ucrt"
\
-I"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/shared"
\
-I"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/um"
\
-I"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/winrt"
\
-I"C:/Program Files (x86)/Windows Kits/10/Include/10.0.22621.0/cppwinrt"
#
Preprocessor macros
DEFINES
= -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE -D_MBCS
#
Host compiler flags with spaces
XCOMPILER_FLAGS
= "/std:c++17 /EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd"
#
Define the host compiler
CCBIN
= "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe"
#
NVCC compile flags
NVCC_COMPILE_FLAGS
=
$(
CUDA_ARCH
)
-G -g -std=c++17
$(
INCLUDES
)
$(
DEFINES
)
\
-Xcompiler
$(
XCOMPILER_FLAGS
)
\
-cudart static --use-local-env --machine 64 --compile -x cu
\
-ccbin
$(
CCBIN
)
#
Linker flags (use -Xlinker and properly quote paths with spaces)
LINKER_FLAGS
= -Xlinker /LIBPATH:\"D:/External_Apps/GLEW/lib\"
\
-Xlinker /LIBPATH:\"D:/External_Apps/GLFW/lib\"
\
-Xlinker /LIBPATH:\"C:/Program\ Files/Microsoft\ Visual\ Studio/2022/Community/VC/Tools/MSVC/14.41.34120/lib/x64\"
\
-Xlinker /LIBPATH:\"C:/Program\ Files\ \(x86\)/Windows\ Kits/10/Lib/10.0.22621.0/ucrt/x64\"
\
-Xlinker /LIBPATH:\"C:/Program\ Files\ \(x86\)/Windows\ Kits/10/Lib/10.0.22621.0/um/x64\"
\
-lglew32 -lopengl32 -lglfw3 -luser32 -lgdi32 -lwinmm
#
NVCC link flags
NVCC_LINK_FLAGS
=
$(
CUDA_ARCH
)
-G -g
$(
INCLUDES
)
$(
DEFINES
)
\
-Xcompiler
$(
XCOMPILER_FLAGS
)
\
-cudart static --use-local-env --machine 64
\
-ccbin
$(
CCBIN
)
#
Directories
SRCDIR
= src
OBJDIR
= obj
#
Targets
TARGET
= raytracer.exe
#
Shared source files
SHARED_SRC
=
$(
wildcard
$(
SRCDIR
)
/math_utils.cpp)
\
$(
wildcard
$(
SRCDIR
)
/opengl_utils.cpp)
\
$(
wildcard
$(
SRCDIR
)
/obj_loader.cpp)
\
$(
wildcard
$(
SRCDIR
)
/bvh.cpp)
\
$(
wildcard
$(
SRCDIR
)
/ray.cpp)
SHARED_OBJ
=
$(
patsubst
$(
SRCDIR
)
/
%
.cpp,
$(
OBJDIR
)
/
%
.obj,
$(
SHARED_SRC:.cu=.cpp
)
)
\
$(
patsubst
$(
SRCDIR
)
/
%
.cu,
$(
OBJDIR
)
/
%
.obj,
$(
SHARED_SRC:.cpp=.cu
)
)
#
Ray Tracer specific source files
RAYTRACER_SRC
=
$(
SRCDIR
)
/raytracer.cu
\
$(
SRCDIR
)
/main.cpp
RAYTRACER_OBJ
=
$(
patsubst
$(
SRCDIR
)
/
%
.cpp,
$(
OBJDIR
)
/
%
.obj,
$(
RAYTRACER_SRC:.cu=.cpp
)
)
\
$(
patsubst
$(
SRCDIR
)
/
%
.cu,
$(
OBJDIR
)
/
%
.obj,
$(
RAYTRACER_SRC:.cpp=.cu
)
)
#
Build ray tracer executable
$(
TARGET
)
:
$(
RAYTRACER_OBJ
)
$(
SHARED_OBJ
)
@echo
"
Linking
$(
TARGET
)
...
"
$(
NVCC
)
$(
NVCC_LINK_FLAGS
)
-o
$@
$^
$(
LINKER_FLAGS
)
#
## Compile Rules ###
#
Compile shared source files
$(
OBJDIR
)
/
%
.obj
:
$(
SRCDIR
)
/
%
.cpp
@mkdir -p
"
$(
OBJDIR
)
"
$(
NVCC
)
$(
NVCC_COMPILE_FLAGS
)
-c
$<
-o
$@
$(
OBJDIR
)
/
%
.obj
:
$(
SRCDIR
)
/
%
.cu
@mkdir -p
"
$(
OBJDIR
)
"
$(
NVCC
)
$(
NVCC_COMPILE_FLAGS
)
-c
$<
-o
$@
#
Run target
run
:
$(
TARGET
)
#
Clean all build files
clean
:
rm -f
$(
OBJDIR
)
/
*
.obj
rm -f
$(
TARGET
)
rm -f
$(
TARGET:.exe=.exp
)
$(
TARGET:.exe=.lib
)
$(
TARGET:.exe=.pdb
)
rm -f vc
*
.pdb
#
Phony targets
.PHONY
: all clean run
Back
|
FazBrowse Home
|
New Git URL