summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-07-21 20:22:36 +1000
committerquou <quou@disroot.org>2024-07-21 20:22:36 +1000
commite50e53b3ea82926ab01858e5728e489bd38d6878 (patch)
tree312c584a23ad3458314c1229c6be49cbaa75be00 /Makefile
parent2d0d48846e66bbb0b5c6966d842cea01f4ca468d (diff)
texture compression
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 14 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 33c0c01..792b8b1 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@ int_dir = intermediate
data_dir = data
target = 3de
convmesh = convmesh
+convtexture = convtexture
packassets = packassets
pack = pack
@@ -29,8 +30,11 @@ mesh_sources = \
$(int_dir)/monkey.obj \
$(int_dir)/cube.obj
+texture_sources = \
+ $(int_dir)/gun.bmp \
+
meshes = $(mesh_sources:$(int_dir)/%.obj=$(data_dir)/%.msh)
-assets = $(meshes)
+textures = $(texture_sources:$(int_dir)/%.bmp=$(data_dir)/%.bc1)
all: $(target) $(pack)
@@ -43,19 +47,23 @@ $(target): $(objects)
$(meshes): $(data_dir)/%.msh : $(int_dir)/%.obj | $(convmesh) $(data_dir)
./$(convmesh) $< $@
-$(convassets): convassets.c
- $(tool_compiler) $(cflags) -o $@ $<
+$(textures): $(data_dir)/%.bc1 : $(int_dir)/%.bmp | $(convtexture) $(data_dir)
+ ./$(convtexture) $< $@
$(convmesh): convmesh.c
$(tool_compiler) $(cflags) -o $@ $<
+$(convtexture): convtexture.c
+ $(tool_compiler) $(cflags) -o $@ $< -lm
+
$(packassets): packassets.c
$(tool_compiler) packassets.c $(cflags) -o $@
-$(pack): $(packassets) $(meshes)
+$(pack): $(packassets) $(meshes) $(textures)
./$(packassets) \
$(data_dir) \
- $(notdir $(meshes))
+ $(notdir $(meshes)) \
+ $(notdir $(textures))
$(data_dir):
mkdir -p $(data_dir)
@@ -63,6 +71,7 @@ $(data_dir):
clean:
rm -f $(packassets)
rm -f $(convmesh)
+ rm -f $(convtexture)
rm -rf data
rm *.d
rm *.o