Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: implement make help #788

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
.PHONY: all
all: build-binary build-container

.PHONY: help
help:
@echo 'Usage:'
@echo ' make <target>'
@echo ''
@echo 'Targets:'
@awk 'match($$0, /^([a-zA-Z_\/-]+):.*?## (.*)$$/, m) {printf " \033[36m%-30s\033[0m %s\n", m[1], m[2]}' $(MAKEFILE_LIST) | sort

.PHONY: clean
clean:
clean: ## clean all build and test artifacts
# not sure if we should remove generated stuff
# keep the output directory itself
#-rm -rf output/*
Expand All @@ -11,22 +19,25 @@ clean:
sudo rm -rf /var/tmp/bib-tests

.PHONY: test
test:
test: ## run all tests - Be aware that the tests take a really long time
@echo "Be aware that the tests take a really long time"
@echo "Running tests as root"
sudo -E pip install --user -r test/requirements.txt
sudo -E pytest -s -v

.PHONY: build
build: build-binary ## shortcut for build-binary

.PHONY: build-binary
build-binary:
build-binary: ## build the binaries (multiple architectures)
./build.sh

.PHONY: build-container
build-container:
build-container: ## build the bootc-image-builder container
sudo podman build --tag bootc-image-builder .

.PHONY: push-check
push-check: build-binary build-container test
push-check: build-binary build-container test ## run all checks and tests before a pushing your code
cd bib; go fmt ./...
@if [ 0 -ne $$(git status --porcelain --untracked-files|wc -l) ]; then \
echo "There should be no changed or untracked files"; \
Expand Down
Loading