From e50e53b3ea82926ab01858e5728e489bd38d6878 Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 21 Jul 2024 20:22:36 +1000 Subject: texture compression --- Makefile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3-54-g00ecf