aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: 8515e673fdebe02c36503f4ebfb477856bfe0138 (plain) (blame)
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
shadersdir = $(datarootdir)/shaders
SLANGC = slangc

bin_PROGRAMS = engine
shaders_PROGRAMS = shader.spv

engine_SOURCES = \
	engine.cpp \
	renderer.hpp renderer.cpp \
	obj_parser.hpp obj_parser.cpp \
	vulkan_utils.hpp \
	stb_image.cpp \
	fb/fb.hpp \
	fb/chfb.hpp fb/chfb.cpp \
	fb/pixfb.hpp fb/pixfb.cpp \
	math/utils.hpp \
	math/vector.hpp \
	math/mat4.hpp \
	math/quat.hpp \
	math/tform.hpp \
	o3d/mesh.hpp o3d/mesh.cpp \
	o3d/obj3d.hpp \
	o3d/vertex.hpp \
	o3d/deriv_vertex.hpp \
	o3d/tri.hpp \
	o3d/tri_deriv.hpp \
	o3d/polygon.hpp \
	o3d/camera.hpp \
	o3d/scene.hpp \
	ctrl/keyboard.hpp \
	ctrl/mouse.hpp \
	shaders/shaders.hpp \
	shaders/simple_shaders.hpp shaders/simple_shaders.cpp

# TODO: we should somehow pass assetsdir and texturesdir from ../Makefile.am to this Makefile.am.
# We assume that they will always be relative to datadir, which might not be true if they are
# configured differently
engine_CPPFLAGS = -std=gnu++23 -Wall -Wextra \
	-DDATADIR='"$(datadir)"' -DSHADERSDIR='"$(shadersdir)"' \
	$(GLFW3_CFLAGS) $(STB_CFLAGS) $(VULKAN_CFLAGS)
engine_LDFLAGS  = -std=gnu++23 -Wall -Wextra -fconcepts-diagnostics-depth=10
engine_LDADD    = $(GLFW3_LIBS) $(STB_LIBS) $(VULKAN_LIBS)

if HAVE_NCURSES
engine_CPPFLAGS += $(NCURSES_CFLAGS)
engine_LDADD    += $(NCURSES_LIBS)
endif

engine-stb_image.$(OBJEXT): CXXFLAGS += -Wno-unused-but-set-variable

shader_spv_SOURCES = shaders/shader.slang
shader_spv_SPVFLAGS = -target spirv -profile spirv_1_4 -emit-spirv-directly -fvk-use-entrypoint-name -entry vert_main -entry frag_main

shader.spv$(EXEEXT): shaders/shader.slang
	$(SLANGC) $(shader_spv_SPVFLAGS) -o $@ $<