]> git.proxmox.com Git - efi-boot-shim.git/blame - Make.rules
Update upstream source from tag 'upstream/15.4'
[efi-boot-shim.git] / Make.rules
CommitLineData
f892ac66
MTL
1define get-config
2$(shell git config --local --get "shim.$(1)")
3endef
031e5cce
SM
4
5define add-vendor-sbat
6$(OBJCOPY) --add-section ".$(patsubst %.csv,%,$(1))=$(1)" $(2)
7
8endef
9
10# true if the strings are the same
11define str-eq
12$(if $(subst $(1),,$(2)),,$(1))
13endef
14
15# true if 1 is in 2
16define has-flag
17$(if $(findstring $(space)$(1)$(space),$(space)$(2)$(space)),$(1))
18endef
19
20# true if 1 is not in 2
21define has-not-flag
22$(if $(call has-flag,$(1),$(2)),,$(1))
23endef
24
25# if 1 is set and 2 isn't in the thing named by 3,
26# add 4 to the thing named by 3
27define conditional-add-flag
28$(if $(and $(strip $(1)),$(strip $(call has-not-flag,$(2),$($(3))))),$(eval override $(value 3) += $(4)))
29endef
30
31# Add everything from DEFAULT_$(1) to $(1) if it isn't there (in whole)
32define update-variable
33$(strip $(foreach x,$(DEFAULT_$(1)),
34 $(if $(call has-flag,$(x),$($(1))),,
35 $(eval override $(1)+=$(x)))))
36endef
37
38# vim:filetype=make