.PHONY: lint clean check-publish publish serve output: $(shell find content static) .cache/generator .cache/fonts .cache/lint python generator/generate.py touch $@ .cache/generator: $(shell find generator) .cache/deps python -m black . touch $@ .cache/deps: Makefile toolbox run echo || toolbox -y create toolbox run sh -c 'which npx || sudo dnf -y install npm' toolbox run sh -c 'which pip || sudo dnf -y install pip' toolbox run pip install black toolbox run pip install beautifulsoup4==4.9.3 toolbox run pip install marko==1.1.0 toolbox run pip install python-frontmatter==1.0.0 mkdir -p .cache touch $@ .cache/fonts: $(shell find ~/Software/src/Iosevka/dist/*/WOFF2/) ~/Software/src/smol-emoji/SmolEmoji-Regular.otf touch $@ lint: .cache/lint .cache/lint: $(shell find static/style) .cache/deps toolbox run npx -y prettier -w static/style/tarazed.css touch $@ clean: .cache/clean .cache/clean: $(shell find output/*) rm -r output touch $@ check-publish: ifeq "${SSHUSER}" "" @echo "SSHUSER is undefined" @exit 1 else ifeq "${SSHPASS}" "" @echo "SSHPASS is undefined" @exit 1 else ifeq "${SSHDIR}" "" @echo "SSHDIR is undefined" @exit 1 else ifeq "${SSHPORT}" "" @echo "SSHPORT is undefined" @exit 1 else ifneq "$(shell git status --porcelain)" "" @echo "Uncommitted changes:" @git status --porcelain @exit 1 endif publish: clean check-publish .cache/publish .cache/publish: output echo -e "cd ${SSHDIR} \n put -r output/* \n exit" | \ sshpass -e sftp -oBatchMode=no -b - sftp://${SSHUSER}@gkn.me.uk:${SSHPORT} touch $@ serve: output cd output && python -m http.server