2020-09-29 11:32:36 +02:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
2023-03-22 05:50:36 +01:00
|
|
|
amdfwtoolobj = amdfwtool.o data_parse.o signed_psp.o handle_file.o
|
2022-08-17 01:30:06 +02:00
|
|
|
amdfwreadobj = amdfwread.o
|
2020-09-29 11:32:36 +02:00
|
|
|
|
2023-09-29 19:35:22 +02:00
|
|
|
AMDFWTOOLCFLAGS :=-O2 -Wall -Wextra -Wshadow -Werror
|
2022-09-06 22:02:41 +02:00
|
|
|
AMDFWTOOLCFLAGS += -I $(top)/src/commonlib/bsd/include
|
2023-07-14 01:24:13 +02:00
|
|
|
AMDFWTOOLCFLAGS += -D_GNU_SOURCE # memmem() from string.h
|
2020-09-29 11:32:36 +02:00
|
|
|
|
2021-12-21 05:45:06 +01:00
|
|
|
HOSTPKGCONFIG ?= pkg-config
|
|
|
|
|
|
|
|
AMDFWTOOLCFLAGS += $(shell $(HOSTPKGCONFIG) --cflags libcrypto)
|
2023-09-29 19:35:22 +02:00
|
|
|
ifneq ($(.SHELLSTATUS),0)
|
|
|
|
$(error "Ensure that pkg-config is installed.")
|
|
|
|
endif
|
2021-12-21 05:45:06 +01:00
|
|
|
LDFLAGS += $(shell $(HOSTPKGCONFIG) --libs libcrypto)
|
|
|
|
|
2020-09-29 11:32:36 +02:00
|
|
|
$(objutil)/amdfwtool/%.o: $(top)/util/amdfwtool/%.c # $(HEADER)
|
2020-09-28 04:36:29 +02:00
|
|
|
$(HOSTCC) $(AMDFWTOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
2020-09-29 11:32:36 +02:00
|
|
|
|
|
|
|
$(objutil)/amdfwtool/amdfwtool: $(addprefix $(objutil)/amdfwtool/,$(amdfwtoolobj))
|
|
|
|
printf " AMDFWTOOL\n"
|
2021-12-21 05:45:06 +01:00
|
|
|
$(HOSTCC) $(addprefix $(objutil)/amdfwtool/,$(amdfwtoolobj)) $(LDFLAGS) -o $@
|
2022-08-17 01:30:06 +02:00
|
|
|
|
|
|
|
$(objutil)/amdfwtool/amdfwread: $(addprefix $(objutil)/amdfwtool/,$(amdfwreadobj))
|
|
|
|
printf " AMDFWREAD\n"
|
|
|
|
$(HOSTCC) $(addprefix $(objutil)/amdfwtool/,$(amdfwreadobj)) $(LDFLAGS) -o $@
|