9
0
Fork 0

Simply conditional build; fix conditional compilation

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@275 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2007-06-09 19:11:00 +00:00
parent c1d7cdfbed
commit bf0ca7304d
55 changed files with 87 additions and 199 deletions

View File

@ -164,5 +164,10 @@
* examples/ostest/sighand.c: Don't call fflush() if streams are disabled
* include/limits.h, include/time.h, sched/clock_internal.h: A support for
using selectable system timer frequency.
* Fixed error in mountpoint related conditional compilation introduced
in 0.2.5
* Restructured some Makefiles to better handle enabling and disabling
NuttX features without having so much conditional compilation in the
source files.
* Started m68322

View File

@ -598,6 +598,11 @@ Other memory:
* examples/ostest/sighand.c: Don't call fflush() if streams are disabled
* include/limits.h, include/time.h, sched/clock_internal.h: A support for
using selectable system timer frequency.
* Fixed error in mountpoint related conditional compilation introduced
in 0.2.5
* Restructured some Makefiles to better handle enabling and disabling
NuttX features without having so much conditional compilation in the
source files.
* Started m68322
</pre></ul>

View File

@ -37,17 +37,45 @@ TOPDIR = ${shell pwd}
-include ${TOPDIR}/.config
-include ${TOPDIR}/Make.defs
# Process architecture and board-specific directories
ARCH_DIR = arch/$(CONFIG_ARCH)
ARCH_SRC = $(ARCH_DIR)/src
ARCH_INC = $(ARCH_DIR)/include
BOARD_DIR = configs/$(CONFIG_ARCH_BOARD)
SUBDIRS = sched lib $(ARCH_SRC) mm fs drivers examples/$(CONFIG_EXAMPLE)
# FSDIRS depend on file descriptor support; NONFSDIRS do not
# (except for parts of FSDIRS). We will exclude FSDIRS
# from the build if file descriptor support is disabled
NONFSDIRS = sched lib $(ARCH_SRC) mm examples/$(CONFIG_EXAMPLE)
FSDIRS = fs drivers
# CLEANDIRS are the directories that will clean in. These are
# all directories that we know about.
# MAKEDIRS are the directories in which we will build targets
CLEANDIRS = $(NONFSDIRS) $(FSDIRS)
ifeq ($(CONFIG_NFILE_DESCRIPTORS),0)
MAKEDIRS = $(NONFSDIRS)
else
MAKEDIRS = $(NONFSDIRS) $(FSDIRS)
endif
# LINKLIBS is the list of NuttX libraries that is passed to the
# processor-specific Makefile to build the final target.
# Libraries in FSDIRS are excluded if file descriptor support
# is disabled.
LINKLIBS = sched/libsched$(LIBEXT) $(ARCH_SRC)/libarch$(LIBEXT) mm/libmm$(LIBEXT) \
fs/libfs$(LIBEXT) drivers/libdrivers$(LIBEXT) lib/liblib$(LIBEXT) \
examples/$(CONFIG_EXAMPLE)/lib$(CONFIG_EXAMPLE)$(LIBEXT)
lib/liblib$(LIBEXT) examples/$(CONFIG_EXAMPLE)/lib$(CONFIG_EXAMPLE)$(LIBEXT)
ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
LINKLIBS += fs/libfs$(LIBEXT) drivers/libdrivers$(LIBEXT)
endif
# This is the name of the final target
BIN = nuttx$(EXEEXT)
all: $(BIN)
@ -169,12 +197,12 @@ $(BIN): context depend $(LINKLIBS)
$(MAKE) -C $(ARCH_SRC) TOPDIR=$(TOPDIR) LINKLIBS="$(LINKLIBS)" $(BIN)
depend:
@for dir in $(SUBDIRS) ; do \
@for dir in $(MAKEDIRS) ; do \
$(MAKE) -C $$dir TOPDIR=$(TOPDIR) depend ; \
done
subdir_clean:
@for dir in $(SUBDIRS) ; do \
@for dir in $(CLEANDIRS) ; do \
if [ -e $$dir/Makefile ]; then \
$(MAKE) -C $$dir TOPDIR=$(TOPDIR) clean ; \
fi \
@ -186,7 +214,7 @@ clean: subdir_clean
rm -f $(BIN) $(BIN).* mm_test *.map *~
subdir_distclean:
@for dir in $(SUBDIRS) ; do \
@for dir in $(CLEANDIRS) ; do \
if [ -e $$dir/Makefile ]; then \
$(MAKE) -C $$dir TOPDIR=$(TOPDIR) distclean ; \
fi \

View File

@ -51,7 +51,7 @@ o Build system
- Some names under arch are still incorrect. These should be processor architecture
names: pjrc-8051 should be 805x
- configs/pjrc-8051 should be configs/pjrc-87c52
- Last change to create the arch/arm directory breaks dependencies in arch/arm/src.
- 0.2.4 changes to create the arch/arm directory breaks dependency target in arch/arm/src.
Probably need to add the path to the chip or common subdirectorys when
running tools/mkdeps.sh

View File

@ -42,18 +42,21 @@ AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = fs_open.c fs_close.c fs_read.c fs_write.c fs_ioctl.c fs_dup.c \
fs_opendir.c fs_closedir.c fs_stat.c fs_readdir.c fs_readdirr.c \
fs_seekdir.c fs_telldir.c fs_rewinddir.c fs_fsync.c fs_files.c \
fs_seekdir.c fs_telldir.c fs_rewinddir.c fs_files.c \
fs_inode.c fs_inodefind.c fs_inodereserve.c fs_statfs.c \
fs_inoderemove.c fs_registerdriver.c fs_unregisterdriver.c \
fs_inodeaddref.c fs_inoderelease.c
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
CSRCS += fs_registerblockdriver.c fs_unregisterblockdriver.c \
fs_mount.c fs_umount.c fs_unlink.c fs_mkdir.c fs_rmdir.c \
fs_rename.c
fs_mount.c fs_umount.c \
fs_fsync.c fs_unlink.c fs_rename.c \
fs_mkdir.c fs_rmdir.c
ifeq ($(CONFIG_FS_FAT),y)
CSRCS += fs_fat32.c fs_fat32util.c fs_fat32attrib.c
endif
endif
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)

View File

@ -49,8 +49,6 @@
* Global Functions
****************************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
int close(int fd)
{
FAR struct filelist *list;
@ -112,4 +110,3 @@ int close(int fd)
return ERROR;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -71,8 +71,6 @@
*
************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
int closedir(FAR DIR *dirp)
{
struct internal_dir_s *idir = (struct internal_dir_s *)dirp;
@ -95,7 +93,7 @@ int closedir(FAR DIR *dirp)
* inode we have open.
*/
#ifndef CONFIG_DISABLE_MOUNTPOUNT
#ifndef CONFIG_DISABLE_MOUNTPOINT
if (INODE_IS_MOUNTPT(inode) && !DIRENT_ISPSUEDONODE(idir->fd_flags))
{
/* The node is a file system mointpoint. Verify that the mountpoint
@ -145,4 +143,3 @@ errout:
return ERROR;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -65,8 +65,6 @@
* Global Functions
************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
int dup(int fildes)
{
FAR struct filelist *list;
@ -146,4 +144,3 @@ int dup2(int fildes1, int fildes2)
return files_dup(&list->fl_files[fildes1], &list->fl_files[fildes2]);
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -61,9 +61,6 @@
#include "fs_internal.h"
#include "fs_fat32.h"
#ifdef CONFIG_FS_FAT
#ifndef CONFIG_DISABLE_MOUNTPOUNT
/****************************************************************************
* Definitions
****************************************************************************/
@ -2188,5 +2185,3 @@ static int fat_stat(struct inode *mountpt, const char *relpath, struct stat *buf
* Public Functions
****************************************************************************/
#endif /* CONFIG_DISABLE_MOUNTPOUNT */
#endif /* CONFIG_FS_FAT */

View File

@ -51,8 +51,6 @@
#include "fs_internal.h"
#include "fs_fat32.h"
#if defined(CONFIG_FS_FAT) && !defined(CONFIG_DISABLE_MOUNTPOUNT)
/************************************************************
* Private Functions
************************************************************/
@ -190,5 +188,3 @@ int fat_setattrib(const char *path, fat_attrib_t setbits, fat_attrib_t clearbits
return fat_attrib(path, NULL, setbits, clearbits);
}
#endif /* CONFIG_FS_FAT && !CONFIG_DISABLE_MOUNTPOUNT */

View File

@ -58,9 +58,6 @@
#include "fs_internal.h"
#include "fs_fat32.h"
#ifdef CONFIG_FS_FAT
#ifndef CONFIG_DISABLE_MOUNTPOUNT
/****************************************************************************
* Definitions
****************************************************************************/
@ -2445,5 +2442,3 @@ int fat_nfreeclusters(struct fat_mountpt_s *fs, size_t *pfreeclusters)
return OK;
}
#endif /* CONFIG_DISABLE_MOUNTPOUNT */
#endif /* CONFIG_FS_FAT */

View File

@ -67,8 +67,6 @@
* Private Functions
************************************************************/
#if CONFIG_NFILE_DESCRIPTORS >0
static void _files_semtake(FAR struct filelist *list)
{
/* Take the semaphore (perhaps waiting) */
@ -279,4 +277,3 @@ void files_release(int filedes)
}
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -47,9 +47,6 @@
#include "fs_internal.h"
#if CONFIG_NFILE_DESCRIPTORS > 0
#ifndef CONFIG_DISABLE_MOUNTPOUNT
/****************************************************************************
* Definitions
****************************************************************************/
@ -138,5 +135,3 @@ int fsync(int fd)
return ERROR;
}
#endif /* CONFIG_DISABLE_MOUNTPOINT */
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -48,8 +48,6 @@
#include <nuttx/fs.h>
#include "fs_internal.h"
#if CONFIG_NFILE_DESCRIPTORS >0
/************************************************************
* Definitions
************************************************************/
@ -330,5 +328,4 @@ const char *inode_nextname(const char *name)
if (*name) name++;
return name;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -43,8 +43,6 @@
#include <nuttx/fs.h>
#include "fs_internal.h"
#if CONFIG_NFILE_DESCRIPTORS >0
/************************************************************
* Definitions
************************************************************/
@ -97,6 +95,3 @@ FAR struct inode *inode_find(const char *path, const char **relpath)
return node;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -44,8 +44,6 @@
#include <nuttx/fs.h>
#include "fs_internal.h"
#if CONFIG_NFILE_DESCRIPTORS >0
/************************************************************
* Definitions
************************************************************/
@ -105,4 +103,3 @@ void inode_release(FAR struct inode *node)
}
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -119,7 +119,7 @@ STATUS inode_remove(const char *path)
/* Find the node to delete */
node = inode_search(&name, &left, &parent, NULL);
node = inode_search(&name, &left, &parent, (const char **)NULL);
if (node)
{
/* Found it, now remove it from the tree */

View File

@ -156,7 +156,7 @@ FAR struct inode *inode_reserve(const char *path)
/* Find the location to insert the new subtree */
if (inode_search(&name, &left, &parent, NULL) != NULL)
if (inode_search(&name, &left, &parent, (const char **)NULL) != NULL)
{
/* Is is an error if the node already exists in the tree */

View File

@ -207,11 +207,9 @@ EXTERN void inode_release(FAR struct inode *inode);
/* fs_files.c ***************************************************************/
#if CONFIG_NFILE_DESCRIPTORS >0
EXTERN void weak_function files_initialize(void);
EXTERN int files_allocate(FAR struct inode *inode, int oflags, off_t pos);
EXTERN void files_release(int filedes);
#endif
#undef EXTERN
#if defined(__cplusplus)

View File

@ -52,8 +52,6 @@
* Global Functions
************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
int ioctl(int fd, int req, unsigned long arg)
{
FAR struct filelist *list;
@ -87,4 +85,3 @@ int ioctl(int fd, int req, unsigned long arg)
return ret;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -45,9 +45,6 @@
#include "fs_internal.h"
#if CONFIG_NFILE_DESCRIPTORS > 0
#ifndef CONFIG_DISABLE_MOUNTPOUNT
/****************************************************************************
* Definitions
****************************************************************************/
@ -131,5 +128,3 @@ int mkdir(const char *pathname, mode_t mode)
return ERROR;
}
#endif /* CONFIG_DISABLE_MOUNTPOUNT */
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -45,9 +45,6 @@
#include <nuttx/fs.h>
#include "fs_internal.h"
#if CONFIG_NFILE_DESCRIPTORS > 0
#ifndef CONFIG_DISABLE_MOUNTPOUNT
/* At least one filesystem must be defined, or this file will not compile.
* It may be desire-able to make filesystems dynamically registered at
* some time in the future, but at present, this file needs to know about
@ -279,6 +276,5 @@ int mount(const char *source, const char *target,
return ERROR;
}
#endif /* Need at least filesystem */
#endif /* CONFIG_DISABLE_MOUNTPOUNT */
#endif /* Need file descriptor support */
#endif /* Need at least one filesystem */

View File

@ -56,8 +56,6 @@
* Public Functions
************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
int inode_checkflags(FAR struct inode *inode, int oflags)
{
if (((oflags & O_RDOK) != 0 && !inode->u.i_ops->read) ||
@ -153,7 +151,7 @@ int open(const char *path, int oflags, ...)
ret = OK;
if (inode->u.i_ops->open)
{
#ifndef CONFIG_DISABLE_MOUNTPOUNT
#ifndef CONFIG_DISABLE_MOUNTPOINT
if (INODE_IS_MOUNTPT(inode))
{
ret = inode->u.i_mops->open((FAR struct file*)&list->fl_files[fd],
@ -183,4 +181,3 @@ int open(const char *path, int oflags, ...)
return ERROR;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -82,8 +82,6 @@
*
************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
FAR DIR *opendir(const char *path)
{
FAR struct inode *inode = NULL;
@ -228,4 +226,3 @@ errout_with_semaphore:
return NULL;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -53,8 +53,6 @@
* Global Functions
****************************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
int read(int fd, void *buf, unsigned int nbytes)
{
FAR struct filelist *list;
@ -99,4 +97,3 @@ int read(int fd, void *buf, unsigned int nbytes)
return ret;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -53,8 +53,6 @@
* Name: readpsuedodir
************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
static inline int readpsuedodir(struct internal_dir_s *idir)
{
FAR struct inode *prev;
@ -228,4 +226,3 @@ errout:
return NULL;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -82,8 +82,6 @@
*
************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
int readdir_r(FAR DIR *dirp, FAR struct dirent *entry,
FAR struct dirent **result)
{
@ -120,4 +118,3 @@ int readdir_r(FAR DIR *dirp, FAR struct dirent *entry,
return 0;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -43,8 +43,6 @@
#include <nuttx/fs.h>
#include "fs_internal.h"
#ifndef CONFIG_DISABLE_MOUNTPOUNT
/************************************************************
* Definitions
************************************************************/
@ -101,4 +99,3 @@ STATUS register_blockdriver(const char *path,
return ret;
}
#endif /* CONFIG_DISABLE_MOUNTPOUNT */

View File

@ -45,9 +45,6 @@
#include "fs_internal.h"
#if CONFIG_NFILE_DESCRIPTORS > 0
#ifndef CONFIG_DISABLE_MOUNTPOUNT
/****************************************************************************
* Definitions
****************************************************************************/
@ -155,5 +152,3 @@ int rename(const char *oldpath, const char *newpath)
return ERROR;
}
#endif /* CONFIG_DISABLE_MOUNTPOUNT */
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -52,8 +52,6 @@
* Name: rewindpsuedodir
************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
static inline void rewindpsuedodir(struct internal_dir_s *idir)
{
struct inode *prev;
@ -104,7 +102,7 @@ static inline void rewindpsuedodir(struct internal_dir_s *idir)
void rewinddir(FAR DIR *dirp)
{
struct internal_dir_s *idir = (struct internal_dir_s *)dirp;
#ifndef CONFIG_DISABLE_MOUNTPOUNT
#ifndef CONFIG_DISABLE_MOUNTPOINT
struct inode *inode;
#endif
@ -119,7 +117,7 @@ void rewinddir(FAR DIR *dirp)
* that we are dealing with.
*/
#ifndef CONFIG_DISABLE_MOUNTPOUNT
#ifndef CONFIG_DISABLE_MOUNTPOINT
inode = idir->fd_root;
if (INODE_IS_MOUNTPT(inode))
{
@ -143,4 +141,3 @@ void rewinddir(FAR DIR *dirp)
}
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -45,9 +45,6 @@
#include "fs_internal.h"
#if CONFIG_NFILE_DESCRIPTORS > 0
#ifndef CONFIG_DISABLE_MOUNTPOUNT
/****************************************************************************
* Definitions
****************************************************************************/
@ -131,5 +128,3 @@ int rmdir(const char *pathname)
return ERROR;
}
#endif /* CONFIG_DISABLE_MOUNTPOUNT */
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -48,8 +48,6 @@
* Private Functions
************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
/************************************************************
* Name: seekpsuedodir
************************************************************/
@ -111,7 +109,7 @@ static inline void seekpsuedodir(struct internal_dir_s *idir, off_t offset)
* Name: seekmountptdir
************************************************************/
#ifndef CONFIG_DISABLE_MOUNTPOUNT
#ifndef CONFIG_DISABLE_MOUNTPOINT
static inline void seekmountptdir(struct internal_dir_s *idir, off_t offset)
{
struct inode *inode;
@ -212,7 +210,7 @@ void seekdir(FAR DIR *dirp, off_t offset)
* that we are dealing with.
*/
#ifndef CONFIG_DISABLE_MOUNTPOUNT
#ifndef CONFIG_DISABLE_MOUNTPOINT
if (INODE_IS_MOUNTPT(idir->fd_root))
{
/* The node is a file system mointpoint */
@ -228,4 +226,3 @@ void seekdir(FAR DIR *dirp, off_t offset)
}
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -53,8 +53,6 @@
* Private Functions
****************************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
/****************************************************************************
* Name: statpsuedo
****************************************************************************/
@ -161,7 +159,7 @@ int stat(const char *path, FAR struct stat *buf)
* are dealing with.
*/
#ifndef CONFIG_DISABLE_MOUNTPOUNT
#ifndef CONFIG_DISABLE_MOUNTPOINT
if (INODE_IS_MOUNTPT(inode))
{
/* The node is a file system mointpoint. Verify that the mountpoint
@ -205,4 +203,3 @@ int stat(const char *path, FAR struct stat *buf)
return ERROR;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -54,8 +54,6 @@
* Private Functions
****************************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
/****************************************************************************
* Name: statpsuedo
****************************************************************************/
@ -125,7 +123,7 @@ int statfs(const char *path, struct statfs *buf)
* are dealing with.
*/
#ifndef CONFIG_DISABLE_MOUNTPOUNT
#ifndef CONFIG_DISABLE_MOUNTPOINT
if (INODE_IS_MOUNTPT(inode))
{
/* The node is a file system mointpoint. Verify that the mountpoint
@ -168,5 +166,3 @@ int statfs(const char *path, struct statfs *buf)
*get_errno_ptr() = ret;
return ERROR;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -72,8 +72,6 @@
*
************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
off_t telldir(FAR DIR *dirp)
{
struct internal_dir_s *idir = (struct internal_dir_s *)dirp;
@ -89,4 +87,3 @@ off_t telldir(FAR DIR *dirp)
return idir->fd_position;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -44,9 +44,6 @@
#include <nuttx/fs.h>
#include "fs_internal.h"
#if CONFIG_NFILE_DESCRIPTORS > 0
#ifndef CONFIG_DISABLE_MOUNTPOUNT
/****************************************************************************
* Definitions
****************************************************************************/
@ -206,5 +203,3 @@ int umount(const char *target)
return ERROR;
}
#endif /* CONFIG_DISABLE_MOUNTPOUNT */
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -45,9 +45,6 @@
#include "fs_internal.h"
#if CONFIG_NFILE_DESCRIPTORS > 0
#ifndef CONFIG_DISABLE_MOUNTPOUNT
/****************************************************************************
* Definitions
****************************************************************************/
@ -131,5 +128,3 @@ int unlink(const char *pathname)
return ERROR;
}
#endif /* CONFIG_DISABLE_MOUNTPOUNT */
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -43,9 +43,6 @@
#include "fs_internal.h"
#if CONFIG_NFILE_DESCRIPTORS > 0
#ifndef CONFIG_DISABLE_MOUNTPOUNT
/****************************************************************************
* Definitions
****************************************************************************/
@ -83,5 +80,3 @@ STATUS unregister_blockdriver(const char *path)
return ret;
}
#endif /* CONFIG_DISABLE_MOUNTPOUNT */
#endif

View File

@ -43,8 +43,6 @@
#include "fs_internal.h"
#if CONFIG_NFILE_DESCRIPTORS > 0
/****************************************************************************
* Definitions
****************************************************************************/
@ -82,4 +80,3 @@ STATUS unregister_driver(const char *path)
return ret;
}
#endif

View File

@ -53,8 +53,6 @@
* Global Functions
************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
int write(int fd, const void *buf, unsigned int nbytes)
{
FAR struct filelist *list;
@ -94,5 +92,3 @@ int write(int fd, const void *buf, unsigned int nbytes)
return ret;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -40,27 +40,43 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
MISC_SRCS = lib_init.c lib_streamsem.c lib_filesem.c
MISC_SRCS = lib_init.c lib_filesem.c
ifneq ($(CONFIG_NFILE_STREAMS),0)
MISC_SRCS += lib_streamsem.c
endif
STRING_SRCS = lib_memset.c lib_memcpy.c lib_memcmp.c lib_memmove.c \
lib_strcpy.c lib_strncpy.c lib_strcmp.c \
lib_strlen.c lib_strdup.c lib_strtol.c lib_strchr.c \
lib_strspn.c lib_strcspn.c \
lib_strtok.c lib_strtokr.c lib_strerror.c
CTYPE_SRCS =
STDIO_SRCS = lib_fopen.c lib_fclose.c \
STDIO_SRCS = lib_printf.c lib_rawprintf.c lib_lowprintf.c \
lib_sprintf.c lib_libsprintf.c lib_vsprintf.c lib_libvsprintf.c \
lib_memstream.c lib_lowstream.c lib_nullstream.c \
lib_sscanf.c
ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
STDIO_SRCS += lib_rawstream.c
ifneq ($(CONFIG_NFILE_STREAMS),0)
STDIO_SRCS += lib_fopen.c lib_fclose.c \
lib_fread.c lib_libfread.c lib_fgetc.c lib_fgets.c lib_gets.c \
lib_fwrite.c lib_libfwrite.c lib_fflush.c \
lib_fputc.c lib_puts.c lib_fputs.c \
lib_ungetc.c \
lib_printf.c lib_vprintf.c lib_fprintf.c lib_rawprintf.c lib_lowprintf.c \
lib_vfprintf.c lib_sprintf.c lib_libsprintf.c lib_vsprintf.c \
lib_libvsprintf.c lib_stdstream.c lib_memstream.c \
lib_rawstream.c lib_lowstream.c lib_nullstream.c \
lib_sscanf.c
lib_vprintf.c lib_fprintf.c lib_vfprintf.c \
lib_stdstream.c
endif
endif
STDLIB_SRCS = lib_getenv.c lib_rand.c
MATH_SRCS = lib_rint.c
SQ_SRCS = sq_addlast.c sq_addfirst.c sq_addafter.c \
sq_rem.c sq_remlast.c sq_remfirst.c sq_remafter.c
DQ_SRCS = dq_addlast.c dq_addfirst.c dq_addafter.c dq_addbefore.c \
dq_rem.c dq_remlast.c dq_remfirst.c

View File

@ -53,8 +53,6 @@
* Global Functions
************************************************************/
#if CONFIG_NFILE_STREAMS > 0
int fclose(FILE *stream)
{
int ret = OK;
@ -95,4 +93,3 @@ int fclose(FILE *stream)
return ret;
}
#endif /* CONFIG_NFILE_STREAMS */

View File

@ -88,8 +88,6 @@
* Called by the OS when a task exits
************************************************************/
#if CONFIG_NFILE_STREAMS > 0
void lib_flushall(FAR struct streamlist *list)
{
/* Make sure that there are streams associated with this thread */
@ -181,4 +179,3 @@ int fflush(FILE *stream)
#endif
}
#endif /* CONFIG_NFILE_STREAMS */

View File

@ -44,8 +44,6 @@
#include <ctype.h>
#include <debug.h>
#if CONFIG_NFILE_STREAMS > 0
/************************************************************
* Definitions
************************************************************/
@ -322,4 +320,3 @@ char *fgets(FAR char *s, int n, FILE *stream)
}
#endif /* CONFIG_NFILE_STREAMS */

View File

@ -55,8 +55,6 @@
* Private Functions
************************************************************/
#if CONFIG_NFILE_STREAMS > 0
static int lib_mode2oflags(const char *mode)
{
int oflags = 0;
@ -126,14 +124,10 @@ static int lib_mode2oflags(const char *mode)
return oflags;
}
#endif /* CONFIG_NFILE_STREAMS */
/************************************************************
* Public Functions
************************************************************/
#if CONFIG_NFILE_STREAMS > 0
FAR struct file_struct *lib_fdopen(int fd, const char *mode,
FAR struct filelist *flist,
FAR struct streamlist *slist)
@ -232,5 +226,3 @@ FILE *fopen(const char *path, const char *mode)
}
return ret;
}
#endif /* CONFIG_NFILE_STREAMS */

View File

@ -79,8 +79,6 @@
* fwrite
************************************************************/
#if CONFIG_NFILE_STREAMS > 0
size_t fread(void *ptr, size_t size, size_t n_items, FILE *stream)
{
size_t full_size = n_items * (size_t)size;
@ -99,5 +97,4 @@ size_t fread(void *ptr, size_t size, size_t n_items, FILE *stream)
return items_read;
}
#endif /* CONFIG_NFILE_STREAMS */

View File

@ -41,8 +41,6 @@
#include <limits.h>
#include <string.h>
#if CONFIG_NFILE_STREAMS > 0
/************************************************************
* Definitions
************************************************************/
@ -123,4 +121,3 @@ char *gets(char *s)
return ret;
}
#endif /* CONFIG_NFILE_STREAMS */

View File

@ -85,8 +85,6 @@
* lib_fread
************************************************************/
#if CONFIG_NFILE_STREAMS > 0
ssize_t lib_fread(void *ptr, size_t count, FILE *stream)
{
unsigned char *dest = (unsigned char*)ptr;
@ -260,4 +258,3 @@ ssize_t lib_fread(void *ptr, size_t count, FILE *stream)
return bytes_read;
}
#endif /* CONFIG_NFILE_STREAMS */

View File

@ -83,8 +83,6 @@
* lib_fwrite
************************************************************/
#if CONFIG_NFILE_STREAMS > 0
ssize_t lib_fwrite(const void *ptr, size_t count, FILE *stream)
#if CONFIG_STDIO_BUFFER_SIZE > 0
{
@ -164,4 +162,3 @@ ssize_t lib_fwrite(const void *ptr, size_t count, FILE *stream)
}
#endif /* CONFIG_STDIO_BUFFER_SIZE */
#endif /* CONFIG_NFILE_STREAMS */

View File

@ -88,8 +88,6 @@
* stdout.
************************************************************/
#if CONFIG_NFILE_STREAMS > 0
int puts(const char *s)
{
int nwritten;
@ -115,4 +113,3 @@ int puts(const char *s)
return nput;
}
#endif /* CONFIG_NFILE_STREAMS */

View File

@ -98,7 +98,7 @@ int lib_rawvprintf(const char *fmt, va_list ap)
struct lib_stream_s stream;
/* Wrap the stdout in a stream object and let lib_vsprintf
/* Wrap the low-level output in a stream object and let lib_vsprintf
* do the work.
*/

View File

@ -45,8 +45,6 @@
* Private Functions
************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0
static void rawstream_putc(struct lib_stream_s *this, int ch)
{
struct lib_rawstream_s *rthis = (struct lib_rawstream_s *)this;
@ -77,6 +75,3 @@ void lib_rawstream(struct lib_rawstream_s *rawstream, int fd)
rawstream->fd = fd;
}
#endif /* CONFIG_NFILE_DESCRIPTORS */

View File

@ -71,8 +71,6 @@
* Public Functions
************************************************************/
#if CONFIG_NFILE_STREAMS > 0
void stream_semtake(FAR struct streamlist *list)
{
/* Take the semaphore (perhaps waiting) */
@ -92,5 +90,4 @@ void stream_semgive(FAR struct streamlist *list)
sem_post(&list->sl_sem);
}
#endif /* CONFIG_NFILE_STREAMS */

View File

@ -88,8 +88,6 @@
* fgetc
**********************************************************/
#if CONFIG_NFILE_STREAMS > 0
int ungetc(int c, FILE *stream)
{
#if CONFIG_NUNGET_CHARS > 0
@ -121,4 +119,3 @@ int ungetc(int c, FILE *stream)
}
}
#endif /* CONFIG_NFILE_STREAMS */

View File

@ -83,8 +83,6 @@
* vprintf
**********************************************************/
#if CONFIG_NFILE_STREAMS > 0
int vprintf(const char *fmt, va_list ap)
{
/* vfprintf into stdout */
@ -92,5 +90,3 @@ int vprintf(const char *fmt, va_list ap)
return vfprintf(stdout, fmt, ap);
}
#endif /* CONFIG_NFILE_STREAMS */