site.lyte.dev/makefile

42 lines
1.0 KiB
Makefile
Raw Normal View History

2020-09-17 13:35:38 -05:00
HUGO ?= hugo
DEV_SERVE ?= serve --buildDrafts --buildFuture --buildExpired
2020-12-16 00:13:13 -06:00
NETLIFY_DEPLOY ?= deploy -d public
2020-12-17 16:37:54 -06:00
LOCAL_IP ?= $(shell ip a | grep -oP '192\.168\.\d+\.\d+/' | head -n 1 | tr -d '/')
2020-09-17 13:35:38 -05:00
.PHONY: all
2020-07-14 16:51:25 -05:00
all: build
2020-09-17 13:35:38 -05:00
.PHONY: build
2020-12-16 11:12:42 -06:00
build: static/font.css static/styles.css ; @${HUGO}
2020-09-17 13:35:38 -05:00
.PHONY: public
public: build
.PHONY: dev
2020-12-15 17:29:49 -06:00
dev:
2020-12-16 00:13:13 -06:00
@stylus -w src/stylus/styles.styl --sourcemap -o static/styles.css &
2020-12-15 17:29:49 -06:00
@${HUGO} ${DEV_SERVE}
2020-09-17 13:35:38 -05:00
.PHONY: dev-ext
2020-12-16 00:13:13 -06:00
dev-ext:
@stylus -w src/stylus/styles.styl --sourcemap -o static/styles.css &
2020-12-17 16:37:54 -06:00
@${HUGO} ${DEV_SERVE} --bind ${LOCAL_IP} --baseURL ${LOCAL_IP}
2020-09-17 13:35:38 -05:00
.PHONY: clean
2020-07-14 18:02:25 -05:00
clean: ; @rm -r public
2020-09-17 13:35:38 -05:00
.PHONY: publish
2020-12-15 17:29:49 -06:00
publish: clean-css public ; @netlify ${NETLIFY_DEPLOY} && echo "Run \`make publish-prod\` when ready."
2020-09-17 13:35:38 -05:00
.PHONY: publish-prod
2020-12-15 17:29:49 -06:00
publish-prod: clean-css public ; @netlify ${NETLIFY_DEPLOY} --prod
2020-12-16 11:12:42 -06:00
static/font.css: src/stylus/font.styl
stylus --compress $< -o $@
2020-12-16 00:13:13 -06:00
static/styles.css: src/stylus/styles.styl $(shell find src/stylus -regex ".*\.styl")
2020-12-15 17:29:49 -06:00
stylus --compress $< -o $@
.PHONY: clean-css
2020-12-16 00:13:13 -06:00
clean-css: ; rm -f static/styles.css