2007-11-21 04:32:33 +08:00
|
|
|
############################################################################
|
|
|
|
# fs/Makefile
|
2007-02-18 07:21:28 +08:00
|
|
|
#
|
2018-03-19 21:08:40 +08:00
|
|
|
# Copyright (C) 2007, 2008, 2011-2014, 2016-2018 Gregory Nutt. All rights
|
2017-10-31 08:04:28 +08:00
|
|
|
# reserved.
|
2012-07-15 05:05:40 +08:00
|
|
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
2007-02-18 07:21:28 +08:00
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in
|
|
|
|
# the documentation and/or other materials provided with the
|
|
|
|
# distribution.
|
2008-01-08 08:19:24 +08:00
|
|
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
2007-02-18 07:21:28 +08:00
|
|
|
# used to endorse or promote products derived from this software
|
|
|
|
# without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
2007-11-21 04:32:33 +08:00
|
|
|
############################################################################
|
2007-02-18 07:21:28 +08:00
|
|
|
|
|
|
|
-include $(TOPDIR)/Make.defs
|
|
|
|
|
2014-02-20 00:01:26 +08:00
|
|
|
ASRCS =
|
|
|
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
2007-02-18 07:21:28 +08:00
|
|
|
|
2014-10-06 22:11:37 +08:00
|
|
|
CSRCS = fs_initialize.c
|
2011-06-02 23:05:48 +08:00
|
|
|
|
2014-09-29 00:53:40 +08:00
|
|
|
DEPPATH = --dep-path .
|
2013-01-16 23:41:27 +08:00
|
|
|
VPATH = .
|
|
|
|
|
2014-09-29 00:53:40 +08:00
|
|
|
include inode/Make.defs
|
2014-09-29 01:46:11 +08:00
|
|
|
include vfs/Make.defs
|
2014-09-29 01:06:21 +08:00
|
|
|
include driver/Make.defs
|
2014-09-29 01:28:17 +08:00
|
|
|
include dirent/Make.defs
|
2014-10-06 05:33:31 +08:00
|
|
|
include aio/Make.defs
|
2011-05-08 04:08:46 +08:00
|
|
|
include mmap/Make.defs
|
|
|
|
|
2014-09-29 04:35:17 +08:00
|
|
|
# OS resources
|
|
|
|
|
|
|
|
include semaphore/Make.defs
|
2014-09-29 21:00:11 +08:00
|
|
|
include mqueue/Make.defs
|
2014-09-30 06:46:31 +08:00
|
|
|
include shm/Make.defs
|
2014-09-29 04:35:17 +08:00
|
|
|
|
2011-06-02 23:05:48 +08:00
|
|
|
# Additional files required is mount-able file systems are supported
|
|
|
|
|
2008-10-23 06:02:44 +08:00
|
|
|
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
|
2013-01-16 23:41:27 +08:00
|
|
|
|
2014-09-29 01:28:17 +08:00
|
|
|
include mount/Make.defs
|
2018-08-28 21:30:21 +08:00
|
|
|
include partition/Make.defs
|
2008-08-02 23:02:10 +08:00
|
|
|
include fat/Make.defs
|
2008-09-11 03:29:24 +08:00
|
|
|
include romfs/Make.defs
|
2018-03-19 21:08:40 +08:00
|
|
|
include cromfs/Make.defs
|
2015-10-10 01:02:59 +08:00
|
|
|
include tmpfs/Make.defs
|
2011-04-29 03:26:46 +08:00
|
|
|
include nxffs/Make.defs
|
2012-03-02 10:11:31 +08:00
|
|
|
include nfs/Make.defs
|
2013-05-01 10:13:30 +08:00
|
|
|
include smartfs/Make.defs
|
2013-01-16 23:41:27 +08:00
|
|
|
include binfs/Make.defs
|
2013-11-14 05:59:14 +08:00
|
|
|
include procfs/Make.defs
|
This commit brings in an inital port of the SPIFFS flash file system into NuttX. The file system is still untested at this point (and subject to some additional review). It is, however, marked EXPERIMENTAL should this should not cause a problem for anyone.
Squashed commit of the following:
fs/spiffs: Fix last compilation issue. Now compiles without error. It is still not quite ready for testing as there is additional code review that must be be performed. It is now marked as EXPERIMENTAL so that it can be brought onto the master branch with little risk.
fs/spiffs: Remove some dead code.
fs/spiffs: Weak start of analysis of spiffs_nucleus.c. Renamed to spiffs_core.c
fs/spiffs: Rename spiffs_nucleus.c to spiffs_core.c
fs/spiffs: Remove spiffs_config.h. All configuration settings are now available in the SPIFFS Kconfig options.
fs/spiffs: Finished review, update, and repartitioning of spiffs_check.c. Added spiffs_check.h.
fs/spiffs: Finished review, update, and repartitioning of spiffs_cache.c. Added spiffs_cache.h.
fs/spiffs: Clean up some defines used in debug output statements.
fs/spiffs: Finished review, update, and repartitioning of spiffs_gc.c. Added spiffs_gc.h.
fs/spiffs: Now that VFS interface is completed, I have begun the long march of repartitioning the remaining functionality, reviewing logic, identifying dead code, and cleaning up loose ends.
fs/spiffs: Initial integration of MTD interface, replacing the SPIFFS native flash interface. Lots of open issues such as the use of pages vs. blocks vs. erase blocks and units of addresses, offsets, and lengths that are passed in function calls. Remove SPIFFS_USE_MAGIC support. That option (which default to OFF anyway), wrote a magic value at the beginning of every sector and support verifiable identification of the file system. It was not being and used and removing it makes life simpler.
fs/spiffs: Remove semaphore lock on the file object structure. Ultimately, the file access must modify the volume and access the volume structue which also has a exclusivity lock. So use of the volume lock alone should be sufficient.
Integrated the SPIFFS rename logic into the NuttX VFS. Removed non-standard application calls or convert them to IOCTL commands. These were converted to IOCTL commands: (1) integrity check, (2) garbage collection, and (3) format flash. These were removed: (1) Integrity check callback. These provided a lot of good information about the state of the file system, but such callbacks are not compatible with a POSIX compliant file system. (2) Index maps. The index maps were a performance improvement feature. The user could provide the memory and request that a region of a a file use that memory for improved lookup performance when accessing parts of the file. The fallback is the less performance lookup by traversing the FLASH memory. (3) Removed the quick garbage collection interface (the code is still used internally). Only the full garbage collection is available to the user application via IOCTL.
configs/sim/spiffs: A simulator configuration to use for testing SPIFFS.
fs/spiffs: Integrate SPIFFS logic into NuttX VFS bind() and unbind() methods.
fs/mount/fs_mount.c: Add SPIFFS to the list of drivers that require MTD vs block drivers.
fs/spiffs: Trivial changes, mostly from analysis of how to integrate the rename() VFS method.
fs/spiffs: Connect NuttX VFS unlink method to the SPIFFS_remove() function. Lots of name-changing.
fs/spiffs: Remove non-standard errno support. Remove bogus SPIFFS_LOCK() and SPIFFS_UNLOCK() macros.
fs/spiffs: Add NuttX VFS implementation for statfs() method. Clean up some of the accumulating compilation problems.
fs/spiffs: Add stat(), truncate() methods. Dummy out unsupport mkdir() and rmdir() methods.
fs/spiffs: Replace some of the custom error numbers with standard error numbers.
fs/spiffs: Hooks read(), write(), fstat(), ioctl(), opendir(), closedir(), rewindif(), and readdir() into the NuttX VFS.
fs/spiffs: Beginning the organization to work with the NuttX VFS. Lots of things are get broken!
fs/spiffs: Add spiffs.c which will be the interface between SPIFFS and NuttX. No very close at present, however.
fs/spiffs: Clean up some compile problems introduced by coding standard changes.
fs/spiffs: A little closer to NuttX coding standard.
fs/spiffs: Ran tools/indent.sh against all files. Closer to NuttX coding standard, but needs a lot more effort to be fully compliant.
fs/spiffs: This commit brings in version 0.3.7 of Peter Anderson's SPIFFS. The initial commit includes the core FS files (with some definitions destributed to their correct header files) and hooks into the build system.
2018-09-25 08:05:09 +08:00
|
|
|
include spiffs/Make.defs
|
2015-06-06 03:18:06 +08:00
|
|
|
include unionfs/Make.defs
|
2017-10-31 08:04:28 +08:00
|
|
|
include userfs/Make.defs
|
2015-11-25 22:26:26 +08:00
|
|
|
include hostfs/Make.defs
|
2019-01-10 04:26:51 +08:00
|
|
|
include littlefs/Make.defs
|
2013-01-16 23:41:27 +08:00
|
|
|
|
2007-11-21 04:32:33 +08:00
|
|
|
endif
|
2007-06-10 03:11:00 +08:00
|
|
|
|
2014-02-20 00:01:26 +08:00
|
|
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
2007-02-18 07:21:28 +08:00
|
|
|
|
2014-02-20 00:01:26 +08:00
|
|
|
SRCS = $(ASRCS) $(CSRCS)
|
|
|
|
OBJS = $(AOBJS) $(COBJS)
|
2007-02-18 07:21:28 +08:00
|
|
|
|
2014-02-20 00:01:26 +08:00
|
|
|
BIN = libfs$(LIBEXT)
|
2007-02-18 07:21:28 +08:00
|
|
|
|
2014-02-20 00:01:26 +08:00
|
|
|
all: $(BIN)
|
2016-05-11 05:44:06 +08:00
|
|
|
.PHONY: depend clean distclean
|
2007-02-18 07:21:28 +08:00
|
|
|
|
2007-02-28 07:59:20 +08:00
|
|
|
$(AOBJS): %$(OBJEXT): %.S
|
2008-01-09 01:06:21 +08:00
|
|
|
$(call ASSEMBLE, $<, $@)
|
2007-02-18 07:21:28 +08:00
|
|
|
|
2007-02-28 21:42:19 +08:00
|
|
|
$(COBJS): %$(OBJEXT): %.c
|
2008-01-09 01:06:21 +08:00
|
|
|
$(call COMPILE, $<, $@)
|
2007-02-18 07:21:28 +08:00
|
|
|
|
|
|
|
$(BIN): $(OBJS)
|
2012-11-16 01:43:29 +08:00
|
|
|
$(call ARCHIVE, $@, $(OBJS))
|
2007-02-18 07:21:28 +08:00
|
|
|
|
2020-03-23 10:44:03 +08:00
|
|
|
.depend: Makefile $(SRCS)
|
|
|
|
$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
|
|
|
|
$(Q) touch $@
|
2007-02-18 07:21:28 +08:00
|
|
|
|
2020-03-23 10:44:03 +08:00
|
|
|
depend: .depend
|
2007-02-18 07:21:28 +08:00
|
|
|
|
|
|
|
clean:
|
2012-11-20 23:47:41 +08:00
|
|
|
$(call DELFILE, $(BIN))
|
2008-01-11 02:23:08 +08:00
|
|
|
$(call CLEAN)
|
2007-02-18 07:21:28 +08:00
|
|
|
|
|
|
|
distclean: clean
|
2012-11-20 23:47:41 +08:00
|
|
|
$(call DELFILE, Make.dep)
|
2020-03-23 10:44:03 +08:00
|
|
|
$(call DELFILE, .depend)
|
2007-02-18 07:21:28 +08:00
|
|
|
|
|
|
|
-include Make.dep
|