Makefile: Don't double version number in patches for versioned modules

Default the patch version to empty if the module name already includes
the version.  Fixes application of coreboot patches.

Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
This commit is contained in:
Jonathon Hall 2023-08-11 10:02:03 -04:00
parent 1b81fb2d80
commit c12b8cec4b
No known key found for this signature in database
GPG Key ID: 1E9C3CA91AE25114

View File

@ -330,8 +330,11 @@ define define_module =
touch "$(build)/$($1_base_dir)/.patched"; \
fi
else
$(eval $1_patch_version ?= $($1_version))
$(eval $1_patch_name = $1-$($1_patch_version))
# Versioned modules (each version a separate module) don't need to include
# the version a second time. (The '-' separator is also omitted then.)
# $1_patch_version can still be defined manually.
$(eval $1_patch_version ?= $(if $(filter %-$($1_version),$1),,$($1_version)))
$(eval $1_patch_name = $1$(if $($1_patch_version),-,)$($1_patch_version))
# Fetch and verify the source tar file
# wget creates it early, so we have to cleanup if it fails
$(packages)/$($1_tar):