@@ -10,10 +10,11 @@ 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) )
13+ cname_parts = $(subst _, , $(subst -, , $1) )
14+ cname_gl_commit = $(lastword $(call cname_parts,$1) )
15+ gl_version = $(lastword $(filter-out $(call cname_gl_commit,$1) , $(call cname_parts,$1) ) )
16+ cname_gl_version = $(call gl_version,$1) -$(call cname_gl_commit,$1)
17+ cname_arch = $(lastword $(filter-out $(call gl_version,$1) $(call cname_gl_commit,$1) , $(call cname_parts,$1) ) )
1718
1819define require_var =
1920ifndef $1
@@ -38,22 +39,22 @@ clean:
3839.build/% .sentinel :
3940 true
4041
41- .build/bootstrap-% - $( SHORT_COMMIT ) .tar : $$(shell ./make_repo_sentinel $$(REPO ) $$(call cname_version ,$$* ) )
42+ .build/bootstrap-% .tar : $$(shell ./make_repo_sentinel $$(REPO ) $$(call gl_version ,$$* ) )
4243 target ' $@'
43- info ' bootstrapping $*-$(SHORT_COMMIT) '
44+ info ' bootstrapping $*'
4445 arch=' $(call cname_arch,$*)'
45- version=' $(call cname_version ,$*)'
46+ version=' $(call gl_version ,$*)'
4647 ./bootstrap " $$ arch" " $$ version" ' $(REPO)' keyring.gpg ' $@'
4748
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)
49+ .build/% .tar : .build/bootstrap-$$(call cname_arch,$$* ) -$$(call cname_gl_version ,$$* ) .tar $(shell ./make_directory_sentinel features) $(shell ./make_directory_sentinel cert)
4950 target ' $@' ' $<'
5051 info ' configuring rootfs $*-$(SHORT_COMMIT)'
51- features=" $$ (./parse_features --feature-dir features --cname '$* ' features)"
52- features_platforms=" $$ (./parse_features --feature-dir features --cname '$* ' platforms)"
53- features_elements=" $$ (./parse_features --feature-dir features --cname '$* ' elements)"
54- features_flags=" $$ (./parse_features --feature-dir features --cname '$* ' flags)"
52+ features=" $$ (gl-features-parse --feature-dir features --default-arch ' $$ (DEFAULT_ARCH)' --cname '$* ' features)"
53+ features_platforms=" $$ (gl-features-parse --feature-dir features --default-arch ' $$ (DEFAULT_ARCH)' -- cname '$* 'platforms)"
54+ features_elements=" $$ (gl-features-parse --feature-dir features --default-arch ' $$ (DEFAULT_ARCH)' -- cname '$* 'elements)"
55+ features_flags=" $$ (gl-features-parse --feature-dir features --default-arch ' $$ (DEFAULT_ARCH)' -- cname '$* 'flags)"
5556 BUILDER_CNAME=' $*'
56- BUILDER_VERSION=' $(call cname_version ,$*)'
57+ BUILDER_VERSION=' $(call gl_version ,$*)'
5758 BUILDER_ARCH=' $(call cname_arch,$*)'
5859 BUILDER_TIMESTAMP=' $(TIMESTAMP)'
5960 BUILDER_COMMIT=' $(COMMIT)'
@@ -65,17 +66,17 @@ clean:
6566 ./configure ' $(word 1,$^)' ' $@'
6667
6768define artifact_template =
68- .build/%- $( SHORT_COMMIT ) .$1: $$$$(shell COMMIT=$(SHORT_COMMIT ) ./make_get_image_dependencies '$$$$@ ') $$(shell ./make_directory_sentinel features) $$(shell ./make_directory_sentinel cert)
69+ .build/%.$1: $$$$(shell COMMIT=$(SHORT_COMMIT ) ./make_get_image_dependencies '$$$$@ ') $$(shell ./make_directory_sentinel features) $$(shell ./make_directory_sentinel cert)
6970 script='$$(word 1,$$^ ) '
7071 input='$$(word 2,$$^ ) '
7172 target '$$@ ' "$$$$input"
7273 info 'building $1 image $$* '
73- features="$$$$(./parse_features --feature-dir features --cname '$$* ' features ) "
74- features_platforms="$$$$(./parse_features --feature-dir features --cname '$$* ' platforms ) "
75- features_elements="$$$$(./parse_features --feature-dir features --cname '$$* ' elements ) "
76- features_flags="$$$$(./parse_features --feature-dir features --cname '$$* ' flags ) "
74+ features="$$$$(gl-features-parse --feature-dir features --default-arch ' $$( DEFAULT_ARCH ) ' --cname '$$* ' features ) "
75+ features_platforms="$$$$(gl-features-parse --feature-dir features --default-arch ' $$( DEFAULT_ARCH ) ' --cname '$$* ' platforms ) "
76+ features_elements="$$$$(gl-features-parse --feature-dir features --default-arch ' $$( DEFAULT_ARCH ) ' --cname '$$* ' elements ) "
77+ features_flags="$$$$(gl-features-parse --feature-dir features --default-arch ' $$( DEFAULT_ARCH ) ' --cname '$$* ' flags ) "
7778 BUILDER_CNAME='$$* '
78- BUILDER_VERSION='$$(call cname_version ,$$* ) '
79+ BUILDER_VERSION='$$(call gl_version ,$$* ) '
7980 BUILDER_ARCH='$$(call cname_arch,$$* ) '
8081 BUILDER_TIMESTAMP='$$(TIMESTAMP ) '
8182 BUILDER_COMMIT='$$(COMMIT ) '
@@ -89,15 +90,15 @@ endef
8990
9091$(foreach artifact_rule,$(shell ./make_get_artifact_rules),$(eval $(call artifact_template,$(artifact_rule))))
9192
92- .build/% - $( SHORT_COMMIT ) .artifacts : $$(shell COMMIT=$(SHORT_COMMIT ) ./make_list_build_artifacts '$$* ')
93+ .build/% .artifacts : $$(shell COMMIT=$(SHORT_COMMIT ) DEFAULT_VERSION= $( DEFAULT_VERSION ) NATIVE_ARCH= $( NATIVE_ARCH ) ./make_list_build_artifacts '$$* ')
9394 target ' $@'
9495 echo -n > ' $@'
9596 for f in $^; do
9697 basename " $$ f" | tee -a ' $@'
9798 echo " $$ (basename " $$ f" ).log" | tee -a ' $@'
9899 done
99100
100- % : .build/$$(shell ./parse_features --feature-dir features --default-arch '$$(DEFAULT_ARCH ) ' --default-version '$$(DEFAULT_VERSION ) ' --cname '$$* ') - $( SHORT_COMMIT ) .artifacts
101+ % : .build/$$(shell gl-features-parse --feature-dir features --default-arch '$$(DEFAULT_ARCH ) ' --default-version '$$(DEFAULT_VERSION ) - $$( SHORT_COMMIT ) ' --cname '$$* ') .artifacts
101102 ln -f -s -r ' $<' ' .build/$*'
102103
103104# prevents match anything rule from applying to Makefile and image/convert scripts
0 commit comments