Files
caperren-com/Makefile

101 lines
2.0 KiB
Makefile

# Makefile for caperren.com
.PHONY: \
install \
fix \
astro_upgrade \
build \
dev \
dev-hosted \
test \
_spelling-generate-new-words \
spelling-find-new-words \
spelling-add-new-words \
spelling-check \
cleanup-check \
cleanup-code \
convert_video \
convert_video_times \
generate_asset_imports
default: dev
install:
npm install
fix:
npm audit fix
astro_upgrade:
npx @astrojs/upgrade
build:
npm run build
dev:
npm run dev
dev-hosted:
npm run dev-hosted
test: spelling-check
@npx playwright install --with-deps
npm run test --ui
npx playwright test --ui
_spelling-generate-new-words:
@cspell --words-only --unique . 2>/dev/null | sort --ignore-case -o new-words.txt
spelling-find-new-words: _spelling-generate-new-words
@echo "Found the following new words:"
@cat new-words.txt
@rm -f new-words.txt
spelling-add-new-words: _spelling-generate-new-words
@echo "Adding to project-words.txt"
@cat new-words.txt >> project-words.txt
@rm -f new-words.txt
@cat project-words.txt | sort --ignore-case -o project-words.txt
spelling-check:
npx cspell .
cleanup-check:
npx prettier . --check
cleanup-code:
npx prettier . --write
convert_video:
ffmpeg \
-init_hw_device vaapi=va:/dev/dri/renderD128 \
-filter_hw_device va \
-i $(input) \
-vf 'format=nv12,hwupload,scale_vaapi=-2:720' \
-c:v h264_vaapi \
-rc_mode CQP \
-qp 28 \
-an \
$(extra_args) \
$(output)
convert_video_times:
ffmpeg \
-init_hw_device vaapi=va:/dev/dri/renderD128 \
-filter_hw_device va \
-i $(input) \
-ss $(start) \
-to $(end) \
-vf 'format=nv12,hwupload,scale_vaapi=-2:720' \
-c:v h264_vaapi \
-rc_mode CQP \
-qp 28 \
-an \
$(output)
generate_asset_imports:
@for assets_path in `find "src/assets/${assets_relative_path}" -maxdepth 1 -type f -printf "%f\n"`; do \
without_extension=$${assets_path/%.*}; \
echo "import $${without_extension//-/_} from \"@assets/${assets_relative_path}/$$assets_path\";"; \
done;