refactor(make): split Makefile into sub-tasks files

This commit is contained in:
Glenn Y. Rolland 2024-08-05 12:36:47 +02:00
parent b525f75055
commit 1ebd4cbd4f
4 changed files with 43 additions and 28 deletions

View file

@ -70,17 +70,13 @@ all: help
## Install prerequisites
##
prepare: prepare-slides prepare-docs ## install prerequisites
prepare: prepare-slides
prepare-slides: ## install prerequisites for PDF slides only
npm install
npm rebuild node-sass
npx browserslist@latest --update-db
prepare-docs: ## install prerequisites for static docs site only
pipenv install
.PHONY: prepare prepare-slides prepare-docs
.PHONY: prepare prepare-slides
images: $(DOCS_IMAGES_SVG) $(DOCS_IMAGES_PNG) ## build images
@echo "Source:"
@ -273,26 +269,7 @@ clean-docs:
.PHONY: clean clean-slides clean-docs
##
## Utilities
##
include tasks/docs.mk
include tasks/docker.mk
include tasks/utils.mk
fixme:
@egrep --color -rni '(fixme)' $(DOCS_DIR) $(SLIDES_DIR)
.PHONY: fixme
docker-build: ## build docker image
docker build \
--file docker/Dockerfile \
--tag glenux/docmachine:$(BUILD_VERSION) \
.
docker tag \
glenux/docmachine:$(BUILD_VERSION) \
glenux/docmachine:latest
docker-push: ## push docker image
env docker push glenux/docmachine:latest
docker-pull: ## download docker image
env docker pull glenux/docmachine:latest

16
tasks/docker.mk Normal file
View file

@ -0,0 +1,16 @@
# vim: set ft=make :
docker-build: ## build docker image
docker build \
--file docker/Dockerfile \
--tag glenux/docmachine:$(BUILD_VERSION) \
.
docker tag \
glenux/docmachine:$(BUILD_VERSION) \
glenux/docmachine:latest
docker-push: ## push docker image
env docker push glenux/docmachine:latest
docker-pull: ## download docker image
env docker pull glenux/docmachine:latest

12
tasks/docs.mk Normal file
View file

@ -0,0 +1,12 @@
# vim: set ft=make :
prepare: prepare-docs ## install prerequisites
prepare-docs: ## install prerequisites for static docs site only
pipenv install
sync-docs-internal:
@>&2 echo "ERROR: not implemented"
exit 1
.PHONY: prepare-docs

10
tasks/utils.mk Normal file
View file

@ -0,0 +1,10 @@
# vim: set ft=make :
##
## Utilities
##
fixme:
@egrep --color -rni '(fixme)' $(DOCS_DIR) $(SLIDES_DIR)
.PHONY: fixme