diff --git a/fs/Makefile b/fs/Makefile index 68a32ccf006..5b521cac6b1 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -63,14 +63,15 @@ else CSRCS += fs_close.c fs_dup.c fs_dup2.c fs_fcntl.c fs_filedup.c fs_filedup2.c CSRCS += fs_ioctl.c fs_lseek.c fs_mkdir.c fs_open.c fs_poll.c fs_read.c -CSRCS += fs_rename.c fs_rmdir.c fs_seekdir.c fs_stat.c fs_statfs.c -CSRCS += fs_select.c fs_unlink.c fs_write.c +CSRCS += fs_rename.c fs_rmdir.c fs_stat.c fs_statfs.c fs_select.c +CSRCS += fs_unlink.c fs_write.c DEPPATH = --dep-path . VPATH = . include inode/Make.defs include driver/Make.defs +include dirent/Make.defs include mmap/Make.defs # Stream support @@ -89,12 +90,7 @@ endif ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y) -CSRCS += fs_fsync.c fs_mount.c fs_umount.c fs_foreachmountpoint.c - -ifeq ($(CONFIG_FS_AUTOMOUNTER),y) -CSRCS += fs_automount.c -endif - +include mount/Make.defs include fat/Make.defs include romfs/Make.defs include nxffs/Make.defs diff --git a/fs/dirent/Make.defs b/fs/dirent/Make.defs index 392fa444ece..c50792cc628 100644 --- a/fs/dirent/Make.defs +++ b/fs/dirent/Make.defs @@ -37,7 +37,7 @@ ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) -CSRCS += fs_closedir.c fs_opendir.c fs_readdir.c fs_rewinddir.c +CSRCS += fs_closedir.c fs_opendir.c fs_readdir.c fs_rewinddir.c fs_seekdir.c # Include dirent build support diff --git a/fs/fs_seekdir.c b/fs/dirent/fs_seekdir.c similarity index 99% rename from fs/fs_seekdir.c rename to fs/dirent/fs_seekdir.c index 9ad7460ccd5..c5d5fbcbbcc 100644 --- a/fs/fs_seekdir.c +++ b/fs/dirent/fs_seekdir.c @@ -1,5 +1,5 @@ /**************************************************************************** - * fs/fs_seekdir.c + * fs/dirent/fs_seekdir.c * * Copyright (C) 2007, 2008, 2011, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/fs/mount/Make.defs b/fs/mount/Make.defs new file mode 100644 index 00000000000..26dc54f712d --- /dev/null +++ b/fs/mount/Make.defs @@ -0,0 +1,53 @@ +############################################################################ +# fs/mount/Make.defs +# +# Copyright (C) 2014 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# 3. Neither the name NuttX nor the names of its contributors may be +# 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. +# +############################################################################ + +# Don't build anything if there are no file descriptors + +ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) +ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y) + +CSRCS += fs_fsync.c fs_mount.c fs_umount.c fs_foreachmountpoint.c + +ifeq ($(CONFIG_FS_AUTOMOUNTER),y) +CSRCS += fs_automount.c +endif + +# Include mount build support + +DEPPATH += --dep-path mount +VPATH += :mount +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)fs$(DELIM)mount} +endif +endif diff --git a/fs/fs_automount.c b/fs/mount/fs_automount.c similarity index 99% rename from fs/fs_automount.c rename to fs/mount/fs_automount.c index c15e9238684..108035334f7 100644 --- a/fs/fs_automount.c +++ b/fs/mount/fs_automount.c @@ -1,5 +1,5 @@ /**************************************************************************** - * fs/fs_automount.c + * fs/mount/fs_automount.c * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/fs/fs_foreachmountpoint.c b/fs/mount/fs_foreachmountpoint.c similarity index 99% rename from fs/fs_foreachmountpoint.c rename to fs/mount/fs_foreachmountpoint.c index 6df68bd75ac..f82c144cdba 100644 --- a/fs/fs_foreachmountpoint.c +++ b/fs/mount/fs_foreachmountpoint.c @@ -1,5 +1,5 @@ /**************************************************************************** - * fs/fs_foreachmountpoint.c + * fs/mount/fs_foreachmountpoint.c * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/fs/fs_mount.c b/fs/mount/fs_mount.c similarity index 99% rename from fs/fs_mount.c rename to fs/mount/fs_mount.c index 8e80ad103ef..2f3a71e0f29 100644 --- a/fs/fs_mount.c +++ b/fs/mount/fs_mount.c @@ -1,5 +1,5 @@ /**************************************************************************** - * fs/fs_mount.c + * fs/mount/fs_mount.c * * Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/fs/fs_umount.c b/fs/mount/fs_umount.c similarity index 99% rename from fs/fs_umount.c rename to fs/mount/fs_umount.c index 2100b258650..42f6a5cc800 100644 --- a/fs/fs_umount.c +++ b/fs/mount/fs_umount.c @@ -1,5 +1,5 @@ /**************************************************************************** - * fs/fs_umount.c + * fs/mount/fs_umount.c * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt