2020-04-21 09:22:31 +02:00
|
|
|
############################################################################
|
2019-01-27 19:16:02 +01:00
|
|
|
# fs/littlefs/Make.defs
|
2019-01-09 21:26:51 +01:00
|
|
|
#
|
2020-04-21 09:22:31 +02:00
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership. The
|
|
|
|
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
# "License"); you may not use this file except in compliance with the
|
|
|
|
# License. You may obtain a copy of the License at
|
2019-01-09 21:26:51 +01:00
|
|
|
#
|
2020-04-21 09:22:31 +02:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2019-01-09 21:26:51 +01:00
|
|
|
#
|
2020-04-21 09:22:31 +02:00
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
# License for the specific language governing permissions and limitations
|
|
|
|
# under the License.
|
2019-01-09 21:26:51 +01:00
|
|
|
#
|
2020-04-21 09:22:31 +02:00
|
|
|
############################################################################
|
2019-01-09 21:26:51 +01:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_FS_LITTLEFS),y)
|
|
|
|
# Files required for littlefs file system support
|
|
|
|
|
2020-04-21 09:22:31 +02:00
|
|
|
CSRCS += lfs_vfs.c
|
2019-01-09 21:26:51 +01:00
|
|
|
|
2024-02-02 08:37:22 +01:00
|
|
|
ifeq ($(CONFIG_TRACE_LITTLEFS_FS),y)
|
|
|
|
littlefs/lfs_vfs.c_CFLAGS += -finstrument-functions
|
|
|
|
endif
|
|
|
|
|
2019-01-09 21:26:51 +01:00
|
|
|
DEPPATH += --dep-path littlefs
|
|
|
|
VPATH += :littlefs
|
|
|
|
|
2020-04-21 09:22:31 +02:00
|
|
|
CSRCS += lfs.c lfs_util.c
|
|
|
|
|
|
|
|
DEPPATH += --dep-path littlefs/littlefs
|
|
|
|
VPATH += :littlefs/littlefs
|
|
|
|
|
2021-03-28 20:33:14 +02:00
|
|
|
CFLAGS += -DLFS_TRACE=finfo
|
|
|
|
CFLAGS += -DLFS_DEBUG=finfo
|
|
|
|
CFLAGS += -DLFS_WARN=fwarn
|
|
|
|
CFLAGS += -DLFS_ERROR=ferr
|
|
|
|
CFLAGS += -DLFS_ASSERT=DEBUGASSERT
|
2021-05-14 04:45:57 +02:00
|
|
|
CFLAGS += -DLFS_CONFIG=../lfs_vfs.h
|
2022-12-01 13:28:38 +01:00
|
|
|
CFLAGS += -DLFS_NAME_MAX=$(CONFIG_FS_LITTLEFS_NAME_MAX)
|
|
|
|
CFLAGS += -DLFS_FILE_MAX=$(CONFIG_FS_LITTLEFS_FILE_MAX)
|
|
|
|
CFLAGS += -DLFS_ATTR_MAX=$(CONFIG_FS_LITTLEFS_ATTR_MAX)
|
2020-06-05 08:41:53 +02:00
|
|
|
|
2023-04-26 06:53:52 +02:00
|
|
|
LITTLEFS_VERSION ?= 2.5.1
|
2020-04-21 09:22:31 +02:00
|
|
|
LITTLEFS_TARBALL = v$(LITTLEFS_VERSION).tar.gz
|
|
|
|
|
|
|
|
$(LITTLEFS_TARBALL):
|
2023-03-07 17:17:54 +01:00
|
|
|
$(call DOWNLOAD,https://github.com/ARMmbed/littlefs/archive,$(LITTLEFS_TARBALL),littlefs/$(LITTLEFS_TARBALL))
|
2020-04-21 09:22:31 +02:00
|
|
|
|
|
|
|
.littlefsunpack: $(LITTLEFS_TARBALL)
|
|
|
|
$(Q) tar zxf littlefs/$(LITTLEFS_TARBALL) -C littlefs
|
|
|
|
$(Q) mv littlefs/littlefs-$(LITTLEFS_VERSION) littlefs/littlefs
|
2023-04-26 06:53:52 +02:00
|
|
|
$(Q) git apply littlefs/lfs_util.patch
|
2024-02-21 05:03:44 +01:00
|
|
|
$(Q) git apply littlefs/lfs_getpath.patch
|
2020-04-21 09:22:31 +02:00
|
|
|
$(Q) touch littlefs/.littlefsunpack
|
|
|
|
|
2022-08-27 18:21:40 +02:00
|
|
|
# Download and unpack tarball if no git repo found
|
|
|
|
ifeq ($(wildcard littlefs/littlefs/.git),)
|
2020-04-21 09:22:31 +02:00
|
|
|
context:: .littlefsunpack
|
|
|
|
|
|
|
|
distclean::
|
|
|
|
$(call DELFILE, littlefs/.littlefsunpack)
|
|
|
|
$(call DELFILE, littlefs/$(LITTLEFS_TARBALL))
|
|
|
|
$(call DELDIR, littlefs/littlefs)
|
2022-08-27 18:21:40 +02:00
|
|
|
endif
|
2020-04-21 09:22:31 +02:00
|
|
|
|
2020-02-07 14:17:25 +01:00
|
|
|
endif
|