5b84dfd1c1
Generate SHA256/SHA384 hash of the signed firmware so that PSP verstage can pass it to PSP. The PSP will use these hashes to verify the integrity of those signed firmwares. BUG=b:203597980 TEST=Build Skyrim BIOS image. Change-Id: I50d278536ba1eac754eb8a39c4c2e428a2371c44 Signed-off-by: Kangheui Won <khwon@chromium.org> Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/60290 Reviewed-by: Jon Murphy <jpmurphy@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
50 lines
1.1 KiB
Makefile
50 lines
1.1 KiB
Makefile
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
top ?= $(abspath ../..)
|
|
ifneq ($(CC),)
|
|
HOSTCC ?= $(CC)
|
|
else
|
|
HOSTCC ?= cc
|
|
endif
|
|
|
|
READ_SRC = amdfwread.c
|
|
READ_OBJ = $(READ_SRC:%.c=%.o)
|
|
TOOL_SRC = amdfwtool.c data_parse.c
|
|
TOOL_OBJ = $(TOOL_SRC:%.c=%.o)
|
|
HEADER=amdfwtool.h
|
|
TARGETS = amdfwread amdfwtool
|
|
WERROR=-Werror
|
|
CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR}
|
|
CFLAGS += -I $(top)/src/commonlib/bsd/include
|
|
|
|
ifneq ($(PKG_CONFIG),)
|
|
HOSTPKGCONFIG ?= $(PKG_CONFIG)
|
|
else
|
|
HOSTPKGCONFIG ?= pkg-config
|
|
endif
|
|
CFLAGS += $(shell $(HOSTPKGCONFIG) --cflags libcrypto)
|
|
LDFLAGS += $(shell $(HOSTPKGCONFIG) --libs libcrypto)
|
|
|
|
all: $(TARGETS)
|
|
|
|
amdfwread: $(READ_OBJ)
|
|
$(HOSTCC) $(READ_OBJ) $(LDFLAGS) -o $@
|
|
|
|
amdfwtool: $(TOOL_OBJ)
|
|
$(HOSTCC) $(TOOL_OBJ) $(LDFLAGS) -o $@
|
|
|
|
%.o: %.c $(HEADER)
|
|
$(HOSTCC) $(CFLAGS) -c -o $@ $<
|
|
|
|
clean:
|
|
@rm -f $(TARGETS) $(READ_OBJ) $(TOOL_OBJ)
|
|
|
|
distclean: clean
|
|
|
|
help:
|
|
@echo "${TARGETS}: Tools to create and read from AMD firmware combinations"
|
|
@echo "Targets: all, clean, distclean, help"
|
|
@echo "To disable warnings as errors, run make as:"
|
|
@echo " make all WERROR=\"\""
|
|
|
|
.PHONY: all clean distclean help
|