Karthik Ramasubramanian has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/78191?usp=email )
Change subject: util/amdfwtool: Check for pkg-config presence ......................................................................
util/amdfwtool: Check for pkg-config presence
Check for pkg-config presence and fail out with actionable message.
BUG=b:302521446 TEST=Build successfully with working pkg-config and failed build with no pkg-config
Change-Id: I5d604145c919e7f71680d1e095dc68cb21868319 Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com --- M util/amdfwtool/Makefile M util/amdfwtool/Makefile.inc 2 files changed, 11 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/78191/1
diff --git a/util/amdfwtool/Makefile b/util/amdfwtool/Makefile index e9bc1ab..145ab81 100644 --- a/util/amdfwtool/Makefile +++ b/util/amdfwtool/Makefile @@ -31,7 +31,7 @@ amdfwread: $(READ_OBJ) $(HOSTCC) $(READ_OBJ) $(LDFLAGS) -o $@
-amdfwtool: $(TOOL_OBJ) +amdfwtool: $(TOOL_OBJ) check-pkg-config-presence $(HOSTCC) $(TOOL_OBJ) $(LDFLAGS) -o $@
%.o: %.c $(HEADER) @@ -48,4 +48,7 @@ @echo "To disable warnings as errors, run make as:" @echo " make all WERROR="""
-.PHONY: all clean distclean help +check-pkg-config-presence: + @type $(HOSTPKGCONFIG) >/dev/null 2>&1 || (echo "Error: Ensure that pkg-config is installed."; exit 1) + +.PHONY: all clean distclean help check-pkg-config-presence diff --git a/util/amdfwtool/Makefile.inc b/util/amdfwtool/Makefile.inc index 067a137..e8568b3 100644 --- a/util/amdfwtool/Makefile.inc +++ b/util/amdfwtool/Makefile.inc @@ -12,13 +12,17 @@ AMDFWTOOLCFLAGS += $(shell $(HOSTPKGCONFIG) --cflags libcrypto) LDFLAGS += $(shell $(HOSTPKGCONFIG) --libs libcrypto)
-$(objutil)/amdfwtool/%.o: $(top)/util/amdfwtool/%.c # $(HEADER) +$(objutil)/amdfwtool/%.o: $(top)/util/amdfwtool/%.c check-pkg-config-presence # $(HEADER) $(HOSTCC) $(AMDFWTOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
-$(objutil)/amdfwtool/amdfwtool: $(addprefix $(objutil)/amdfwtool/,$(amdfwtoolobj)) +$(objutil)/amdfwtool/amdfwtool: $(addprefix $(objutil)/amdfwtool/,$(amdfwtoolobj)) check-pkg-config-presence printf " AMDFWTOOL\n" $(HOSTCC) $(addprefix $(objutil)/amdfwtool/,$(amdfwtoolobj)) $(LDFLAGS) -o $@
$(objutil)/amdfwtool/amdfwread: $(addprefix $(objutil)/amdfwtool/,$(amdfwreadobj)) printf " AMDFWREAD\n" $(HOSTCC) $(addprefix $(objutil)/amdfwtool/,$(amdfwreadobj)) $(LDFLAGS) -o $@ + +.PHONY: check-pkg-config-presence +check-pkg-config-presence: + @type $(HOSTPKGCONFIG) >/dev/null 2>&1 || (echo "Error: Ensure that pkg-config is installed."; exit 1)