# Hurry Curry! - a game about cooking # Copyright 2024 metamuffin # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, version 3 of the License only. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # 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') CLIENT_DEPS = assets/atlas.meta.csv assets/atlas.ta assets/connect.csv assets/palette.csv IMPORT = ../target/release/tex_import EXPORT = ../target/release/tex_export PACK = ../target/release/tex_pack COMPOSE = ../target/release/tex_compose CLIENT = ../target/release/pixelcurry .PHONY: all tex_pack tex_export tex_import clean all: $(CLIENT) icon.png tex_pack: assets/atlas.ta tex_import: $(TEXTURES_IMPORT_PNG) tex_export: $(TEXTURES_PNG) $(SPRITES_PNG) assets/atlas.png clean: rm -f $(PNG) rm -fr assets/sprites rm -f assets/atlas.ta assets/atlas.meta.csv $(CLIENT): $(shell find src -type f) $(CLIENT_DEPS) cargo +nightly build --release --bin pixelcurry $(IMPORT) $(EXPORT) $(PACK) $(COMPOSE): $(shell find tools/src -type f) { cd tools; cargo +nightly build --release; } %.ta: %.import.png $(IMPORT) $(IMPORT) $< $@ %.png: %.ta $(EXPORT) $(EXPORT) $< $@ icon.png: assets/sprites/misc/icon+a.png ffmpeg -i $< -vf scale=512x512:sws_flags=neighbor -y $@ assets/sprites/%/all: assets/%.ini $(TEXTURES) $(COMPOSE) @mkdir -p $(shell dirname $@) $(COMPOSE) $< assets/textures $(shell dirname $@) @touch $@ assets/atlas.ta assets/atlas.meta.csv: assets/sprites/items/all assets/sprites/tiles/all assets/sprites/font/all assets/sprites/misc/all $(PACK) @echo $(PACK) assets/atlas.ta assets/atlas.meta.csv ... @$(PACK) assets/atlas.ta assets/atlas.meta.csv $(SPRITES)