avoid setting GLOBAL_* altogether

Applying set() and only set() to a GLOBAL_* is safe
but still a potentially confusing example; so let's
just do it right (and warn unsuspecting folks too).
This commit is contained in:
Michael Shigorin 2011-09-13 23:51:22 +03:00
parent 75fd795210
commit 5d37a0c54d
3 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,7 @@
# - remember .base if adding yet another *_PACKAGES
use/bootloader: use/install2 sub/main
@$(call add,BASE_PACKAGES,alterator-$$(GLOBAL_BASE_BOOTLOADER))
@$(call add,BASE_PACKAGES,alterator-$$(BASE_BOOTLOADER))
use/bootloader/grub use/bootloader/lilo: use/bootloader/%: use/bootloader
@$(call set,GLOBAL_BASE_BOOTLOADER,$*)
@$(call set,BASE_BOOTLOADER,$*)

View File

@ -8,6 +8,9 @@ MKI_PACK_RESULTS = squash:altinst
# also removed in a cleanup hook but to spare a few cycles...
HSH_EXCLUDE_DOCS = 1
# pass downstream
GLOBAL_BASE_BOOTLOADER := $(BASE_BOOTLOADER)
debug:
@echo "** install2: IMAGE_PACKAGES: $(IMAGE_PACKAGES)"
@echo "** install2: IMAGE_PACKAGES_REGEXP: $(IMAGE_PACKAGES_REGEXP)"

View File

@ -15,6 +15,7 @@ endef
# add() just appends an additive rule...
add = $(and $(1),$(2),$(add_body))
define add_body
$(if $(filter GLOBAL_% INFO_%,$(1)),$(warning add,$(1) might be a problem)) \
{ $(log_body); \
printf '%s += %s\n' '$(1)' '$(2)' >> "$(CONFIG)"; }
endef