added webp encoding

This commit is contained in:
dzonerzy 2023-10-20 22:17:40 +02:00
parent 576b2050a7
commit d5b43658d0
2 changed files with 9 additions and 3 deletions

View File

@ -13,6 +13,10 @@ LDFLAGS =
EMBED_TOOL = tools/bin/embed
EMBED_ARGS = -f=h
CONVERT_TOOL = $(shell which convert)
CONVERT_ARGS = -define webp
:lossless=false -define webp:alpha-compression=1 -define webp:alpha-quality=70 -define webp:emulate-jpeg-size=true -o
DIST = dist
SRC_DIR = src
RAW_DIST = dist/raw
@ -28,7 +32,9 @@ libdzonerzy:
@mkdir -p $(DIST)
@mkdir -p $(RAW_DIST)
@mkdir -p $(SITE_DIST)
@$(foreach file, $(wildcard res/*), $(EMBED_TOOL) -i $(file) -o $(SRC_INC_DIR)/$(notdir $(file)).h $(EMBED_ARGS);)
$(foreach file, $(wildcard res/*.jpg res/*.gif res/*.png), $(CONVERT_TOOL) $(file) $(CONVERT_ARGS) $(file).webp;)
@$(foreach file, $(wildcard res/*), $(EMBED_TOOL) -i $(file).webp -o $(SRC_INC_DIR)/$(notdir $(file).webp).h $(EMBED_ARGS);)
@rm -f res/*.webp
@ls $(SRC_INC_DIR)/*.h | xargs -n1 basename | sed 's/^/#include </' | sed 's/$$/>/' >> $(SRC_DIR)/res.h
$(CC) $(CFLAGS) $(LDFLAGS) -o $(DIST)/$(OUTPUT) $(SRC_DIR)/libdzonerzy.so.c $(SRC_DIR)/challenge.o

File diff suppressed because one or more lines are too long