ff63106dec
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> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78191 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
27 lines
1 KiB
Makefile
27 lines
1 KiB
Makefile
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
amdfwtoolobj = amdfwtool.o data_parse.o signed_psp.o handle_file.o
|
|
amdfwreadobj = amdfwread.o
|
|
|
|
AMDFWTOOLCFLAGS :=-O2 -Wall -Wextra -Wshadow -Werror
|
|
AMDFWTOOLCFLAGS += -I $(top)/src/commonlib/bsd/include
|
|
AMDFWTOOLCFLAGS += -D_GNU_SOURCE # memmem() from string.h
|
|
|
|
HOSTPKGCONFIG ?= pkg-config
|
|
|
|
AMDFWTOOLCFLAGS += $(shell $(HOSTPKGCONFIG) --cflags libcrypto)
|
|
ifneq ($(.SHELLSTATUS),0)
|
|
$(error "Ensure that pkg-config is installed.")
|
|
endif
|
|
LDFLAGS += $(shell $(HOSTPKGCONFIG) --libs libcrypto)
|
|
|
|
$(objutil)/amdfwtool/%.o: $(top)/util/amdfwtool/%.c # $(HEADER)
|
|
$(HOSTCC) $(AMDFWTOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
|
|
|
$(objutil)/amdfwtool/amdfwtool: $(addprefix $(objutil)/amdfwtool/,$(amdfwtoolobj))
|
|
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 $@
|