Skip to content

Commit

Permalink
Add Makefile documentation (#50)
Browse files Browse the repository at this point in the history
Add help texts to Makefile targets

Signed-off-by: ddelange <[email protected]>
  • Loading branch information
ddelange authored Aug 15, 2023
1 parent 3fd2814 commit 1aee152
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,49 @@ ifeq (run,$(firstword $(MAKECMDGOALS)))
endif

.PHONY: all
## Alias for `build`
all: build

.PHONY: build
## Build runtime Docker image
build:
./scripts/build_docker.sh --target runtime

.PHONY: build.develop
## Build developer container image
build.develop:
./scripts/build_docker.sh --target develop

.PHONY: develop
## Run interactive shell inside developer container
develop: build.develop
./scripts/develop.sh

.PHONY: run
## Run make target inside developer container (e.g. `make run fmt`)
run: build.develop
./scripts/develop.sh make $(RUN_ARGS)

.PHONY: test
## Run tests
test:
./scripts/run_tests.sh

.PHONY: fmt
## Auto-format source code and report code-style violations (lint)
fmt:
./scripts/fmt.sh

.PHONY: proto.compile
## Compile protos
proto.compile:
./scripts/compile_protos.sh

.DEFAULT_GOAL := help
.PHONY: help
## Print Makefile documentation
help:
@perl -0 -nle 'printf("\033[36m %-15s\033[0m %s\n", "$$2", "$$1") while m/^##\s*([^\r\n]+)\n^([\w.-]+):[^=]/gm' $(MAKEFILE_LIST) | sort

# Override targets if they are included in RUN_ARGs so it doesn't run them twice
$(eval $(RUN_ARGS):;@:)

0 comments on commit 1aee152

Please sign in to comment.