56 lines
1.6 KiB
Makefile
56 lines
1.6 KiB
Makefile
CC = swege
|
|
SOURCE = src
|
|
DESTINATION = dst
|
|
PYHTON = python3
|
|
PORT = 8000
|
|
BIND = 127.0.0.1
|
|
RS_USER = neko
|
|
RS_HOST = darkn.space
|
|
RS_PATH = /home/neko/cyancat_net
|
|
CSSDIR = ${SOURCE}/assets/styles
|
|
SCRIPTS_DIR = ./scripts
|
|
|
|
all:
|
|
${CC}
|
|
|
|
rebuild:
|
|
${CC} rebuild
|
|
|
|
mincss:
|
|
@find ${CSSDIR} -type f -not -name '*.min.css' | ${SCRIPTS_DIR}/mincss
|
|
|
|
urlcheck:
|
|
@find ${SOURCE} -type f -name '*.md' -exec cat {} \+ | ${SCRIPTS_DIR}/urlcheck
|
|
|
|
perm:
|
|
find ./${DESTINATION} -type d -exec chmod 755 {} \;
|
|
find ./${DESTINATION} -type f -exec chmod 644 {} \;
|
|
|
|
serve: all
|
|
@echo "I serve the soviet YunYun!"
|
|
${PYHTON} -m http.server --bind ${BIND} -d ./${DESTINATION} ${PORT}
|
|
|
|
entr:
|
|
find ./${SOURCE} | entr make
|
|
|
|
deploy: all perm
|
|
rsync -rtvzP ./${DESTINATION}/* ${RS_USER}@${RS_HOST}:${RS_PATH}/
|
|
|
|
clean:
|
|
rm -rf ./${DESTINATION} ./.manifest
|
|
|
|
help:
|
|
@echo 'make # build site'
|
|
@echo 'make rebuild # forcefully rebuild site'
|
|
@echo 'make post # write a new article'
|
|
@echo 'make mincss # minify CSS, invoke each time you modify CSS files'
|
|
@echo 'make urlcheck # check Markdown source files for dead URLs'
|
|
@echo 'make perm # set correct file permissions for output site files'
|
|
@echo 'make serve # launch a local HTTP server to see changes, requires python 3'
|
|
@echo 'make entr # check for file changes, and rebuild site automatically'
|
|
@echo 'make deploy # upload site to the server'
|
|
@echo 'make clean # delete the built site'
|
|
@echo 'make help # print this text'
|
|
|
|
.PHONY: all rebuild post mincss urlcheck perm serve entr deploy clean
|