@echo
@echo 'make "docker-build^IMPL" # build docker image for IMPL'
@echo
+ @echo 'make "docker-shell^IMPL" # start bash shell in docker image for IMPL'
+ @echo
#
# Command line settings
,\
$(MAKE) $(if $(strip $($(1)_MODE)),$(1)_MODE=$($(1)_MODE),)))
-# Takes impl and step arguments
+# Takes impl and step args. Optional env vars and dockerize args
# Returns a command prefix (docker command and environment variables)
# necessary to launch the given impl and step
-get_run_prefix = $(strip $(if $(strip $(DOCKERIZE)),\
+get_run_prefix = $(strip $(if $(strip $(DOCKERIZE) $(4)),\
docker run -e STEP=$($2) -e MAL_IMPL=$(MAL_IMPL) \
-it --rm -u $(shell id -u) \
-v $(dir $(abspath $(lastword $(MAKEFILE_LIST)))):/mal \
DOCKER_BUILD = $(foreach impl,$(DO_IMPLS),docker-build^$(impl))
+DOCKER_SHELL = $(foreach impl,$(DO_IMPLS),docker-shell^$(impl))
+
IMPL_PERF = $(foreach impl,$(filter-out $(perf_EXCLUDES),$(DO_IMPLS)),perf^$(impl))
IMPL_REPL = $(foreach impl,$(DO_IMPLS),repl^$(impl))
#
-# Dist rules
+# Docker build rules
#
-dist: $(IMPL_DIST)
+docker-build: $(DOCKER_BUILD)
-$(IMPL_DIST):
+$(DOCKER_BUILD):
@echo "----------------------------------------------"; \
$(foreach impl,$(word 2,$(subst ^, ,$(@))),\
- echo "Running: make -C $(impl) dist"; \
- $(MAKE) --no-print-directory -C $(impl) dist)
-
+ echo "Running: docker build -t $(call impl_to_image,$(impl)) .:"; \
+ cd $(impl) && docker build -t $(call impl_to_image,$(impl)) .)
#
-# Docker build rules
+# Docker shell rules
#
-docker-build: $(DOCKER_BUILD)
-
-$(DOCKER_BUILD):
- echo "----------------------------------------------"; \
+$(DOCKER_SHELL):
+ @echo "----------------------------------------------"; \
$(foreach impl,$(word 2,$(subst ^, ,$(@))),\
- echo "Running: docker build -t $(call impl_to_image,$(impl)) .:"; \
- cd $(impl) && docker build -t $(call impl_to_image,$(impl)) .)
+ echo "Running: $(call get_run_prefix,$(impl),stepA,,dockerize) bash"; \
+ $(call get_run_prefix,$(impl),stepA,,dockerize) bash)
#