From a72ff3b651c8b4a13c4791fb1829c94ed0ce88ed Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 13 Aug 2012 22:27:06 +0000 Subject: [PATCH] Make the lib/ subdirectory build more like other directories git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5025 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- nuttx/arch/Kconfig | 2 +- nuttx/drivers/serial/serial.c | 22 +++++++++------ nuttx/lib/Makefile | 43 ++++++------------------------ nuttx/lib/dirent/Make.defs | 12 +++++++-- nuttx/lib/libgen/Make.defs | 12 ++++++--- nuttx/lib/math/Make.defs | 12 ++++++--- nuttx/lib/misc/Make.defs | 17 +++++++----- nuttx/lib/mqueue/Make.defs | 15 ++++++++--- nuttx/lib/net/Make.defs | 15 ++++++++--- nuttx/lib/pthread/Make.defs | 15 ++++++++--- nuttx/lib/queue/Make.defs | 15 ++++++++--- nuttx/lib/sched/Make.defs | 11 +++++--- nuttx/lib/semaphore/Make.defs | 13 ++++++--- nuttx/lib/signal/Make.defs | 17 ++++++++---- nuttx/lib/stdio/Make.defs | 19 ++++++++----- nuttx/lib/stdio/lib_rawoutstream.c | 2 +- nuttx/lib/stdlib/Make.defs | 8 +++++- nuttx/lib/string/Make.defs | 9 ++++++- nuttx/lib/termios/Make.defs | 17 +++++++++--- nuttx/lib/time/Make.defs | 13 ++++++--- nuttx/lib/unistd/Make.defs | 15 ++++++++--- 21 files changed, 201 insertions(+), 103 deletions(-) diff --git a/nuttx/arch/Kconfig b/nuttx/arch/Kconfig index 253151a3bc..6e0e0fb9da 100644 --- a/nuttx/arch/Kconfig +++ b/nuttx/arch/Kconfig @@ -20,7 +20,7 @@ config ARCH_ARM config ARCH_AVR bool "AVR" ---help--- - Atmel 9-bit bit AVR and 32-bit AVR32 architectures + Atmel 8-bit bit AVR and 32-bit AVR32 architectures config ARCH_HC bool "Freescale HC" diff --git a/nuttx/drivers/serial/serial.c b/nuttx/drivers/serial/serial.c index c0ebd245a0..9ffcd75dc9 100644 --- a/nuttx/drivers/serial/serial.c +++ b/nuttx/drivers/serial/serial.c @@ -241,7 +241,7 @@ static int uart_putxmitchar(FAR uart_dev_t *dev, int ch) * Name: uart_irqwrite ************************************************************************************/ -static ssize_t uart_irqwrite(FAR uart_dev_t *dev, FAR const char *buffer, size_t buflen) +static inline ssize_t uart_irqwrite(FAR uart_dev_t *dev, FAR const char *buffer, size_t buflen) { ssize_t ret = buflen; @@ -250,14 +250,17 @@ static ssize_t uart_irqwrite(FAR uart_dev_t *dev, FAR const char *buffer, size_t for (; buflen; buflen--) { int ch = *buffer++; - uart_putc(ch); - /* If this is the console, then we should replace LF with LF-CR */ + /* If this is the console, then we should replace LF with CR-LF */ if (ch == '\n') { uart_putc('\r'); } + + /* Output the character, using the low-level direct UART interfaces */ + + uart_putc(ch); } return ret; @@ -274,14 +277,17 @@ static ssize_t uart_write(FAR struct file *filep, FAR const char *buffer, size_t ssize_t nread = buflen; int ret; - /* We may receive console writes through this path from - * interrupt handlers and from debug output in the IDLE task! - * In these cases, we will need to do things a little - * differently. + /* We may receive console writes through this path from interrupt handlers and + * from debug output in the IDLE task! In these cases, we will need to do things + * a little differently. */ if (up_interrupt_context() || getpid() == 0) { + /* up_putc() will be used to generate the output in a busy-wait loop. + * up_putc() is only available for the console device. + */ + if (dev->isconsole) { irqstate_t flags = irqsave(); @@ -291,7 +297,7 @@ static ssize_t uart_write(FAR struct file *filep, FAR const char *buffer, size_t } else { - return ERROR; + return -EPERM; } } diff --git a/nuttx/lib/Makefile b/nuttx/lib/Makefile index 772c6f6a80..fc8f0c4dda 100644 --- a/nuttx/lib/Makefile +++ b/nuttx/lib/Makefile @@ -34,6 +34,13 @@ ########################################################################### -include $(TOPDIR)/Make.defs + +ASRCS = +CSRCS = + +DEPPATH := --dep-path . +VPATH := . + include stdio/Make.defs include stdlib/Make.defs include unistd/Make.defs @@ -52,41 +59,12 @@ include termios/Make.defs include queue/Make.defs include misc/Make.defs -ASRCS = AOBJS = $(ASRCS:.S=$(OBJEXT)) - -CSRCS = $(STDIO_SRCS) $(STDLIB_SRCS) $(UNISTD_SRCS) $(SCHED_SRCS) \ - $(STRING_SRCS) $(PTHREAD_SRCS) $(SEM_SRCS) $(SIG_SRCS) $(MQUEUE_SRCS) \ - $(MATH_SRCS) $(NET_SRCS) $(TIME_SRCS) $(LIBGEN_SRCS) \ - $(DIRENT_SRCS) $(TERMIOS_SRCS) \ - $(QUEUE_SRCS) $(MISC_SRCS) $(REGEX_SRCS) $(CRC_SRCS) $(DBG_SRCS) COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) -ROOTDEPPATH = --dep-path . -STDIODEPPATH = --dep-path stdio -STDLIBDEPPATH = --dep-path stdlib -UNISTDDEPPATH = --dep-path unistd -SCHEDDEPPATH = --dep-path sched -STRINGDEPPATH = --dep-path string -PTHREADDEPPATH = --dep-path pthread -SEMDEPPATH = --dep-path semaphore -SIGDEPPATH = --dep-path signal -MQDEPPATH = --dep-path mqueue -MATHDEPPATH = --dep-path math -NETDEPPATH = --dep-path net -TIMEDEPPATH = --dep-path time -LIBGENDEPPATH = --dep-path libgen -DIRENTDEPPATH = --dep-path dirent -TERMIOSDEPPATH = --dep-path termios -QUEUEDEPPATH = --dep-path queue -MISCDEPPATH = --dep-path misc - -VPATH = stdio:stdlib:unistd:sched:string:pthread:semaphore:signal:mqueue -VPATH += :math:net:time:libgen:dirent:termios:queue:misc - UBIN = libulib$(LIBEXT) KBIN = libklib$(LIBEXT) BIN = liblib$(LIBEXT) @@ -121,12 +99,7 @@ $(KBIN): uclean .kernlib endif .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(STDIODEPPATH) $(STDLIBDEPPATH) \ - $(UNISTDDEPPATH) $(SCHEDDEPPATH) $(STRINGDEPPATH) $(PTHREADDEPPATH) \ - $(SEMDEPPATH) $(SIGDEPPATH) $(MQDEPPATH) $(MATHDEPPATH) $(NETDEPPATH) \ - $(TIMEDEPPATH) $(LIBGENDEPPATH) $(DIRENTDEPPATH) $(TERMIOSDEPPATH) \ - $(QUEUEDEPPATH) $(MISCDEPPATH) \ - $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + @$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep @touch $@ depend: .depend diff --git a/nuttx/lib/dirent/Make.defs b/nuttx/lib/dirent/Make.defs index d9dc8c29b7..cc1d6b7839 100644 --- a/nuttx/lib/dirent/Make.defs +++ b/nuttx/lib/dirent/Make.defs @@ -33,8 +33,16 @@ # ############################################################################ -DIRENT_SRCS = ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) -DIRENT_SRCS += lib_readdirr.c lib_telldir.c + +# Add the dirent C files to the build + +CSRCS += lib_readdirr.c lib_telldir.c + +# Add the dirent directory to the build + +DEPPATH += --dep-path dirent +VPATH += :dirent + endif diff --git a/nuttx/lib/libgen/Make.defs b/nuttx/lib/libgen/Make.defs index 93214eadb3..f126455124 100644 --- a/nuttx/lib/libgen/Make.defs +++ b/nuttx/lib/libgen/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # lib/libgen/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 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 @@ -33,5 +33,11 @@ # ############################################################################ -LIBGEN_SRCS = lib_basename.c lib_dirname.c +# Add the libgen C files to the build +CSRCS += lib_basename.c lib_dirname.c + +# Add the libgen directory to the build + +DEPPATH += --dep-path libgen +VPATH += :libgen diff --git a/nuttx/lib/math/Make.defs b/nuttx/lib/math/Make.defs index c3b0712989..126cd2f471 100644 --- a/nuttx/lib/math/Make.defs +++ b/nuttx/lib/math/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # lib/math/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 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 @@ -33,5 +33,11 @@ # ############################################################################ -MATH_SRCS = lib_rint.c lib_fixedmath.c lib_b16sin.c lib_b16cos.c lib_b16atan2.c +# Add the math C files to the build +CSRCS += lib_rint.c lib_fixedmath.c lib_b16sin.c lib_b16cos.c lib_b16atan2.c + +# Add the math directory to the build + +DEPPATH += --dep-path math +VPATH += :math diff --git a/nuttx/lib/misc/Make.defs b/nuttx/lib/misc/Make.defs index 8892f71e60..484f822d0f 100644 --- a/nuttx/lib/misc/Make.defs +++ b/nuttx/lib/misc/Make.defs @@ -33,18 +33,23 @@ # ############################################################################ -MISC_SRCS = lib_init.c lib_filesem.c +# Add the internal C files to the build + +CSRCS += lib_init.c lib_filesem.c ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) ifneq ($(CONFIG_NFILE_STREAMS),0) -MISC_SRCS += lib_streamsem.c +CSRCS += lib_streamsem.c endif endif -REGEX_SRCS = lib_match.c +# Add the miscellaneous C files to the build -CRC_SRCS = lib_crc32.c - -DBG_SRCS = lib_dbg.c lib_dumpbuffer.c +CSRCS += lib_match.c +CSRCS += lib_crc32.c +CSRCS += lib_dbg.c lib_dumpbuffer.c +# Add the misc directory to the build +DEPPATH += --dep-path misc +VPATH += :misc diff --git a/nuttx/lib/mqueue/Make.defs b/nuttx/lib/mqueue/Make.defs index cd2091e993..40dc6c13e6 100644 --- a/nuttx/lib/mqueue/Make.defs +++ b/nuttx/lib/mqueue/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # lib/mqueue/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 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 @@ -34,6 +34,15 @@ ############################################################################ ifneq ($(CONFIG_DISABLE_MQUEUE),y) -MQUEUE_SRCS = mq_setattr.c mq_getattr.c + +# Add the mqueue C files to the build + +CSRCS += mq_setattr.c mq_getattr.c + +# Add the mqueue directory to the build + +DEPPATH += --dep-path mqueue +VPATH += :mqueue + endif diff --git a/nuttx/lib/net/Make.defs b/nuttx/lib/net/Make.defs index 94ac6db036..ae041bd2c5 100644 --- a/nuttx/lib/net/Make.defs +++ b/nuttx/lib/net/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # lib/net/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 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 @@ -33,5 +33,12 @@ # ############################################################################ -NET_SRCS = lib_etherntoa.c lib_htons.c lib_htonl.c lib_inetaddr.c -NET_SRCS += lib_inetntoa.c lib_inetntop.c lib_inetpton.c +# Add the networking C files to the build + +CSRCS += lib_etherntoa.c lib_htons.c lib_htonl.c lib_inetaddr.c +CSRCS += lib_inetntoa.c lib_inetntop.c lib_inetpton.c + +# Add the net directory to the build + +DEPPATH += --dep-path net +VPATH += :net diff --git a/nuttx/lib/pthread/Make.defs b/nuttx/lib/pthread/Make.defs index 47211f9b93..a1eba7bb0a 100644 --- a/nuttx/lib/pthread/Make.defs +++ b/nuttx/lib/pthread/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # lib/pthread/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 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 @@ -33,7 +33,9 @@ # ############################################################################ -PTHREAD_SRCS = pthread_attrinit.c pthread_attrdestroy.c \ +# Add the pthread C files to the build + +CSRCS += pthread_attrinit.c pthread_attrdestroy.c \ pthread_attrsetschedpolicy.c pthread_attrgetschedpolicy.c \ pthread_attrsetinheritsched.c pthread_attrgetinheritsched.c \ pthread_attrsetstacksize.c pthread_attrgetstacksize.c \ @@ -45,5 +47,10 @@ PTHREAD_SRCS = pthread_attrinit.c pthread_attrdestroy.c \ pthread_mutexattrgetpshared.c pthread_mutexattrsetpshared.c ifeq ($(CONFIG_MUTEX_TYPES),y) -PTHREAD_SRCS += pthread_mutexattrsettype.c pthread_mutexattrgettype.c +CSRCS += pthread_mutexattrsettype.c pthread_mutexattrgettype.c endif + +# Add the pthread directory to the build + +DEPPATH += --dep-path pthread +VPATH += :pthread diff --git a/nuttx/lib/queue/Make.defs b/nuttx/lib/queue/Make.defs index 94e8125e7c..976e7a2b87 100644 --- a/nuttx/lib/queue/Make.defs +++ b/nuttx/lib/queue/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # lib/queue/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 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 @@ -33,8 +33,15 @@ # ############################################################################ -QUEUE_SRCS = sq_addlast.c sq_addfirst.c sq_addafter.c \ +# Add the queue C files to the build + +CSRCS += sq_addlast.c sq_addfirst.c sq_addafter.c \ sq_rem.c sq_remlast.c sq_remfirst.c sq_remafter.c -QUEUE_SRCS += dq_addlast.c dq_addfirst.c dq_addafter.c dq_addbefore.c \ +CSRCS += dq_addlast.c dq_addfirst.c dq_addafter.c dq_addbefore.c \ dq_rem.c dq_remlast.c dq_remfirst.c + +# Add the queue directory to the build + +DEPPATH += --dep-path queue +VPATH += :queue diff --git a/nuttx/lib/sched/Make.defs b/nuttx/lib/sched/Make.defs index 939cb983fa..f398b755e0 100644 --- a/nuttx/lib/sched/Make.defs +++ b/nuttx/lib/sched/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # lib/sched/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 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 @@ -33,6 +33,11 @@ # ############################################################################ -SCHED_SRCS = sched_getprioritymax.c sched_getprioritymin.c +# Add the sched C files to the build +CSRCS += sched_getprioritymax.c sched_getprioritymin.c +# Add the sched directory to the build + +DEPPATH += --dep-path sched +VPATH += :sched diff --git a/nuttx/lib/semaphore/Make.defs b/nuttx/lib/semaphore/Make.defs index 996d320fea..fdc0fe7d54 100644 --- a/nuttx/lib/semaphore/Make.defs +++ b/nuttx/lib/semaphore/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # lib/semaphore/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 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 @@ -33,4 +33,11 @@ # ############################################################################ -SEM_SRCS = sem_init.c sem_getvalue.c +# Add the semaphore C files to the build + +CSRCS += sem_init.c sem_getvalue.c + +# Add the semaphore directory to the build + +DEPPATH += --dep-path semaphore +VPATH += :semaphore diff --git a/nuttx/lib/signal/Make.defs b/nuttx/lib/signal/Make.defs index 0c66efa73f..e27da9b2e8 100644 --- a/nuttx/lib/signal/Make.defs +++ b/nuttx/lib/signal/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # lib/signal/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 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 @@ -34,7 +34,14 @@ ############################################################################ ifneq ($(CONFIG_DISABLE_SIGNALS),y) -SIG_SRCS = sig_emptyset.c sig_fillset.c sig_addset.c sig_delset.c sig_ismember.c + +# Add the signal C files to the build + +CSRCS += sig_emptyset.c sig_fillset.c sig_addset.c sig_delset.c sig_ismember.c + +# Add the signal directory to the build + +DEPPATH += --dep-path signal +VPATH += :signal + endif - - diff --git a/nuttx/lib/stdio/Make.defs b/nuttx/lib/stdio/Make.defs index ddccaca719..1165d53547 100644 --- a/nuttx/lib/stdio/Make.defs +++ b/nuttx/lib/stdio/Make.defs @@ -33,7 +33,9 @@ # ############################################################################ -STDIO_SRCS = lib_fileno.c lib_printf.c lib_rawprintf.c lib_lowprintf.c \ +# Add the stdio C files to the build + +CSRCS += lib_fileno.c lib_printf.c lib_rawprintf.c lib_lowprintf.c \ lib_sprintf.c lib_asprintf.c lib_snprintf.c lib_libsprintf.c \ lib_vsprintf.c lib_avsprintf.c lib_vsnprintf.c lib_libvsprintf.c \ lib_meminstream.c lib_memoutstream.c lib_lowinstream.c \ @@ -41,9 +43,9 @@ STDIO_SRCS = lib_fileno.c lib_printf.c lib_rawprintf.c lib_lowprintf.c \ lib_nulloutstream.c lib_sscanf.c ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) -STDIO_SRCS += lib_rawinstream.c lib_rawoutstream.c +CSRCS += lib_rawinstream.c lib_rawoutstream.c ifneq ($(CONFIG_NFILE_STREAMS),0) -STDIO_SRCS += lib_fopen.c lib_fclose.c lib_fread.c lib_libfread.c lib_fseek.c \ +CSRCS += lib_fopen.c lib_fclose.c lib_fread.c lib_libfread.c lib_fseek.c \ lib_ftell.c lib_fsetpos.c lib_fgetpos.c lib_fgetc.c lib_fgets.c \ lib_gets.c lib_fwrite.c lib_libfwrite.c lib_fflush.c \ lib_libflushall.c lib_libfflush.c lib_rdflush.c lib_wrflush.c \ @@ -53,13 +55,18 @@ endif endif ifeq ($(CONFIG_SYSLOG),y) -STDIO_SRCS += lib_syslogstream.c +CSRCS += lib_syslogstream.c endif ifeq ($(CONFIG_LIBC_FLOATINGPOINT),y) -STDIO_SRCS += lib_dtoa.c +CSRCS += lib_dtoa.c endif ifeq ($(CONFIG_STDIO_LINEBUFFER),y) -STDIO_SRCS += lib_libnoflush.c +CSRCS += lib_libnoflush.c endif + +# Add the stdio directory to the build + +DEPPATH += --dep-path stdio +VPATH += :stdio diff --git a/nuttx/lib/stdio/lib_rawoutstream.c b/nuttx/lib/stdio/lib_rawoutstream.c index b4a20958b3..6adf9b53db 100644 --- a/nuttx/lib/stdio/lib_rawoutstream.c +++ b/nuttx/lib/stdio/lib_rawoutstream.c @@ -72,7 +72,7 @@ static void rawoutstream_putc(FAR struct lib_outstream_s *this, int ch) /* The only expected error is EINTR, meaning that the write operation * was awakened by a signal. Zero would not be a valid return value - * either. + * from write(). */ DEBUGASSERT(nwritten < 0 && get_errno() == EINTR); diff --git a/nuttx/lib/stdlib/Make.defs b/nuttx/lib/stdlib/Make.defs index 3119ecda45..76e285808a 100644 --- a/nuttx/lib/stdlib/Make.defs +++ b/nuttx/lib/stdlib/Make.defs @@ -33,6 +33,12 @@ # ############################################################################ -STDLIB_SRCS = lib_abs.c lib_abort.c lib_imaxabs.c lib_labs.c lib_llabs.c \ +# Add the stdlib C files to the build + +CSRCS += lib_abs.c lib_abort.c lib_imaxabs.c lib_labs.c lib_llabs.c \ lib_rand.c lib_qsort.c +# Add the stdlib directory to the build + +DEPPATH += --dep-path stdlib +VPATH += :stdlib diff --git a/nuttx/lib/string/Make.defs b/nuttx/lib/string/Make.defs index 86fdaba027..495634a9ee 100644 --- a/nuttx/lib/string/Make.defs +++ b/nuttx/lib/string/Make.defs @@ -33,7 +33,9 @@ # ############################################################################ -STRING_SRCS = lib_checkbase.c lib_isbasedigit.c lib_memset.c lib_memchr.c \ +# Add the string C files to the build + +CSRCS += lib_checkbase.c lib_isbasedigit.c lib_memset.c lib_memchr.c \ lib_memccpy.c lib_memcpy.c lib_memcmp.c lib_memmove.c lib_skipspace.c \ lib_strcasecmp.c lib_strcat.c lib_strchr.c lib_strcpy.c lib_strcmp.c \ lib_strcspn.c lib_strdup.c lib_strerror.c lib_strlen.c lib_strnlen.c \ @@ -41,3 +43,8 @@ STRING_SRCS = lib_checkbase.c lib_isbasedigit.c lib_memset.c lib_memchr.c \ lib_strndup.c lib_strcasestr.c lib_strpbrk.c lib_strrchr.c\ lib_strspn.c lib_strstr.c lib_strtok.c lib_strtokr.c lib_strtol.c \ lib_strtoll.c lib_strtoul.c lib_strtoull.c lib_strtod.c + +# Add the string directory to the build + +DEPPATH += --dep-path string +VPATH += :string diff --git a/nuttx/lib/termios/Make.defs b/nuttx/lib/termios/Make.defs index c0a090bd55..a6bb77f835 100644 --- a/nuttx/lib/termios/Make.defs +++ b/nuttx/lib/termios/Make.defs @@ -33,11 +33,22 @@ # ############################################################################ -TERMIOS_SRCS = +# termios.h support requires file descriptors and that CONFIG_SERIAL_TERMIOS +# is defined ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) +ifeq ($(CONFIG_SERIAL_TERMIOS),y) -TERMIOS_SRCS += lib_cfgetspeed.c lib_cfsetspeed.c lib_tcflush.c -TERMIOS_SRCS += lib_tcgetattr.c lib_tcsetattr.c +# Add the termios C files to the build + +CSRCS += lib_cfgetspeed.c lib_cfsetspeed.c lib_tcflush.c +CSRCS += lib_tcgetattr.c lib_tcsetattr.c + +# Add the termios directory to the build + +DEPPATH += --dep-path termios +VPATH += termios endif +endif + diff --git a/nuttx/lib/time/Make.defs b/nuttx/lib/time/Make.defs index d65ba50f61..ab74142291 100644 --- a/nuttx/lib/time/Make.defs +++ b/nuttx/lib/time/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # lib/time/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 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 @@ -33,5 +33,12 @@ # ############################################################################ -TIME_SRCS = lib_mktime.c lib_gmtime.c lib_gmtimer.c lib_strftime.c \ +# Add the time C files to the build + +CSRCS += lib_mktime.c lib_gmtime.c lib_gmtimer.c lib_strftime.c \ lib_calendar2utc.c lib_daysbeforemonth.c lib_isleapyear.c lib_time.c + +# Add the time directory to the build + +DEPPATH += --dep-path time +VPATH += :time diff --git a/nuttx/lib/unistd/Make.defs b/nuttx/lib/unistd/Make.defs index 90f1724062..e1441a48d3 100644 --- a/nuttx/lib/unistd/Make.defs +++ b/nuttx/lib/unistd/Make.defs @@ -1,8 +1,8 @@ ############################################################################ # lib/unistd/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2011-2012 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 @@ -33,10 +33,17 @@ # ############################################################################ -UNISTD_SRCS = lib_getopt.c lib_getoptargp.c lib_getoptindp.c lib_getoptoptp.c +# Add the unistd C files to the build + +CSRCS += lib_getopt.c lib_getoptargp.c lib_getoptindp.c lib_getoptoptp.c + ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) ifneq ($(CONFIG_DISABLE_ENVIRON),y) -UNISTD_SRCS += lib_chdir.c lib_getcwd.c +CSRCS += lib_chdir.c lib_getcwd.c endif endif +# Add the unistd directory to the build + +DEPPATH += --dep-path unistd +VPATH += :unistd