Created
March 25, 2022 11:00
-
-
Save rafaelfuchsbr/7d10d177c7ca5458bf9ccfe2b11ebd78 to your computer and use it in GitHub Desktop.
Get make targets in order based on dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IMAGE_DIRS = $(wildcard services/* bases/*) | |
# All targets are `.PHONY` ie allways need to be rebuilt | |
.PHONY: all ${IMAGE_DIRS} | |
# Build all images | |
all: ${IMAGE_DIRS} | |
# Build and tag a single image | |
${IMAGE_DIRS}: | |
$(eval FOLDER := $@) | |
@echo "${FOLDER}" | |
bases/golang-1.17.2: bases/tools | |
# For folders... | |
# bases/golang-1.17.2 | |
# bases/terraform-0.14.5 | |
# bases/tools | |
# | |
# It will echo the following: | |
# bases/tools | |
# bases/golang-1.17.2 | |
# bases/terraform-0.14.5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment