aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorIvan Zorin <[email protected]>2023-07-07 01:39:20 +0300
committerGitHub <[email protected]>2023-07-07 08:39:20 +1000
commit7b57cc981f5929ad190112cbf7b4a7ba2700c906 (patch)
tree432ed7fc2132ff9ea52e4c472100a6d9ac4a63be /Makefile
parent0be83598f1e61917b9ea6789f793a87c3a8e2907 (diff)
downloadIronOS-7b57cc981f5929ad190112cbf7b4a7ba2700c906.tar.gz
IronOS-7b57cc981f5929ad190112cbf7b4a7ba2700c906.zip
Refactoring check for docker to fix a bug to use Makefile inside docker (#1735)
* Makefile: refactoring check for docker to fix a bug so Makefile could be used inside of docker container * Makefile: update .PHONY section
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 24 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 40d6b8b2..51a7971c 100644
--- a/Makefile
+++ b/Makefile
@@ -19,8 +19,6 @@ ifdef DOCKER_COMPOSE
DOCKER_BIN:=$(DOCKER_COMPOSE)
else ifdef DOCKER_TOOL
DOCKER_BIN:=$(DOCKER_TOOL) compose
-else
-$(error ERROR: Can't find docker-compose nor docker tool. Please, install docker and try again)
endif # DOCKER_* checks
endif # DOCKER_BIN
@@ -64,14 +62,15 @@ help:
list:
@echo ""
@echo "Supported top-level targets:"
- @echo "\t * help - shows short basic help"
- @echo "\t * list - this output"
+ @echo "\t * help - shows short basic help"
+ @echo "\t * list - this output"
@echo "\t * docker-shell - start docker container with shell inside to work on IronOS with all tools needed"
@echo "\t * docker-build - compile builds of IronOS for supported models inside docker container and place them to \"scripts/ci/artefacts/\""
@echo "\t * docker-clean - delete created docker container (but not pre-downloaded data for it)"
- @echo "\t * docs - generate \"site\"/ directory with documentation in a form of static html files using ReadTheDocs framework and $(MKDOCS_YML) local config file"
- @echo "\t * docs-deploy - generate & deploy docs online to gh-pages branch of current github repo"
- @echo "\t * clean-full - delete files & directories generated by all the targets above "
+ @echo "\t * docs - generate \"site\"/ directory with documentation in a form of static html files using ReadTheDocs framework and $(MKDOCS_YML) local config file"
+ @echo "\t * docs-deploy - generate & deploy docs online to gh-pages branch of current github repo"
+ @echo "\t * clean-build - delete generated files & dirs produced during builds EXCEPT generated docker container image"
+ @echo "\t * clean-full - delete generated files & dirs produced during builds INCLUDING generated docker container image"
@echo ""
@echo "NOTES on supported pass-trough targets:"
@echo "\t * main Makefile is located in source/ directory and used to build the firmware itself;"
@@ -91,16 +90,25 @@ list:
# bash one-liner to generate langs for "make list":
# echo "`ls Translations/ | grep -e "^translation_.*.json$" | sed -e 's,^translation_,,g; s,\.json$,,g; ' | tr '\n' ' '`"
+# detect availability of docker
+docker-check:
+ifeq ($(DOCKER_BIN),)
+ @echo "ERROR: Can't find docker-compose nor docker tool. Please, install docker and try again"
+ @exit 1
+else
+ @true
+endif
+
# former start_dev.sh
-docker-shell: $(DOCKER_DEPS)
+docker-shell: docker-check $(DOCKER_DEPS)
$(DOCKER_CMD)
# former build.sh
-docker-build: $(DOCKER_DEPS)
+docker-build: docker-check $(DOCKER_DEPS)
$(DOCKER_CMD) /bin/bash /build/ci/buildAll.sh
# delete container
-docker-clean:
+docker-clean: docker-check
-docker rmi ironos-builder:latest
# generate docs in site/ directory (DIR for -d is relative to mkdocs.yml file location, hence use default name/location site by setting up ../site)
@@ -115,11 +123,14 @@ docs-deploy: $(MKDOCS_YML) Documentation/* Documentation/Flashing/* Documenta
%:
make -C source/ $@
-# global clean-up target
-clean-full: docker-clean
+# global clean-up target for produced/generated files inside tree
+clean-build:
make -C source/ clean-all
rm -Rf site
rm -Rf scripts/ci/artefacts
-.PHONY: docker-shell docker-build docker-clean docs clean-full
+# global clean-up target
+clean-full: clean-build docker-clean
+
+.PHONY: help list docker-check docker-shell docker-build docker-clean docs docs-deploy clean-build clean-full