@@ -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
@@ -24,11 +25,13 @@ endef
2425required_vars := REPO COMMIT TIMESTAMP DEFAULT_VERSION TEMPFS_SIZE
2526$(foreach var,$(required_vars),$(eval $(call require_var,$(var))))
2627
27- PARSE_FEATURES_ARGS :=
28+ GL_ALLOW_FRANKENSTEIN :=
2829ifdef ALLOW_FRANKENSTEIN
29- PARSE_FEATURES_ARGS := --allow-frankenstein
30+ GL_ALLOW_FRANKENSTEIN := true
3031endif
3132
33+ export GL_ALLOW_FRANKENSTEIN
34+
3235SHORT_COMMIT := $(shell head -c 8 <<< '$(COMMIT ) ')
3336
3437DEFAULT_ARCH := $(shell dpkg --print-architecture)
@@ -43,22 +46,22 @@ clean:
4346.build/% .sentinel :
4447 true
4548
46- .build/bootstrap-% - $( SHORT_COMMIT ) .tar : $$(shell ./make_repo_sentinel $$(REPO ) $$(call cname_version ,$$* ) )
49+ .build/bootstrap-% .tar : $$(shell ./make_repo_sentinel $$(REPO ) $$(call gl_version ,$$* ) )
4750 target ' $@'
48- info ' bootstrapping $*-$(SHORT_COMMIT) '
51+ info ' bootstrapping $*'
4952 arch=' $(call cname_arch,$*)'
50- version=' $(call cname_version ,$*)'
53+ version=' $(call gl_version ,$*)'
5154 ./bootstrap " $$ arch" " $$ version" ' $(REPO)' keyring.gpg ' $@'
5255
53- .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)
56+ .build/% .tar : .build/bootstrap-$$(call cname_arch,$$* ) -$$(call cname_gl_version ,$$* ) .tar $(shell ./make_directory_sentinel features) $(shell ./make_directory_sentinel cert)
5457 target ' $@' ' $<'
5558 info ' configuring rootfs $*-$(SHORT_COMMIT)'
56- features=" $$ (./parse_features $( PARSE_FEATURES_ARGS ) --feature-dir features --cname '$* ' features)"
57- features_platforms=" $$ (./parse_features $( PARSE_FEATURES_ARGS ) --feature-dir features --cname '$* ' platforms)"
58- features_elements=" $$ (./parse_features $( PARSE_FEATURES_ARGS ) --feature-dir features --cname '$* ' elements)"
59- features_flags=" $$ (./parse_features $( PARSE_FEATURES_ARGS ) --feature-dir features --cname '$* ' flags)"
59+ features=" $$ (gl-features-parse --feature-dir features --default-arch ' $$ (DEFAULT_ARCH)' --cname '$* ' features)"
60+ features_platforms=" $$ (gl-features-parse --feature-dir features --default-arch ' $$ (DEFAULT_ARCH)' -- cname '$* 'platforms)"
61+ features_elements=" $$ (gl-features-parse --feature-dir features --default-arch ' $$ (DEFAULT_ARCH)' -- cname '$* 'elements)"
62+ features_flags=" $$ (gl-features-parse --feature-dir features --default-arch ' $$ (DEFAULT_ARCH)' -- cname '$* 'flags)"
6063 BUILDER_CNAME=' $*'
61- BUILDER_VERSION=' $(call cname_version ,$*)'
64+ BUILDER_VERSION=' $(call gl_version ,$*)'
6265 BUILDER_ARCH=' $(call cname_arch,$*)'
6366 BUILDER_TIMESTAMP=' $(TIMESTAMP)'
6467 BUILDER_COMMIT=' $(COMMIT)'
@@ -70,17 +73,17 @@ clean:
7073 ./configure ' $(word 1,$^)' ' $@'
7174
7275define artifact_template =
73- .build/%- $( SHORT_COMMIT ) .$1: $$$$(shell COMMIT=$(SHORT_COMMIT ) ./make_get_image_dependencies '$$$$@ ') $$(shell ./make_directory_sentinel features) $$(shell ./make_directory_sentinel cert)
76+ .build/%.$1: $$$$(shell COMMIT=$(SHORT_COMMIT ) ./make_get_image_dependencies '$$$$@ ') $$(shell ./make_directory_sentinel features) $$(shell ./make_directory_sentinel cert)
7477 script='$$(word 1,$$^ ) '
7578 input='$$(word 2,$$^ ) '
7679 target '$$@ ' "$$$$input"
7780 info 'building $1 image $$* '
78- features="$$$$(./parse_features $( PARSE_FEATURES_ARGS ) --feature-dir features --cname '$$* ' features ) "
79- features_platforms="$$$$(./parse_features $( PARSE_FEATURES_ARGS ) --feature-dir features --cname '$$* ' platforms ) "
80- features_elements="$$$$(./parse_features $( PARSE_FEATURES_ARGS ) --feature-dir features --cname '$$* ' elements ) "
81- features_flags="$$$$(./parse_features $( PARSE_FEATURES_ARGS ) --feature-dir features --cname '$$* ' flags ) "
81+ features="$$$$(gl-features-parse --feature-dir features --default-arch ' $$( DEFAULT_ARCH ) ' --cname '$$* ' features ) "
82+ features_platforms="$$$$(gl-features-parse --feature-dir features --default-arch ' $$( DEFAULT_ARCH ) ' --cname '$$* ' platforms ) "
83+ features_elements="$$$$(gl-features-parse --feature-dir features --default-arch ' $$( DEFAULT_ARCH ) ' --cname '$$* ' elements ) "
84+ features_flags="$$$$(gl-features-parse --feature-dir features --default-arch ' $$( DEFAULT_ARCH ) ' --cname '$$* ' flags ) "
8285 BUILDER_CNAME='$$* '
83- BUILDER_VERSION='$$(call cname_version ,$$* ) '
86+ BUILDER_VERSION='$$(call gl_version ,$$* ) '
8487 BUILDER_ARCH='$$(call cname_arch,$$* ) '
8588 BUILDER_TIMESTAMP='$$(TIMESTAMP ) '
8689 BUILDER_COMMIT='$$(COMMIT ) '
@@ -94,15 +97,15 @@ endef
9497
9598$(foreach artifact_rule,$(shell ./make_get_artifact_rules),$(eval $(call artifact_template,$(artifact_rule))))
9699
97- .build/% - $( SHORT_COMMIT ) .artifacts : $$(shell COMMIT=$(SHORT_COMMIT ) ./make_list_build_artifacts '$$* ')
100+ .build/% .artifacts : $$(shell COMMIT=$(SHORT_COMMIT ) DEFAULT_VERSION= $( DEFAULT_VERSION ) NATIVE_ARCH= $( NATIVE_ARCH ) ./make_list_build_artifacts '$$* ')
98101 target ' $@'
99102 echo -n > ' $@'
100103 for f in $^; do
101104 basename " $$ f" | tee -a ' $@'
102105 echo " $$ (basename " $$ f" ).log" | tee -a ' $@'
103106 done
104107
105- % : .build/$$(shell ./parse_features $( PARSE_FEATURES_ARGS ) --feature-dir features --default-arch '$$(DEFAULT_ARCH ) ' --default-version '$$(DEFAULT_VERSION ) ' --cname '$$* ') - $( SHORT_COMMIT ) .artifacts
108+ % : .build/$$(shell gl-features-parse --feature-dir features --default-arch '$$(DEFAULT_ARCH ) ' --default-version '$$(DEFAULT_VERSION ) - $$( SHORT_COMMIT ) ' --cname '$$* ') .artifacts
106109 ln -f -s -r ' $<' ' .build/$*'
107110
108111# prevents match anything rule from applying to Makefile and image/convert scripts
0 commit comments