Makefile for images. Cleanup.

This commit is contained in:
Dejvino
2023-04-22 20:58:50 +02:00
parent 1461c39400
commit 3cc530864b
6 changed files with 61 additions and 7 deletions
+21 -6
View File
@@ -1,11 +1,26 @@
.DEFAULT_GOAL := build
all: images download
SRC_IMAGES := $(wildcard gallery/*.jpg)
DST_IMAGES := $(sort $(addprefix build/,$(addsuffix .bmp,$(notdir $(basename $(SRC_IMAGES))))))
all: clean build
images:
cd gallery && for F in *.jpg; do ./convert_image.sh $F $F.bmp
download: jokes.json
jokes.json:
curl -o jokes.json https://github.com/wiz64/superfun/raw/main/database/ichd/jokes-file.json
jokes.json: build-dir
curl -o build/jokes.json https://github.com/wiz64/superfun/raw/main/database/ichd/jokes-file.json
build: build-dir images download
build-dir:
mkdir -p build
images: $(DST_IMAGES)
$(DST_IMAGES): build/%.bmp: gallery/%.jpg
./convert_image.sh $< $@
.PHONY: clean
clean:
rm -rf build/