From 6dff3cbbaaeca418c77691c45048a385a546332b Mon Sep 17 00:00:00 2001 From: Jue Date: Tue, 29 Mar 2022 18:17:08 +0200 Subject: [PATCH] pkg/littlefs2: allow VFS/MTD driver opt-out This aligns Makefile-based and Kconfig-based dependency resolution. --- pkg/littlefs2/Makefile.dep | 10 +++++++--- pkg/littlefs2/Makefile.include | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pkg/littlefs2/Makefile.dep b/pkg/littlefs2/Makefile.dep index 46de66a114..f0202d4006 100644 --- a/pkg/littlefs2/Makefile.dep +++ b/pkg/littlefs2/Makefile.dep @@ -1,5 +1,9 @@ -USEMODULE += vfs -USEMODULE += littlefs2_fs -USEMODULE += mtd +DEFAULT_MODULE += littlefs2_fs + +# require littlefs2_fs dependencies if this module isn't disabled +ifeq (,$(filter littlefs2_fs,$(DISABLE_MODULE))) + USEMODULE += vfs + USEMODULE += mtd +endif FEATURES_BLACKLIST += arch_msp430 diff --git a/pkg/littlefs2/Makefile.include b/pkg/littlefs2/Makefile.include index f7398fb4ef..51511c6d2f 100644 --- a/pkg/littlefs2/Makefile.include +++ b/pkg/littlefs2/Makefile.include @@ -1,6 +1,8 @@ INCLUDES += -I$(PKGDIRBASE)/littlefs2 -DIRS += $(RIOTBASE)/pkg/littlefs2/fs +ifneq (,$(filter littlefs2_fs,$(USEMODULE))) + DIRS += $(RIOTBASE)/pkg/littlefs2/fs +endif # Reduce LFS_NAME_MAX to 31 (as VFS_NAME_MAX default) CFLAGS += -DLFS_NAME_MAX=31