From c7de150ec329d3f645453f37f833c68e30595cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Tue, 5 Jun 2018 10:12:03 +0200 Subject: [PATCH 1/3] pkg/fatfs: fix declaration of periph_rtc optional dependency * Declare optional dependency to periph_rtc * Move CFLAGS definition to Makefile.include --- pkg/fatfs/Makefile.dep | 10 ++-------- pkg/fatfs/Makefile.include | 7 +++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/pkg/fatfs/Makefile.dep b/pkg/fatfs/Makefile.dep index 73eca11fe61b..812803ae1e6b 100644 --- a/pkg/fatfs/Makefile.dep +++ b/pkg/fatfs/Makefile.dep @@ -2,11 +2,5 @@ USEMODULE += fatfs_diskio_mtd USEMODULE += auto_init_storage USEMODULE += mtd -include $(RIOTBASE)/boards/$(BOARD)/Makefile.features - -#if periph_rtc is available use it. Otherwise use static timestamps -ifneq (, $(filter periph_rtc, $(FEATURES_PROVIDED))) - CFLAGS += -DFATFS_FFCONF_OPT_FS_NORTC=0 -else - CFLAGS += -DFATFS_FFCONF_OPT_FS_NORTC=1 -endif +# Use RTC for timestamps if available +FEATURES_OPTIONAL += periph_rtc diff --git a/pkg/fatfs/Makefile.include b/pkg/fatfs/Makefile.include index 918fe83c886b..7fe6cb9347a7 100644 --- a/pkg/fatfs/Makefile.include +++ b/pkg/fatfs/Makefile.include @@ -9,6 +9,13 @@ ifneq (,$(filter fatfs_vfs,$(USEMODULE))) DIRS += $(RIOTBASE)/pkg/fatfs/fatfs_vfs endif +#if periph_rtc is available use it. Otherwise use static timestamps +ifneq (,$(filter periph_rtc,$(USEMODULE))) + CFLAGS += -DFATFS_FFCONF_OPT_FS_NORTC=0 +else + CFLAGS += -DFATFS_FFCONF_OPT_FS_NORTC=1 +endif + ifeq ($(shell uname -s),Darwin) CFLAGS += -Wno-empty-body endif From ebd438cb58367c61419e7dca88dfaaec57d850c7 Mon Sep 17 00:00:00 2001 From: cladmi Date: Wed, 26 Sep 2018 17:41:48 +0200 Subject: [PATCH 2/3] sys/shell: select sc_rtc on USEMODULE sc_rtc.c should only be compiled if periph_rtc module is actually used. In practice there was not linking error when PERIPH_OPTIONAL|_REQUIRED was not set as shell_commands hides calling the functions with '#ifdef MODULE_PERIPH_RTC'. --- sys/shell/commands/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/shell/commands/Makefile b/sys/shell/commands/Makefile index 9f5c4604f15a..268a6481c0d2 100644 --- a/sys/shell/commands/Makefile +++ b/sys/shell/commands/Makefile @@ -70,7 +70,7 @@ ifneq (,$(filter cord_ep,$(USEMODULE))) SRC += sc_cord_ep.c endif -ifneq (,$(filter periph_rtc,$(FEATURES_PROVIDED))) +ifneq (,$(filter periph_rtc,$(USEMODULE))) SRC += sc_rtc.c endif From bcf0342cbda395985f2d250a404ee5bda1a6fbd4 Mon Sep 17 00:00:00 2001 From: cladmi Date: Wed, 26 Sep 2018 17:15:20 +0200 Subject: [PATCH 3/3] static-test: add buildsystem sanity check --- dist/tools/ci/build_and_test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/dist/tools/ci/build_and_test.sh b/dist/tools/ci/build_and_test.sh index 68e5025e872e..9399c99be6f2 100755 --- a/dist/tools/ci/build_and_test.sh +++ b/dist/tools/ci/build_and_test.sh @@ -93,6 +93,7 @@ then run ./dist/tools/coccinelle/check.sh run ./dist/tools/flake8/check.sh run ./dist/tools/headerguards/check.sh + run ./dist/tools/buildsystem_sanity_check/check.sh exit $RESULT fi