-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (43 loc) · 1.77 KB
/
Makefile
File metadata and controls
50 lines (43 loc) · 1.77 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# COINCUBE pitch deck — developer tasks
#
# Run from the project root:
# make help list targets
# make optimize-images regenerate AVIF/WebP siblings for artwork/
#
# This Makefile wraps pnpm so targets work on any machine with pnpm + Node
# installed. No machine-specific paths.
PNPM ?= pnpm
NODE ?= node
.PHONY: help install optimize-images optimize-images-force clean-optimized
help:
@echo "COINCUBE deck — make targets"
@echo ""
@echo " make install pnpm install (run once after cloning)"
@echo " make optimize-images generate AVIF + WebP siblings for artwork/"
@echo " (idempotent — skips files already up to date)"
@echo " make optimize-images-force rebuild every sibling, ignoring mtime cache"
@echo " make clean-optimized delete every generated .avif / .webp sibling"
@echo ""
install:
$(PNPM) install
# Regenerate optimized AVIF/WebP siblings next to every PNG/JPEG under
# artwork/. Non-destructive: the original source images are untouched.
#
# The target first ensures dependencies (including sharp) are installed,
# then invokes the script via pnpm so the local node_modules/.bin is on PATH.
optimize-images:
@if [ ! -d node_modules/sharp ]; then \
echo "sharp not installed — running pnpm install first..."; \
$(PNPM) install; \
fi
$(PNPM) run optimize:images
optimize-images-force:
@if [ ! -d node_modules/sharp ]; then \
echo "sharp not installed — running pnpm install first..."; \
$(PNPM) install; \
fi
$(PNPM) exec $(NODE) scripts/optimize-images.mjs --force
# Remove every generated optimized sibling. Safe: only touches .avif/.webp
# inside artwork/, never the source PNGs/JPEGs.
clean-optimized:
@find artwork -type f \( -name '*.avif' -o -name '*.webp' \) -print -delete