@@ -10,11 +10,6 @@ export BASH_ENV := make_bash_env
1010
1111MAKEFLAGS += --no-builtin-rules
1212
13- lastword = $(word $(words $1 ) ,$1)
14- prelastword = $(word $(words $1 ) ,_ $1)
15- cname_version = $(call lastword,$(subst -, ,$1) )
16- cname_arch = $(call prelastword,$(subst -, ,$1) )
17-
1813define require_var =
1914ifndef $1
2015$$(error '$1 undefined')
@@ -28,6 +23,10 @@ SHORT_COMMIT := $(shell head -c 8 <<< '$(COMMIT)')
2823
2924DEFAULT_ARCH := $(shell dpkg --print-architecture)
3025
26+ cname_gl_version = $(shell gl-features-parse --feature-dir features --default-arch '$(NATIVE_ARCH ) ' --default-version '$(DEFAULT_VERSION ) -$(SHORT_COMMIT ) ' --cname '$1' version)
27+ cname_arch = $(shell gl-features-parse --feature-dir features --default-arch '$(NATIVE_ARCH ) ' --default-version '$(DEFAULT_VERSION ) -$(SHORT_COMMIT ) ' --cname '$1' arch)
28+ gl_version = $(firstword $(subst -, ,$(call cname_gl_version,$1) ) )
29+
3130export AWS_DEFAULT_REGION AWS_REGION AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN
3231
3332.PHONY : clean
@@ -38,19 +37,19 @@ clean:
3837.build/% .sentinel :
3938 true
4039
41- .build/bootstrap-% - $( SHORT_COMMIT ) .tar : $$(shell ./make_repo_sentinel $$(REPO ) $$(call cname_version ,$$* ) )
40+ .build/bootstrap-% .tar : $$(shell ./make_repo_sentinel $$(REPO ) $$(call cname_gl_version ,$$* ) )
4241 target ' $@'
43- info ' bootstrapping $*-$(SHORT_COMMIT) '
42+ info ' bootstrapping $*'
4443 arch=' $(call cname_arch,$*)'
45- version=' $(call cname_version ,$*)'
44+ version=' $(call gl_version ,$*)'
4645 ./bootstrap " $$ arch" " $$ version" ' $(REPO)' keyring.gpg ' $@'
4746
48- .build/% - $( SHORT_COMMIT ) .tar : .build/bootstrap-$$(call cname_arch,$$* ) -$$(call cname_version ,$$* ) - $( SHORT_COMMIT ) .tar $(shell ./make_directory_sentinel features) $(shell ./make_directory_sentinel cert)
47+ .build/% .tar : .build/bootstrap-$$(call cname_arch,$$* ) -$$(call cname_gl_version ,$$* ) .tar $(shell ./make_directory_sentinel features) $(shell ./make_directory_sentinel cert)
4948 target ' $@' ' $<'
50- info ' configuring rootfs $*-$(SHORT_COMMIT) '
51- features=" $$ (./parse_features --feature-dir features --cname '$* ' features)"
49+ info ' configuring rootfs $*'
50+ features=" $$ (gl-features-parse --feature-dir features --cname '$* ' features)"
5251 BUILDER_CNAME=' $*'
53- BUILDER_VERSION=' $(call cname_version ,$*)'
52+ BUILDER_VERSION=' $(call gl_version ,$*)'
5453 BUILDER_ARCH=' $(call cname_arch,$*)'
5554 BUILDER_TIMESTAMP=' $(TIMESTAMP)'
5655 BUILDER_COMMIT=' $(COMMIT)'
@@ -59,14 +58,14 @@ clean:
5958 ./configure ' $(word 1,$^)' ' $@'
6059
6160define artifact_template =
62- .build/%- $( SHORT_COMMIT ) .$1: $$$$(shell COMMIT=$(SHORT_COMMIT ) ./make_get_image_dependencies '$$$$@ ') $$(shell ./make_directory_sentinel features) $$(shell ./make_directory_sentinel cert)
61+ .build/%.$1: $$$$(shell COMMIT=$(SHORT_COMMIT ) ./make_get_image_dependencies '$$$$@ ') $$(shell ./make_directory_sentinel features) $$(shell ./make_directory_sentinel cert)
6362 script='$$(word 1,$$^ ) '
6463 input='$$(word 2,$$^ ) '
6564 target '$$@ ' "$$$$input"
6665 info 'building $1 image $$* '
67- features="$$$$(./parse_features --feature-dir features --cname '$$* ' features ) "
66+ features="$$$$(gl-features-parse --feature-dir features --cname '$$* ' features ) "
6867 BUILDER_CNAME='$$* '
69- BUILDER_VERSION='$$(call cname_version ,$$* ) '
68+ BUILDER_VERSION='$$(call gl_version ,$$* ) '
7069 BUILDER_ARCH='$$(call cname_arch,$$* ) '
7170 BUILDER_TIMESTAMP='$$(TIMESTAMP ) '
7271 BUILDER_COMMIT='$$(COMMIT ) '
@@ -77,15 +76,15 @@ endef
7776
7877$(foreach artifact_rule,$(shell ./make_get_artifact_rules),$(eval $(call artifact_template,$(artifact_rule))))
7978
80- .build/% - $( SHORT_COMMIT ) .artifacts : $$(shell COMMIT=$(SHORT_COMMIT ) ./make_list_build_artifacts '$$* ')
79+ .build/% .artifacts : $$(shell COMMIT=$(SHORT_COMMIT ) DEFAULT_VERSION= $( DEFAULT_VERSION ) NATIVE_ARCH= $( NATIVE_ARCH ) ./make_list_build_artifacts '$$* ')
8180 target ' $@'
8281 echo -n > ' $@'
8382 for f in $^; do
8483 basename " $$ f" | tee -a ' $@'
8584 echo " $$ (basename " $$ f" ).log" | tee -a ' $@'
8685 done
8786
88- % : .build/$$(shell ./parse_features --feature-dir features --default-arch '$$(DEFAULT_ARCH ) ' --default-version '$$(DEFAULT_VERSION ) ' --cname '$$* ') - $( SHORT_COMMIT ) .artifacts
87+ % : .build/$$(shell gl-features-parse --feature-dir features --default-arch '$$(DEFAULT_ARCH ) ' --default-version '$$(DEFAULT_VERSION ) - $$( SHORT_COMMIT ) ' --cname '$$* ') .artifacts
8988 ln -f -s -r ' $<' ' .build/$*'
9089
9190# prevents match anything rule from applying to Makefile and image/convert scripts
0 commit comments