diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -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 |