aboutsummaryrefslogtreecommitdiff
path: root/light-client/makefile
blob: 4f900412ac6912315176be661b12d3b99f9f84b5 (plain)
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
SPRITES = $(shell find assets/sprites -name '*.ta')
SPRITES_PNG = $(patsubst %.ta,%.png,$(SPRITES))

TEXTURES = $(shell find assets/textures -name '*.ta')
TEXTURES_PNG = $(patsubst %.ta,%.png,$(TEXTURES))
TEXTURES_IMPORT_PNG = $(patsubst %.import.png,%.ta,$(shell find assets/textures -name '*.import.png'))

PNG = $(shell find assets/textures -name '*.png')

.PHONY: tex_pack tex_export tex_import clean
tex_pack: assets/atlas.ta
tex_import: $(TEXTURES_IMPORT_PNG)
tex_export: $(TEXTURES_PNG) $(SPRITES_PNG) assets/atlas.png
clean:
	rm -f $(PNG)
	rm -f $(SPRITES)
	rm -f assets/atlas.ta assets/atlas.meta.csv

%.ta: %.import.png
	../target/release/tex_import $< $@
%.png: %.ta
	../target/release/tex_export $< $@

assets/sprites/items/all: assets/items.ini $(TEXTURES)
	@mkdir -p assets/sprites/items
	../target/release/tex_compose $< assets/textures assets/sprites/items
assets/sprites/tiles/all: assets/tiles.ini $(TEXTURES)
	@mkdir -p assets/sprites/tiles
	../target/release/tex_compose $< assets/textures assets/sprites/tiles

assets/atlas.ta assets/atlas.meta.csv: assets/sprites/items/all assets/sprites/tiles/all
	../target/release/tex_pack assets/atlas.ta assets/atlas.meta.csv $(SPRITES)