diff options
author | Yann E. MORIN <yann.morin.1998@free.fr> | 2018-03-31 11:05:51 +0200 |
---|---|---|
committer | Peter Korsgaard <peter@korsgaard.com> | 2018-03-31 20:52:52 +0200 |
commit | 2765973e01b386131d9f2ebb8a89a403a381d5e7 (patch) | |
tree | 73c6aaef0ff941ac7e0b1fce2c17b4536eeaad67 | |
parent | 7e9870ce32d6329d9e3d602247fbe1709a2275a4 (diff) | |
download | buildroot-2765973e01b386131d9f2ebb8a89a403a381d5e7.tar.gz buildroot-2765973e01b386131d9f2ebb8a89a403a381d5e7.zip |
fs: set per-rootfs variable name
Like we do for packages with the PKG variable, set ROOTFS to contain the
upper-case name of the rootfs currently being generated.
This will be useful in later patches, when we need more per-rootfs
variables, like a per-rootfs TARGET_DIR for example.
In Makefiles, per-rule variables trickle down the dependency chain, to
all dependencies of that rule, so we have to stop ROOTFS as soon as
we're not in a rootfs. This means we have to stop it at target-finalize
(which is a dependency of all filesystems), and for each package
individually, since some packages (host or target) can be direct
dependencies of filesystems as well.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | fs/common.mk | 1 | ||||
-rw-r--r-- | package/pkg-generic.mk | 4 |
3 files changed, 8 insertions, 0 deletions
@@ -677,6 +677,9 @@ endif $(TARGETS_ROOTFS): target-finalize +# Avoid the rootfs name leaking down the dependency chain +target-finalize: ROOTFS= + .PHONY: target-finalize target-finalize: $(PACKAGES) @$(call MESSAGE,"Finalizing target directory") diff --git a/fs/common.mk b/fs/common.mk index 274a3e9c7b..19a975aa47 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -72,6 +72,7 @@ ROOTFS_$(2)_COMPRESS_EXT = .xz ROOTFS_$(2)_COMPRESS_CMD = xz -9 -C crc32 -c endif +$$(BINARIES_DIR)/rootfs.$(1): ROOTFS=$(2) $$(BINARIES_DIR)/rootfs.$(1): target-finalize $$(ROOTFS_$(2)_DEPENDENCIES) @$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)") rm -rf $(FS_DIR) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 6d82f7027e..152e1d0c67 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -384,6 +384,10 @@ endef define inner-generic-package +# When doing a package, we're definitely not doing a rootfs, but we +# may inherit it via the dependency chain, so we reset it. +$(1): ROOTFS= + # Ensure the package is only declared once, i.e. do not accept that a # package be re-defined by a br2-external tree ifneq ($(call strip,$(filter $(1),$(PACKAGES_ALL))),) |