@@ -12,20 +12,22 @@ do_default=true
1212do_alpine =true
1313
1414# The following logic evaluates VERSION and VARIANT variables that may have
15- # been previously specified, and unsets the "do" flags depending on the values.
15+ # been previously specified, and modifies the "do" flags depending on the values.
1616# The VERSIONS variable is also set to contain the version(s) to be processed.
1717ifdef VERSION
18- VERSIONS =$(VERSION ) # If a version was speciefied, VERSIONS only contains the specified version
19- ifdef VARIANT
20- do_default =false # If a variant was specified as an environment variable, don't process the default
21- ifneq ($(VARIANT ) ,alpine)
22- do_alpine =false # If alpine variant was specified as an environment variable, process the alpine variant
18+ VERSIONS =$(VERSION ) # If a version was specified, VERSIONS only contains the specified version
19+ ifdef VARIANT # If a variant is specified, unset all do flags and allow subsequent logic to set them again where appropriate
20+ do_default=false
21+ do_alpine =false
22+ ifeq ($(VARIANT),default)
23+ do_default =true
24+ endif
25+ ifeq ($(VARIANT),alpine)
26+ do_alpine =true
2327 endif
24- else
25- do_alpine =false # If no variant was specified, don't process the alpine variant
2628 endif
27- ifeq ("$(wildcard $(VERSION)/alpine)","")
28- do_alpine =false # If no alpine subdirectory exists, don't process the alpine version
29+ ifeq ("$(wildcard $(VERSION)/alpine)","") # If no alpine subdirectory exists, don't process the alpine version
30+ do_alpine =false
2931 endif
3032else # If no version was specified, VERSIONS should contain all versions
3133 VERSIONS = $(foreach df,$(wildcard * /Dockerfile) ,$(df:%/Dockerfile=% ) )
0 commit comments