summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 17 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index a86a869..0828805 100644
--- a/Makefile
+++ b/Makefile
@@ -2,11 +2,12 @@
target = c2
data_dir = data
-shaders = $(data_dir)/triangle.csh $(data_dir)/ui.csh
+shaders = $(data_dir)/triangle.csh $(data_dir)/ui.csh $(data_dir)/surface.csh
textures = $(data_dir)/22.tex $(data_dir)/kita.tex
-packed_files = $(shaders) $(textures)
+models = $(data_dir)/monkey.mdl
+packed_files = $(shaders) $(textures) $(models)
tools = qstd cfg sc
-objects = app.o c2.o video.o pipeline.o asset.o ui.o maths.o
+objects = app.o c2.o video.o pipeline.o asset.o ui.o maths.o model.o
includes = -Iqstd
defines = -Dplat_x86 -Dplat_posix -Dplat_x11 -Dallocation_default_alignment=8
cflags = -MMD -MF $(basename $@).d $(includes) $(defines) $(DEBUG_COMPILE_FLAG)
@@ -31,6 +32,9 @@ packer: packer.c | qstd
convtexture: convtexture.c | qstd
$(CC) $(cflags) convtexture.c $(lflags) -Lqstd -lqstd -o convtexture
+convmodel: convmodel.c | qstd
+ $(CC) $(cflags) convmodel.c $(lflags) -Lqstd -lqstd -o convmodel
+
pack: $(packed_files) packer
./packer pack $(data_dir) $(notdir $(packed_files))
@@ -40,12 +44,18 @@ data/triangle.csh: intermediate/triangle.glsl | $(data_dir) sc
data/ui.csh: intermediate/ui.glsl | $(data_dir) sc
./sc/sc intermediate/ui.glsl $(data_dir)/ui.csh
+data/surface.csh: intermediate/surface.glsl | $(data_dir) sc
+ ./sc/sc intermediate/surface.glsl $(data_dir)/surface.csh
+
data/22.tex: intermediate/22.bmp | $(data_dir) convtexture
./convtexture intermediate/22.bmp $(data_dir)/22.tex bc1
data/kita.tex: intermediate/kita.bmp | $(data_dir) convtexture
./convtexture intermediate/kita.bmp $(data_dir)/kita.tex bc1
+data/monkey.mdl: intermediate/monkey.glb $(shaders) | $(data_dir) convmodel
+ ./convmodel $(data_dir) intermediate/monkey.glb $(data_dir)/monkey.mdl
+
app.o:
$(CXX) -c $(cflags) app.cpp -o app.o
@@ -64,6 +74,9 @@ ui.o:
maths.o:
$(CXX) -c $(cflags) maths.cpp -o maths.o
+model.o:
+ $(CXX) -c $(cflags) model.cpp -o model.o
+
c2.o:
$(CXX) -c $(cflags) c2.cpp -o c2.o
@@ -81,6 +94,7 @@ clean:
rm -f $(objects)
rm -f $(targets)
rm -f convtexture
+ rm -f convmodel
rm -f packer
make -C qstd clean
make -C cfg clean