From 891032d31c0a366323a4f7ae8f45f2b2583e41ed Mon Sep 17 00:00:00 2001 From: Alex Brown Date: Tue, 9 Jul 2024 10:53:47 +1000 Subject: [PATCH 1/3] blk: add makefile snippet Signed-off-by: Alex Brown --- blk/components/blk_components.mk | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 blk/components/blk_components.mk diff --git a/blk/components/blk_components.mk b/blk/components/blk_components.mk new file mode 100644 index 000000000..6e4f8ca1d --- /dev/null +++ b/blk/components/blk_components.mk @@ -0,0 +1,39 @@ +# +# Copyright 2024, UNSW +# +# SPDX-License-Identifier: BSD-2-Clause +# +# This Makefile snippet builds the blk virtualiser +# it should be included into your project Makefile +# +# NOTES: +# Generates blk_virt.elf +# + + +BLK_IMAGES := blk_virt.elf + +CFLAGS_blk := -I ${SDDF}/include + +CHECK_BLK_FLAGS_MD5:=.blk_cflags-$(shell echo -- ${CFLAGS} ${CFLAGS_blk} | shasum | sed 's/ *-//') + +${CHECK_BLK_FLAGS_MD5}: + -rm -f .blk_cflags-* + touch $@ + + +blk_virt.elf: blk_virt.o + $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ + +blk_virt.o: ${CHECK_BLK_FLAGS_MD5} +blk_virt.o: ${SDDF}/blk/components/virt.c + ${CC} ${CFLAGS} ${CFLAGS_blk} -o $@ -c $< + +clean:: + rm -f blk_virt.[od] .blk_cflags-* + +clobber:: + rm -f ${BLK_IMAGES} + + +-include blk_virt.d From 82b943a2937779bda72b12536063075091e1144a Mon Sep 17 00:00:00 2001 From: Alex Brown Date: Mon, 22 Jul 2024 09:33:38 +1000 Subject: [PATCH 2/3] blk_components.mk: remove sDDF from blk cflags (From Peter): We shouldn't need to include sDDF in the individual makefile snippets as it is a requirement for all of them. It can be included in the top-level Makefile. Signed-off-by: Alex Brown --- blk/components/blk_components.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blk/components/blk_components.mk b/blk/components/blk_components.mk index 6e4f8ca1d..9a4ad7cd9 100644 --- a/blk/components/blk_components.mk +++ b/blk/components/blk_components.mk @@ -13,7 +13,7 @@ BLK_IMAGES := blk_virt.elf -CFLAGS_blk := -I ${SDDF}/include +CFLAGS_blk := CHECK_BLK_FLAGS_MD5:=.blk_cflags-$(shell echo -- ${CFLAGS} ${CFLAGS_blk} | shasum | sed 's/ *-//') From cc16cb9e1291b181e5d2a14c2e1c0c33b88f2a0f Mon Sep 17 00:00:00 2001 From: Alex Brown Date: Mon, 22 Jul 2024 13:20:32 +1000 Subject: [PATCH 3/3] blk_components.mk: change := to ?= Signed-off-by: Alex Brown --- blk/components/blk_components.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blk/components/blk_components.mk b/blk/components/blk_components.mk index 9a4ad7cd9..06b970437 100644 --- a/blk/components/blk_components.mk +++ b/blk/components/blk_components.mk @@ -13,7 +13,7 @@ BLK_IMAGES := blk_virt.elf -CFLAGS_blk := +CFLAGS_blk ?= CHECK_BLK_FLAGS_MD5:=.blk_cflags-$(shell echo -- ${CFLAGS} ${CFLAGS_blk} | shasum | sed 's/ *-//')