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