2007-09-02 17:32:03 +02:00
|
|
|
############################################################################
|
2007-11-18 15:32:06 +01:00
|
|
|
# lib/Makefile
|
2007-02-18 00:21:28 +01:00
|
|
|
#
|
2008-01-08 01:19:24 +01:00
|
|
|
# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
2007-02-18 00:21:28 +01:00
|
|
|
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
|
|
|
#
|
|
|
|
# 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.
|
2007-09-02 17:32:03 +02:00
|
|
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
2007-02-18 00:21:28 +01: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-09-02 17:32:03 +02:00
|
|
|
###########################################################################
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
-include $(TOPDIR)/Make.defs
|
|
|
|
|
|
|
|
ASRCS =
|
2007-02-28 00:59:20 +01:00
|
|
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2007-06-09 21:11:00 +02:00
|
|
|
MISC_SRCS = lib_init.c lib_filesem.c
|
|
|
|
ifneq ($(CONFIG_NFILE_STREAMS),0)
|
|
|
|
MISC_SRCS += lib_streamsem.c
|
|
|
|
endif
|
|
|
|
|
2007-11-18 15:32:06 +01:00
|
|
|
STRING_SRCS = lib_memset.c lib_memcpy.c lib_memcmp.c lib_memmove.c \
|
|
|
|
lib_strcpy.c lib_strncpy.c lib_strcmp.c lib_strncmp.c \
|
2007-11-20 16:42:11 +01:00
|
|
|
lib_strlen.c lib_strdup.c lib_strcat.c lib_strncat.c \
|
|
|
|
lib_strtol.c lib_strchr.c lib_strrchr.c lib_strspn.c \
|
|
|
|
lib_strcspn.c lib_strtok.c lib_strtokr.c lib_strerror.c
|
2007-07-01 19:37:11 +02:00
|
|
|
|
2007-02-18 00:21:28 +01:00
|
|
|
CTYPE_SRCS =
|
2007-06-09 21:11:00 +02:00
|
|
|
|
2008-01-09 02:13:24 +01:00
|
|
|
STDIO_SRCS = lib_printf.c lib_rawprintf.c lib_lowprintf.c lib_dbg.c \
|
|
|
|
lib_sprintf.c lib_snprintf.c lib_libsprintf.c lib_vsprintf.c \
|
|
|
|
lib_vsnprintf.c lib_libvsprintf.c lib_memstream.c \
|
|
|
|
lib_lowstream.c lib_nullstream.c lib_sscanf.c
|
2007-07-01 19:37:11 +02:00
|
|
|
|
2007-06-09 21:11:00 +02:00
|
|
|
ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
|
|
|
|
STDIO_SRCS += lib_rawstream.c
|
|
|
|
ifneq ($(CONFIG_NFILE_STREAMS),0)
|
2008-02-01 23:32:16 +01:00
|
|
|
STDIO_SRCS += lib_fopen.c lib_fclose.c lib_fread.c lib_libfread.c lib_fseek.c \
|
|
|
|
lib_fgetc.c lib_fgets.c lib_gets.c lib_fwrite.c lib_libfwrite.c \
|
2008-02-05 19:13:13 +01:00
|
|
|
lib_fflush.c lib_rdflush.c lib_wrflush.c lib_fputc.c lib_puts.c \
|
|
|
|
lib_fputs.c lib_ungetc.c lib_vprintf.c lib_fprintf.c lib_vfprintf.c \
|
|
|
|
lib_stdstream.c
|
2007-06-09 21:11:00 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2007-02-18 00:21:28 +01:00
|
|
|
STDLIB_SRCS = lib_getenv.c lib_rand.c
|
2007-06-09 21:11:00 +02:00
|
|
|
|
2007-02-18 00:21:28 +01:00
|
|
|
MATH_SRCS = lib_rint.c
|
2007-06-09 21:11:00 +02:00
|
|
|
|
2007-06-10 20:13:03 +02:00
|
|
|
UNISTD_SRCS = lib_getopt.c
|
|
|
|
|
2007-12-11 15:23:58 +01:00
|
|
|
NET_SRCS = lib_htons.c lib_htonl.c lib_inetntoa.c lib_etherntoa.c
|
2007-09-02 17:32:03 +02:00
|
|
|
|
2007-07-01 19:37:11 +02:00
|
|
|
LIBGEN_SRCS = lib_basename.c lib_dirname.c
|
|
|
|
|
2007-02-18 00:21:28 +01:00
|
|
|
SQ_SRCS = sq_addlast.c sq_addfirst.c sq_addafter.c \
|
|
|
|
sq_rem.c sq_remlast.c sq_remfirst.c sq_remafter.c
|
2007-06-09 21:11:00 +02:00
|
|
|
|
2007-02-18 00:21:28 +01:00
|
|
|
DQ_SRCS = dq_addlast.c dq_addfirst.c dq_addafter.c dq_addbefore.c \
|
|
|
|
dq_rem.c dq_remlast.c dq_remfirst.c
|
|
|
|
|
2007-09-02 17:32:03 +02:00
|
|
|
CSRCS = $(MISC_SRCS) $(STRING_SRCS) $(CTYPE_SRCS) $(STDIO_SRCS) $(STDLIB_SRCS) \
|
|
|
|
$(MATH_SRCS) $(UNISTD_SRCS) $(NET_SRCS) $(LIBGEN_SRCS) $(SQ_SRCS) $(DQ_SRCS)
|
2007-02-28 00:59:20 +01:00
|
|
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
SRCS = $(ASRCS) $(CSRCS)
|
|
|
|
OBJS = $(AOBJS) $(COBJS)
|
|
|
|
|
2007-02-21 22:55:16 +01:00
|
|
|
BIN = liblib$(LIBEXT)
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
all: $(BIN)
|
|
|
|
|
2007-02-28 00:59:20 +01:00
|
|
|
$(AOBJS): %$(OBJEXT): %.S
|
2008-01-08 18:06:21 +01:00
|
|
|
$(call ASSEMBLE, $<, $@)
|
2007-02-18 00:21:28 +01:00
|
|
|
|
2007-02-28 00:59:20 +01:00
|
|
|
$(COBJS): %$(OBJEXT): %.c
|
2008-01-08 18:06:21 +01:00
|
|
|
$(call COMPILE, $<, $@)
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
$(BIN): $(OBJS)
|
2008-01-08 14:02:47 +01:00
|
|
|
@( for obj in $(OBJS) ; do \
|
2008-01-08 18:06:21 +01:00
|
|
|
$(call ARCHIVE, $@, $${obj}); \
|
2007-02-21 22:55:16 +01:00
|
|
|
done ; )
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
.depend: Makefile $(SRCS)
|
2008-01-08 14:02:47 +01:00
|
|
|
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
2008-01-08 14:41:00 +01:00
|
|
|
@touch $@
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
depend: .depend
|
|
|
|
|
|
|
|
clean:
|
2008-01-10 19:23:08 +01:00
|
|
|
@rm -f $(BIN) *~ .*.swp
|
|
|
|
$(call CLEAN)
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
distclean: clean
|
2008-01-10 19:23:08 +01:00
|
|
|
@rm -f Make.dep .depend
|
2007-02-18 00:21:28 +01:00
|
|
|
|
|
|
|
-include Make.dep
|