Makefile: don't warn "outside container" for some targets
This change allows some make targets to be ran outside the dev-container for
easier discovery and use:
- `make clean` can be used on the host (as artifacts created from within the
development container are usually stored on the host).
- `make help` was already allowed
- `make dev` and `make shell` are added to the regular Makefile, to make it
easier to create and start the development container.
- When attempting to run `make dev` from within the development container, a
message is printed, and the target is cancelled:
root@docker-cli-dev$ make dev
you are already in the dev container
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
11
Makefile
11
Makefile
@ -9,6 +9,17 @@ all: binary
|
||||
|
||||
_:=$(shell ./scripts/warn-outside-container $(MAKECMDGOALS))
|
||||
|
||||
.PHONY: dev
|
||||
dev: ## start a build container in interactive mode for in-container development
|
||||
@if [ -n "${DISABLE_WARN_OUTSIDE_CONTAINER}" ]; then \
|
||||
echo "you are already in the dev container"; \
|
||||
else \
|
||||
$(MAKE) -f docker.Makefile dev; \
|
||||
fi
|
||||
|
||||
.PHONY: shell
|
||||
shell: dev ## alias for dev
|
||||
|
||||
.PHONY: clean
|
||||
clean: ## remove build artifacts
|
||||
rm -rf ./build/* man/man[1-9] docs/yaml
|
||||
|
||||
Reference in New Issue
Block a user