summaryrefslogtreecommitdiff
path: root/util/amdfwtool/Makefile.mk
diff options
context:
space:
mode:
authorMartin Roth <gaumless@gmail.com>2024-01-18 18:46:58 -0700
committerFelix Singer <service+coreboot-gerrit@felixsinger.de>2024-01-26 12:43:18 +0000
commit1f30b244b296a131f4eaf95962bab048f8b3d481 (patch)
tree390c0dd1e31cd11ce4f2b664445f445d1f1f8996 /util/amdfwtool/Makefile.mk
parentba3a71966876aad1c720d7c385dd4058f844f5e8 (diff)
util: Rename Makefiles from .inc to .mk
The .inc suffix is confusing to various tools as it's not specific to Makefiles. This means that editors don't recognize the files, and don't open them with highlighting and any other specific editor functionality. This issue is also seen in the release notes generation script where Makefiles get renamed before running cloc. Signed-off-by: Martin Roth <gaumless@gmail.com> Change-Id: I434940ebb46853980596f7ad55d27a62c90280fa Reviewed-on: https://review.coreboot.org/c/coreboot/+/80123 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'util/amdfwtool/Makefile.mk')
-rw-r--r--util/amdfwtool/Makefile.mk27
1 files changed, 27 insertions, 0 deletions
diff --git a/util/amdfwtool/Makefile.mk b/util/amdfwtool/Makefile.mk
new file mode 100644
index 0000000000..6a83cb9265
--- /dev/null
+++ b/util/amdfwtool/Makefile.mk
@@ -0,0 +1,27 @@
+# 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 $@