aboutsummaryrefslogtreecommitdiff
path: root/webp/Makefile.single
blob: c84a4b870eeb03c23f2fcc5841b91bf541a0eeaa (plain) (blame)
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
# SPDX-FileCopyrightText: 2023 Brian Woods
# SPDX-License-Identifier: GPL-2.0-or-later

SRC_DIR=src
OUT_DIR=high_quality
WEBP_OPT=-near_lossless 60

SRC=$(shell find src/ -type f -name '*.png')
OUT=$(patsubst ${SRC_DIR}/%.png, ${OUT_DIR}/%.webp, $(SRC))

.PHONY: all clean
.SECONDARY: main-build

all: pre-build main-build

pre-build:
	( cd ${SRC_DIR};  find ./ -mindepth 1 -type d ) | xargs -I{} mkdir -p "${OUT_DIR}/{}"

main-build: ${OUT}

${OUT_DIR}/%.webp: ${SRC_DIR}/%.png
	cwebp ${WEBP_OPT} "$<" -o "$@"

clean:
	rm -rf ${OUT_DIR}