# Using STAGE1_foo_$(flavor) variables is a bit awkward, so forward
# them to something simpler.

S1_RF_COPY_SO_DEPS := $(STAGE1_COPY_SO_DEPS_$(S1_RF_FLAVOR))
S1_RF_USR_STAMPS := $(STAGE1_USR_STAMPS_$(S1_RF_FLAVOR))
S1_RF_SECONDARY_STAMPS := $(STAGE1_SECONDARY_STAMPS_$(S1_RF_FLAVOR))
S1_RF_ACIDIR := $(STAGE1_ACIDIR_$(S1_RF_FLAVOR))
S1_RF_ACIROOTFSDIR := $(STAGE1_ACIROOTFSDIR_$(S1_RF_FLAVOR))
S1_RF_INSTALL_FILES := $(STAGE1_INSTALL_FILES_$(S1_RF_FLAVOR))
S1_RF_INSTALL_SYMLINKS := $(STAGE1_INSTALL_SYMLINKS_$(S1_RF_FLAVOR))
S1_RF_INSTALL_DIRS := $(STAGE1_INSTALL_DIRS_$(S1_RF_FLAVOR))
S1_RF_CREATE_DIRS := $(STAGE1_CREATE_DIRS_$(S1_RF_FLAVOR))

_S1_RF_NAME_ := usr_from_$(S1_RF_FLAVOR)

INSTALL_DIRS += \
	$(S1_RF_ACIDIR):- \
	$(S1_RF_ACIROOTFSDIR):0755

$(call inc-one,$(_S1_RF_NAME_)/$(_S1_RF_NAME_).mk)

# Propagate the changes. Note that not all variables can be overridden
# - ACIDIR, ACIROOTFSDIR and so on are "read-only".
STAGE1_COPY_SO_DEPS_$(S1_RF_FLAVOR) := $(S1_RF_COPY_SO_DEPS)
STAGE1_USR_STAMPS_$(S1_RF_FLAVOR) := $(S1_RF_USR_STAMPS)
STAGE1_SECONDARY_STAMPS_$(S1_RF_FLAVOR) := $(S1_RF_SECONDARY_STAMPS)
STAGE1_INSTALL_FILES_$(S1_RF_FLAVOR) := $(S1_RF_INSTALL_FILES)
STAGE1_INSTALL_SYMLINKS_$(S1_RF_FLAVOR) := $(S1_RF_INSTALL_SYMLINKS)
STAGE1_INSTALL_DIRS_$(S1_RF_FLAVOR) := $(S1_RF_INSTALL_DIRS)
STAGE1_CREATE_DIRS_$(S1_RF_FLAVOR) := $(S1_RF_CREATE_DIRS)

$(call undefine-namespaces,S1_RF _S1_RF)
