From dfa1a8d4cfbf58a4820a8881ad53c77f09bad7d9 Mon Sep 17 00:00:00 2001 From: Alex Brown Date: Tue, 9 Jul 2024 10:53:47 +1000 Subject: [PATCH] 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..7e2391688 --- /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 RX and TX virtualisers +# 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: virt.o + $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ + +virt.o: ${CHECK_BLK_FLAGS_MD5} +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 virt.d