diff --git a/lib/Makefile b/lib/Makefile index e33e9dddeb..76bd1b74bd 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -41,27 +41,16 @@ include string/Make.defs include math/Make.defs include net/Make.defs include time/Make.defs +include libgen/Make.defs include queue/Make.defs +include misc/Make.defs ASRCS = AOBJS = $(ASRCS:.S=$(OBJEXT)) -MISC_SRCS = lib_init.c lib_filesem.c -ifneq ($(CONFIG_NFILE_STREAMS),0) -MISC_SRCS += lib_streamsem.c -endif - -LIBGEN_SRCS = lib_basename.c lib_dirname.c - -REGEX_SRCS = lib_match.c - -CRC_SRCS = lib_crc32.c - -DBG_SRCS = lib_dbg.c lib_dumpbuffer.c - -CSRCS = $(MISC_SRCS) $(CTYPE_SRCS) $(STDIO_SRCS) $(STDLIB_SRCS) $(UNISTD_SRCS) \ - $(STRING_SRCS) $(MATH_SRCS) $(NET_SRCS) $(TIME_SRCS) $(LIBGEN_SRCS) \ - $(REGEX_SRCS) $(CRC_SRCS) $(QUEUE_SRCS) $(DBG_SRCS) +CSRCS = $(STDIO_SRCS) $(STDLIB_SRCS) $(UNISTD_SRCS) $(STRING_SRCS) \ + $(MATH_SRCS) $(NET_SRCS) $(TIME_SRCS) $(LIBGEN_SRCS) \ + $(QUEUE_SRCS) $(MISC_SRCS) $(REGEX_SRCS) $(CRC_SRCS) $(DBG_SRCS) COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) @@ -75,8 +64,10 @@ STRINGDEPPATH = --dep-path string MATHDEPPATH = --dep-path math NETDEPPATH = --dep-path net TIMEDEPPATH = --dep-path time +LIBGENDEPPATH = --dep-path libgen QUEUEDEPPATH = --dep-path queue -VPATH = stdio:stdlib:unistd:string:math:net:time:queue +MISCDEPPATH = --dep-path misc +VPATH = stdio:stdlib:unistd:string:math:net:time:libgen:queue:misc BIN = liblib$(LIBEXT) @@ -96,7 +87,7 @@ $(BIN): $(OBJS) .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) $(STDIODEPPATH) $(STDLIBDEPPATH) \ $(UNISTDDEPPATH) $(STRINGDEPPATH) $(MATHDEPPATH) $(NETDEPPATH) \ - $(TIMEDEPPATH) $(QUEUEDEPPATH) \ + $(TIMEDEPPATH) $(LIBGENDEPPATH) $(QUEUEDEPPATH) $(MISCDEPPATH) \ $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep @touch $@ diff --git a/lib/libgen/Make.defs b/lib/libgen/Make.defs new file mode 100644 index 0000000000..93214eadb3 --- /dev/null +++ b/lib/libgen/Make.defs @@ -0,0 +1,37 @@ +############################################################################ +# lib/libgen/Make.defs +# +# Copyright (C) 2011 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. +# +############################################################################ + +LIBGEN_SRCS = lib_basename.c lib_dirname.c + diff --git a/lib/lib_basename.c b/lib/libgen/lib_basename.c similarity index 97% rename from lib/lib_basename.c rename to lib/libgen/lib_basename.c index 5bb7118291..5741d976a9 100644 --- a/lib/lib_basename.c +++ b/lib/libgen/lib_basename.c @@ -1,7 +1,7 @@ /**************************************************************************** - * lib/unistd/lib_basename.c + * lib/libgen/lib_basename.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/lib/lib_dirname.c b/lib/libgen/lib_dirname.c similarity index 97% rename from lib/lib_dirname.c rename to lib/libgen/lib_dirname.c index 7ed6c04c6e..c416d8aca3 100644 --- a/lib/lib_dirname.c +++ b/lib/libgen/lib_dirname.c @@ -1,7 +1,7 @@ /**************************************************************************** - * lib/unistd/lib_dirname.c + * lib/libgen/lib_dirname.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/lib/misc/Make.defs b/lib/misc/Make.defs new file mode 100644 index 0000000000..680180a951 --- /dev/null +++ b/lib/misc/Make.defs @@ -0,0 +1,47 @@ +############################################################################ +# lib/misc/Make.defs +# +# Copyright (C) 2011 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. +# +############################################################################ + +MISC_SRCS = lib_init.c lib_filesem.c +ifneq ($(CONFIG_NFILE_STREAMS),0) +MISC_SRCS += lib_streamsem.c +endif + +REGEX_SRCS = lib_match.c + +CRC_SRCS = lib_crc32.c + +DBG_SRCS = lib_dbg.c lib_dumpbuffer.c + + diff --git a/lib/lib_crc32.c b/lib/misc/lib_crc32.c similarity index 98% rename from lib/lib_crc32.c rename to lib/misc/lib_crc32.c index 77c34558d8..f851598e01 100755 --- a/lib/lib_crc32.c +++ b/lib/misc/lib_crc32.c @@ -1,9 +1,9 @@ /************************************************************************************************ - * lib/unistd/lib_crc32.c + * lib/misc/lib_crc32.c * * This file is a part of NuttX: * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved. * * The logic in this file was developed by Gary S. Brown: * diff --git a/lib/lib_dbg.c b/lib/misc/lib_dbg.c similarity index 97% rename from lib/lib_dbg.c rename to lib/misc/lib_dbg.c index 43feea8b1c..e4b1071cda 100644 --- a/lib/lib_dbg.c +++ b/lib/misc/lib_dbg.c @@ -1,7 +1,7 @@ /**************************************************************************** - * lib/unistd/lib_dbg.c + * lib/misc/lib_dbg.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/lib/lib_dumpbuffer.c b/lib/misc/lib_dumpbuffer.c similarity index 97% rename from lib/lib_dumpbuffer.c rename to lib/misc/lib_dumpbuffer.c index f3e1b5b2bf..1f1f54e8db 100644 --- a/lib/lib_dumpbuffer.c +++ b/lib/misc/lib_dumpbuffer.c @@ -1,7 +1,7 @@ /**************************************************************************** - * lib/unistd/lib_dumpbuffer.c + * lib/misc/lib_dumpbuffer.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/lib/lib_match.c b/lib/misc/lib_match.c similarity index 98% rename from lib/lib_match.c rename to lib/misc/lib_match.c index e76e8b4cac..18e0632ec6 100644 --- a/lib/lib_match.c +++ b/lib/misc/lib_match.c @@ -1,5 +1,5 @@ /**************************************************************************** - * match.c - simple shell-style filename matcher + * lib/misc/lib_match.c - simple shell-style filename matcher * * Simple shell-style filename pattern matcher written by Jef Poskanzer * This pattern matcher only handles '?', '*' and '**', and multiple