summaryrefslogtreecommitdiff
path: root/util/nvidia/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/nvidia/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/nvidia/Makefile.mk')
-rw-r--r--util/nvidia/Makefile.mk60
1 files changed, 60 insertions, 0 deletions
diff --git a/util/nvidia/Makefile.mk b/util/nvidia/Makefile.mk
new file mode 100644
index 0000000000..04199d062e
--- /dev/null
+++ b/util/nvidia/Makefile.mk
@@ -0,0 +1,60 @@
+## SPDX-License-Identifier: GPL-2.0-only
+# copied from cbootimage/src/Makefile.am
+CBOOTIMAGE_RAW_SRCS:= \
+ cbootimage.c \
+ data_layout.c \
+ set.c \
+ crypto.c \
+ aes_ref.c \
+ context.c \
+ parse.c \
+ t210/parse_t210.c \
+ t132/parse_t132.c \
+ t124/parse_t124.c \
+ t114/parse_t114.c \
+ t30/parse_t30.c \
+ t20/parse_t20.c \
+ t210/nvbctlib_t210.c \
+ t132/nvbctlib_t132.c \
+ t124/nvbctlib_t124.c \
+ t114/nvbctlib_t114.c \
+ t30/nvbctlib_t30.c \
+ t20/nvbctlib_t20.c \
+ cbootimage.h \
+ context.h \
+ crypto.h \
+ data_layout.h \
+ nvaes_ref.h \
+ parse.h \
+ set.h \
+ t20/nvboot_bct_t20.h \
+ t20/nvboot_sdram_param_t20.h \
+ t30/nvboot_bct_t30.h \
+ t30/nvboot_sdram_param_t30.h \
+ t114/nvboot_bct_t114.h \
+ t114/nvboot_sdram_param_t114.h \
+ t124/nvboot_bct_t124.h \
+ t124/nvboot_sdram_param_t124.h \
+ t132/nvboot_bct_t132.h \
+ t132/nvboot_sdram_param_t132.h \
+ t210/nvboot_bct_t210.h \
+ t210/nvboot_sdram_param_t210.h
+
+CBOOTIMAGE_SRCS:=$(addprefix util/nvidia/cbootimage/src/,$(filter %.c,$(CBOOTIMAGE_RAW_SRCS)))
+CBOOTIMAGE_OBJS:=$(addprefix $(objutil)/nvidia/cbootimage/,$(patsubst %.c,%.o,$(filter %.c,$(CBOOTIMAGE_RAW_SRCS))))
+CBOOTIMAGE_FLAGS:=-Wall -std=c99 -O2
+
+ifeq ($(OS_ARCH), FreeBSD)
+CBOOTIMAGE_FLAGS:=-DENODATA=ENOATTR
+endif
+
+additional-dirs += $(sort $(dir $(CBOOTIMAGE_OBJS)))
+
+$(objutil)/nvidia/cbootimage/%.o: util/nvidia/cbootimage/src/%.c
+ printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
+ $(HOSTCC) $(CBOOTIMAGE_FLAGS) -c -o $@ $<
+
+$(CBOOTIMAGE): $(CBOOTIMAGE_OBJS)
+ printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
+ $(HOSTCC) $(CBOOTIMAGE_FLAGS) -o $@.tmp $^ -lm
+ mv $@.tmp $@