Snek/Makefile

48 lines
1.1 KiB
Makefile
Raw Normal View History

2020-03-23 19:11:39 +00:00
.PHONY: all clean
2020-03-26 17:05:12 +00:00
IMAGES = $(foreach name, apple wall, public/assets/$(name)32.png)
TILESETS = $(foreach name, hole, public/assets/$(name)-ts.png)
JSON = $(foreach name, snake levelList config, public/assets/$(name).json)
2020-03-23 19:11:39 +00:00
ICON = public/assets/icon32.png public/assets/icon256.png public/favicon.ico
CSS = public/css/snek.css
2020-03-24 09:46:01 +00:00
JS = public/js/snek.js
2020-03-23 19:11:39 +00:00
2020-03-26 17:05:12 +00:00
OUTPUT = $(IMAGES) $(TILESETS) $(JSON) $(ICON) $(CSS) $(JS)
2020-03-24 09:46:01 +00:00
2020-03-26 17:05:12 +00:00
all: images tilesets json icon css js
2020-03-23 19:11:39 +00:00
2020-03-26 17:05:12 +00:00
images: $(IMAGES)
tilesets: $(TILESETS)
json: $(JSON)
icon: $(ICON)
2020-03-23 19:11:39 +00:00
css: $(CSS)
2020-03-24 09:46:01 +00:00
js: $(JS)
2020-03-23 19:11:39 +00:00
public/favicon.ico: assets/icon.jpg
convert $^ -resize 32x $@
2020-03-25 14:57:20 +00:00
public/assets/%32.png: assets/%.png
2020-03-23 19:11:39 +00:00
convert $^ -resize 32x $@
2020-03-25 14:57:20 +00:00
public/assets/%256.png: assets/%.png
convert $^ -resize 256x $@
2020-03-23 19:11:39 +00:00
2020-03-25 14:57:20 +00:00
public/assets/%32.png: assets/%.jpg
2020-03-23 19:11:39 +00:00
convert $^ -resize 32x $@
2020-03-25 14:57:20 +00:00
public/assets/%256.png: assets/%.jpg
convert $^ -resize 256x $@
2020-03-23 19:11:39 +00:00
2020-03-26 17:05:12 +00:00
public/assets/%-ts.png: assets/%.png
convert $^ -scale 32x $@
2020-03-25 14:57:20 +00:00
public/assets/%.json: assets/%.json
2020-03-23 19:11:39 +00:00
cp $^ $@
2020-03-24 09:46:01 +00:00
public/css/snek.css: src/less/snek.less $(wildcard src/less/*.less)
lessc $< $@
public/js/snek.js: $(wildcard src/js/*.js)
node mergejs.js $^ > $@
2020-03-23 19:11:39 +00:00
clean:
rm -f $(OUTPUT)