From: Alexandru Avadanii Date: Thu, 30 May 2019 12:57:13 +0000 (+0300) Subject: [docker] Fix wrong dependency in build target X-Git-Tag: 2.0.0~84 X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=validation.git;a=commitdiff_plain;h=555ff3c04c0a6344e2cf91e7923694801175b9bd [docker] Fix wrong dependency in build target Previously, we relied on the '$<' Makefile automatic variable to determine the directory where a certain build target should run. Although this worked for a single container (as '$<' expands to the *first* dependency of the make target), it causes issues when multiple subdirectories are present, since all but the first target will have '$<' pointing to the same first subdirectory. Instead, switch to using '$@' which always expands to the current make target and perform some simple string manipulation to extract the proper target directory where the build should occur. JIRA: VAL-27 Signed-off-by: Alexandru Avadanii Change-Id: Id8448c6feffb04dc14c8cd1c3d362f1d2934fd24 --- diff --git a/docker/Makefile b/docker/Makefile index 426d22d..707dbc8 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -33,11 +33,11 @@ $(SUBDIRS_NAME): $(MAKE) -C $@ .PHONY: $(SUBDIRS_BUILD) -$(SUBDIRS_BUILD): $(SUBDIRS) - $(MAKE) -C $< build +$(SUBDIRS_BUILD): + $(MAKE) -C $(@:-build=) build .PHONY: $(SUBDIRS_PUSH) -$(SUBDIRS_PUSH): $(SUBDIRS) - $(MAKE) -C $< .push_image +$(SUBDIRS_PUSH): + $(MAKE) -C $(@:-push=) .push_image include build.mk