| 1 |
|
| 2 |
|
| 3 |
ifneq ($(BUILD_ALL_TOOLS)$(CONFIG_USE_AMDFWTOOL),) |
| 4 |
|
| 5 |
amdfwtoolobj = amdfwtool.o data_parse.o signed_psp.o handle_file.o opts.o |
| 6 |
amdfwreadobj = amdfwread.o |
| 7 |
amdfwheader = amdfwtool.h |
| 8 |
|
| 9 |
WERROR ?= -Werror |
| 10 |
AMDFWTOOLCFLAGS :=-O2 -Wall -Wextra -Wshadow $(WERROR) |
| 11 |
AMDFWTOOLCFLAGS += -I $(top)/src/commonlib/bsd/include |
| 12 |
AMDFWTOOLCFLAGS += -D_GNU_SOURCE # memmem() from string.h |
| 13 |
|
| 14 |
ifneq ($(PKG_CONFIG),) |
| 15 |
HOSTPKGCONFIG ?= $(PKG_CONFIG) |
| 16 |
else |
| 17 |
HOSTPKGCONFIG ?= pkg-config |
| 18 |
endif |
| 19 |
|
| 20 |
AMDFWTOOLCFLAGS += $(shell $(HOSTPKGCONFIG) --cflags libcrypto) |
| 21 |
ifneq ($(.SHELLSTATUS),0) |
| 22 |
$(error "Ensure that pkg-config is installed.") |
| 23 |
endif |
| 24 |
LDFLAGS += $(shell $(HOSTPKGCONFIG) --libs libcrypto) |
| 25 |
|
| 26 |
$(objutil)/amdfwtool/%.o: $(top)/util/amdfwtool/%.c $(dir)/$(amdfwheader) |
| 27 |
printf " AMDFW $@\n" |
| 28 |
$(HOSTCC) $(AMDFWTOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< |
| 29 |
|
| 30 |
$(objutil)/amdfwtool/amdfwtool: $(addprefix $(objutil)/amdfwtool/,$(amdfwtoolobj)) $(dir)/$(amdfwheader) |
| 31 |
printf " AMDFWTOOL $@\n" |
| 32 |
$(HOSTCC) $(addprefix $(objutil)/amdfwtool/,$(amdfwtoolobj)) $(LDFLAGS) -o $@ |
| 33 |
|
| 34 |
$(objutil)/amdfwtool/amdfwread: $(addprefix $(objutil)/amdfwtool/,$(amdfwreadobj)) $(dir)/$(amdfwheader) |
| 35 |
printf " AMDFWREAD $@\n" |
| 36 |
$(HOSTCC) $(addprefix $(objutil)/amdfwtool/,$(amdfwreadobj)) $(LDFLAGS) -o $@ |
| 37 |
|
| 38 |
endif # ifneq ($(BUILD_ALL_TOOLS)$(CONFIG_USE_AMDFWTOOL),) |