diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 06e62cb235..1c0c265ab6 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -1358,7 +1358,7 @@ include/

Normally the logic in this file builds to a single library (libc.a). However, if NuttX is built as a separately compiled kernel (with CONFIG_BUILD_PROTECTED=y or CONFIG_BUILD_KERNEL=y), then the contents of this directory are built as two libraries: - One for use by user programs (libuc.a) and one for use only within the <kernel> space (libkc.a). + One for use by user programs (libc.a) and one for use only within the <kernel> space (libkc.a).

These user/kernel space libraries (along with the sycalls of nuttx/syscall) are needed to support the two differing protection domains. diff --git a/arch/arm/src/Makefile b/arch/arm/src/Makefile index c1fd722d91..ca4b467375 100644 --- a/arch/arm/src/Makefile +++ b/arch/arm/src/Makefile @@ -107,7 +107,6 @@ USRCS = $(UASRCS) $(UCSRCS) UOBJS = $(UAOBJS) $(UCOBJS) KBIN = libkarch$(LIBEXT) -UBIN = libuarch$(LIBEXT) BIN = libarch$(LIBEXT) LDFLAGS += $(ARCHSCRIPT) @@ -173,11 +172,16 @@ $(AOBJS) $(UAOBJS) $(HEAD_OBJ): %$(OBJEXT): %.S $(COBJS) $(UCOBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) -$(BIN) $(KBIN): $(OBJS) +ifeq ($(CONFIG_BUILD_FLAT),y) +$(BIN): $(OBJS) $(call ARCHIVE, $@, $(OBJS)) - -$(UBIN): $(UOBJS) +else +$(BIN): $(UOBJS) $(call ARCHIVE, $@, $(UOBJS)) +endif + +$(KBIN): $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) board$(DELIM)libboard$(LIBEXT): $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)" @@ -224,7 +228,6 @@ ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif $(call DELFILE, $(KBIN)) - $(call DELFILE, $(UBIN)) $(call DELFILE, $(BIN)) $(call CLEAN) diff --git a/arch/or1k/src/Makefile b/arch/or1k/src/Makefile index 22d22e2a46..808e194d60 100644 --- a/arch/or1k/src/Makefile +++ b/arch/or1k/src/Makefile @@ -98,7 +98,6 @@ USRCS = $(UASRCS) $(UCSRCS) UOBJS = $(UAOBJS) $(UCOBJS) KBIN = libkarch$(LIBEXT) -UBIN = libuarch$(LIBEXT) BIN = libarch$(LIBEXT) LDFLAGS += $(ARCHSCRIPT) @@ -166,11 +165,16 @@ $(AOBJS) $(UAOBJS) $(HEAD_OBJ): %$(OBJEXT): %.S $(COBJS) $(UCOBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) -$(BIN) $(KBIN): $(OBJS) +ifeq ($(CONFIG_BUILD_FLAT),y) +$(BIN): $(OBJS) $(call ARCHIVE, $@, $(OBJS)) - -$(UBIN): $(UOBJS) +else +$(BIN): $(UOBJS) $(call ARCHIVE, $@, $(UOBJS)) +endif + +$(KBIN): $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) board$(DELIM)libboard$(LIBEXT): $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)" @@ -217,7 +221,6 @@ ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif $(call DELFILE, $(KBIN)) - $(call DELFILE, $(UBIN)) $(call DELFILE, $(BIN)) $(call CLEAN) diff --git a/arch/risc-v/src/Makefile b/arch/risc-v/src/Makefile index e7078985bf..9ba5ec8a34 100644 --- a/arch/risc-v/src/Makefile +++ b/arch/risc-v/src/Makefile @@ -104,7 +104,6 @@ USRCS = $(UASRCS) $(UCSRCS) UOBJS = $(UAOBJS) $(UCOBJS) KBIN = libkarch$(LIBEXT) -UBIN = libuarch$(LIBEXT) BIN = libarch$(LIBEXT) LDFLAGS += $(ARCHSCRIPT) @@ -165,12 +164,16 @@ $(AOBJS) $(UAOBJS) $(HEAD_OBJ): %$(OBJEXT): %.S $(COBJS) $(UCOBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) -$(BIN) $(KBIN): $(OBJS) +ifeq ($(CONFIG_BUILD_FLAT),y) +$(BIN): $(OBJS) $(call ARCHIVE, $@, $(OBJS)) - @$(MAKE) depend - -$(UBIN): $(UOBJS) +else +$(BIN): $(UOBJS) $(call ARCHIVE, $@, $(UOBJS)) +endif + +$(KBIN): $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) board/libboard$(LIBEXT): $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)" @@ -217,7 +220,6 @@ ifeq ($(BOARDMAKE),y) $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" clean endif $(call DELFILE, $(KBIN)) - $(call DELFILE, $(UBIN)) $(call DELFILE, $(BIN)) $(call DELFILE, $(HEAD_OBJ)) $(call CLEAN) diff --git a/arch/x86_64/src/Makefile b/arch/x86_64/src/Makefile index b95a5f1c26..702d24982d 100644 --- a/arch/x86_64/src/Makefile +++ b/arch/x86_64/src/Makefile @@ -64,7 +64,6 @@ SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) KBIN = libkarch$(LIBEXT) -UBIN = libuarch$(LIBEXT) BIN = libarch$(LIBEXT) # Override in Make.defs if linker is not 'ld' @@ -126,11 +125,16 @@ $(AOBJS): %$(OBJEXT): %.S $(COBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) -$(BIN) $(KBIN): $(OBJS) +ifeq ($(CONFIG_BUILD_FLAT),y) +$(BIN): $(OBJS) $(call ARCHIVE, $@, $(OBJS)) - -$(UBIN): $(UOBJS) +else +$(BIN): $(UOBJS) $(call ARCHIVE, $@, $(UOBJS)) +endif + +$(KBIN): $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) board/libboard$(LIBEXT): $(Q) $(MAKE) -C board TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)" diff --git a/include/nuttx/fs/fs.h b/include/nuttx/fs/fs.h index d4e1614604..3758db421c 100644 --- a/include/nuttx/fs/fs.h +++ b/include/nuttx/fs/fs.h @@ -54,7 +54,7 @@ * * This is only important when compiling libraries (libc or libnx) that are * used both by the OS (libkc.a and libknx.a) or by the applications - * (libuc.a and libunx.a). In that case, the correct interface must be + * (libc.a and libnx.a). In that case, the correct interface must be * used for the build context. * * REVISIT: In the flat build, the same functions must be used both by diff --git a/include/nuttx/mqueue.h b/include/nuttx/mqueue.h index 04a416c326..7cc8bcbb8d 100644 --- a/include/nuttx/mqueue.h +++ b/include/nuttx/mqueue.h @@ -65,7 +65,7 @@ * * This is only important when compiling libraries (libc or libnx) that are * used both by the OS (libkc.a and libknx.a) or by the applications - * (libuc.a and libunx.a). In that case, the correct interface must be + * (libc.a and libnx.a). In that case, the correct interface must be * used for the build context. * * REVISIT: In the flat build, the same functions must be used both by @@ -179,7 +179,7 @@ struct task_group_s; /* Forward reference */ * ****************************************************************************/ -int nxmq_send(mqd_t mqdes, FAR const char *msg, size_t msglen,\ +int nxmq_send(mqd_t mqdes, FAR const char *msg, size_t msglen, unsigned int prio); /**************************************************************************** diff --git a/include/nuttx/net/net.h b/include/nuttx/net/net.h index be16ae6ef2..bf24060605 100644 --- a/include/nuttx/net/net.h +++ b/include/nuttx/net/net.h @@ -51,7 +51,7 @@ * * This is only important when compiling libraries (libc or libnx) that are * used both by the OS (libkc.a and libknx.a) or by the applications - * (libuc.a and libunx.a). In that case, the correct interface must be + * (libc.a and libnx.a). In that case, the correct interface must be * used for the build context. * * REVISIT: In the flat build, the same functions must be used both by diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h index d45f1f05ae..27b12e4073 100644 --- a/include/nuttx/sched.h +++ b/include/nuttx/sched.h @@ -141,7 +141,7 @@ * * This is only important when compiling libraries (libc or libnx) that are * used both by the OS (libkc.a and libknx.a) or by the applications - * (libuc.a and libunx.a). In that case, the correct interface must be + * (libc.a and libnx.a). In that case, the correct interface must be * used for the build context. * * REVISIT: In the flat build, the same functions must be used both by diff --git a/include/nuttx/semaphore.h b/include/nuttx/semaphore.h index 03feb2c36f..ff73e425a1 100644 --- a/include/nuttx/semaphore.h +++ b/include/nuttx/semaphore.h @@ -50,7 +50,7 @@ * * This is only important when compiling libraries (libc or libnx) that are * used both by the OS (libkc.a and libknx.a) or by the applications - * (libuc.a and libunx.a). In that case, the correct interface must be + * (libc.a and libnx.a). In that case, the correct interface must be * used for the build context. * * REVISIT: In the flat build, the same functions must be used both by diff --git a/include/nuttx/signal.h b/include/nuttx/signal.h index 2a33f4dda2..cf078e69aa 100644 --- a/include/nuttx/signal.h +++ b/include/nuttx/signal.h @@ -66,7 +66,7 @@ struct sigwork_s * * This is only important when compiling libraries (libc or libnx) that are * used both by the OS (libkc.a and libknx.a) or by the applications - * (libuc.a and libunx.a). In that case, the correct interface must be + * (libc.a and libnx.a). In that case, the correct interface must be * used for the build context. * * REVISIT: In the flat build, the same functions must be used both by diff --git a/libs/libc/.gitignore b/libs/libc/.gitignore index 458e42741b..692ab244f5 100644 --- a/libs/libc/.gitignore +++ b/libs/libc/.gitignore @@ -1,5 +1,4 @@ /Make_bin.dep -/Make_ubin.dep /Make_kbin.dep /exec_symtab.c /modlib_symtab.c diff --git a/libs/libc/Makefile b/libs/libc/Makefile index d8fccf7e80..2068f663b7 100644 --- a/libs/libc/Makefile +++ b/libs/libc/Makefile @@ -143,7 +143,6 @@ COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS)) SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) -UBIN = libuc$(LIBEXT) KBIN = libkc$(LIBEXT) BIN ?= libc$(LIBEXT) @@ -156,7 +155,8 @@ $(AOBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.S $(COBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.c $(call COMPILE, $<, $@) -# C library for the flat build +# C library for the flat build and +# the user phase of the two-pass kernel build $(BIN): $(OBJS) $(call ARCHIVE, $@, $(OBJS)) @@ -164,13 +164,6 @@ ifeq ($(CONFIG_LIB_ZONEINFO_ROMFS),y) $(Q) $(MAKE) -C zoneinfo all TOPDIR=$(TOPDIR) BIN=$(BIN) endif -# C library for the user phase of the two-pass kernel build - -ifneq ($(BIN),$(UBIN)) -$(UBIN): - $(Q) $(MAKE) $(UBIN) BIN=$(UBIN) BINDIR=ubin TOPDIR=$(TOPDIR) EXTRAFLAGS="$(EXTRAFLAGS)" -endif - # C library for the kernel phase of the two-pass kernel build ifneq ($(BIN),$(KBIN)) @@ -188,10 +181,8 @@ endif # Dependencies .depend: Makefile $(SRCS) -ifeq ($(CONFIG_BUILD_FLAT),y) $(Q) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >bin/Make.dep -else - $(Q) $(MKDEP) --obj-path ubin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >ubin/Make.dep +ifneq ($(CONFIG_BUILD_FLAT),y) $(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) $(KDEFINE) -- $(SRCS) >kbin/Make.dep endif ifeq ($(CONFIG_LIB_ZONEINFO_ROMFS),y) @@ -205,11 +196,9 @@ depend: .depend clean: $(Q) $(MAKE) -C bin clean TOPDIR=$(TOPDIR) - $(Q) $(MAKE) -C ubin clean TOPDIR=$(TOPDIR) $(Q) $(MAKE) -C kbin clean TOPDIR=$(TOPDIR) $(Q) $(MAKE) -C zoneinfo clean TOPDIR=$(TOPDIR) BIN=$(BIN) $(call DELFILE, $(BIN)) - $(call DELFILE, $(UBIN)) $(call DELFILE, $(KBIN)) $(call CLEAN) @@ -217,15 +206,12 @@ clean: distclean: clean $(Q) $(MAKE) -C bin distclean TOPDIR=$(TOPDIR) - $(Q) $(MAKE) -C ubin distclean TOPDIR=$(TOPDIR) $(Q) $(MAKE) -C kbin distclean TOPDIR=$(TOPDIR) $(Q) $(MAKE) -C zoneinfo distclean TOPDIR=$(TOPDIR) BIN=$(BIN) $(call DELFILE, exec_symtab.c) $(call DELFILE, bin/Make.dep) - $(call DELFILE, ubin/Make.dep) $(call DELFILE, kbin/Make.dep) $(call DELFILE, .depend) -include bin/Make.dep --include ubin/Make.dep -include kbin/Make.dep diff --git a/libs/libc/ubin/.gitignore b/libs/libc/ubin/.gitignore deleted file mode 100644 index 4e358a8c57..0000000000 --- a/libs/libc/ubin/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/*.asm -/*.obj -/*.rel -/*.lst -/*.sym -/*.adb -/*.lib -/*.src diff --git a/libs/libc/ubin/Makefile b/libs/libc/ubin/Makefile deleted file mode 100644 index e8aca33bad..0000000000 --- a/libs/libc/ubin/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -############################################################################ -# libs/libc/ubin/Makefile -# -# Copyright (C) 2013 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. -# -########################################################################### - --include $(TOPDIR)/Make.defs - -all: -.PHONY: clean distclean - -# Clean Targets: - -clean: - $(call CLEAN) - -# Deep clean -- removes all traces of the configuration - -distclean: clean diff --git a/libs/libnx/.gitignore b/libs/libnx/.gitignore index 77e9ad0bfd..d710724d43 100644 --- a/libs/libnx/.gitignore +++ b/libs/libnx/.gitignore @@ -1,5 +1,4 @@ /Make_bin.dep -/Make_ubin.dep /Make_kbin.dep /.depend /*.lib diff --git a/libs/libnx/Makefile b/libs/libnx/Makefile index 7625803910..ac7268fc8a 100644 --- a/libs/libnx/Makefile +++ b/libs/libnx/Makefile @@ -63,7 +63,6 @@ COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS)) SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) -UBIN = libunx$(LIBEXT) KBIN = libknx$(LIBEXT) BIN ?= libnx$(LIBEXT) @@ -233,18 +232,12 @@ $(AOBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.S $(COBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.c $(call COMPILE, $<, $@) -# NX library for the flat build +# NX library for the flat build and +# the user phase of the two-pass kernel build $(BIN): $(OBJS) $(call ARCHIVE, $@, $(OBJS)) -# NX library for the user phase of the two-pass kernel build - -ifneq ($(BIN),$(UBIN)) -$(UBIN): - $(Q) $(MAKE) $(UBIN) BIN=$(UBIN) BINDIR=ubin TOPDIR=$(TOPDIR) EXTRAFLAGS="$(EXTRAFLAGS)" -endif - # NX library for the kernel phase of the two-pass kernel build ifneq ($(BIN),$(KBIN)) @@ -255,10 +248,8 @@ endif # Dependencies .depend: Makefile gensources $(SRCS) -ifeq ($(CONFIG_BUILD_FLAT),y) $(Q) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >bin/Make.dep -else - $(Q) $(MKDEP) --obj-path ubin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >ubin/Make.dep +ifneq ($(CONFIG_BUILD_FLAT),y) $(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) $(KDEFINE) -- $(SRCS) >kbin/Make.dep endif $(Q) touch $@ @@ -273,11 +264,9 @@ context: gensources clean: $(Q) $(MAKE) -C bin clean TOPDIR=$(TOPDIR) - $(Q) $(MAKE) -C ubin clean TOPDIR=$(TOPDIR) $(Q) $(MAKE) -C kbin clean TOPDIR=$(TOPDIR) $(Q) $(MAKE) -C nxfonts -f Makefile.sources clean TOPDIR=$(TOPDIR) EXTRAFLAGS="$(EXTRAFLAGS)" $(call DELFILE, $(BIN)) - $(call DELFILE, $(UBIN)) $(call DELFILE, $(KBIN)) $(call CLEAN) @@ -285,14 +274,11 @@ clean: distclean: clean $(Q) $(MAKE) -C bin distclean TOPDIR=$(TOPDIR) - $(Q) $(MAKE) -C ubin distclean TOPDIR=$(TOPDIR) $(Q) $(MAKE) -C kbin distclean TOPDIR=$(TOPDIR) $(Q) $(MAKE) -C nxfonts -f Makefile.sources distclean TOPDIR=$(TOPDIR) EXTRAFLAGS="$(EXTRAFLAGS)" $(call DELFILE, bin/Make.dep) - $(call DELFILE, ubin/Make.dep) $(call DELFILE, kbin/Make.dep) $(call DELFILE, .depend) -include bin/Make.dep --include ubin/Make.dep -include kbin/Make.dep diff --git a/libs/libnx/ubin/.gitignore b/libs/libnx/ubin/.gitignore deleted file mode 100644 index 4e358a8c57..0000000000 --- a/libs/libnx/ubin/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/*.asm -/*.obj -/*.rel -/*.lst -/*.sym -/*.adb -/*.lib -/*.src diff --git a/libs/libnx/ubin/Makefile b/libs/libnx/ubin/Makefile deleted file mode 100644 index d4235ec3d4..0000000000 --- a/libs/libnx/ubin/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -############################################################################ -# libs/libnx/ubin/Makefile -# -# Copyright (C) 2013 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. -# -########################################################################### - --include $(TOPDIR)/Make.defs - -all: -.PHONY: clean distclean - -# Clean Targets: - -clean: - $(call CLEAN) - -# Deep clean -- removes all traces of the configuration - -distclean: clean diff --git a/mm/.gitignore b/mm/.gitignore index 77e9ad0bfd..d710724d43 100644 --- a/mm/.gitignore +++ b/mm/.gitignore @@ -1,5 +1,4 @@ /Make_bin.dep -/Make_ubin.dep /Make_kbin.dep /.depend /*.lib diff --git a/mm/Makefile b/mm/Makefile index 5d21edf01e..32fd3f4ca4 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -67,7 +67,6 @@ COBJS = $(patsubst %.c, $(BINDIR)$(DELIM)%$(OBJEXT), $(CSRCS)) SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) -UBIN = libumm$(LIBEXT) KBIN = libkmm$(LIBEXT) BIN ?= libmm$(LIBEXT) @@ -80,18 +79,12 @@ $(AOBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.S $(COBJS): $(BINDIR)$(DELIM)%$(OBJEXT): %.c $(call COMPILE, $<, $@) -# Memory manager for the flat build +# Memory manager for the flat build and +# the user phase of the two-pass kernel build $(BIN): $(OBJS) $(call ARCHIVE, $@, $(OBJS)) -# Memory manager for the user phase of the two-pass kernel build - -ifneq ($(BIN),$(UBIN)) -$(UBIN): - $(Q) $(MAKE) $(UBIN) BIN=$(UBIN) BINDIR=ubin TOPDIR=$(TOPDIR) EXTRAFLAGS="$(EXTRAFLAGS)" -endif - # Memory manager for the kernel phase of the two-pass kernel build ifneq ($(BIN),$(KBIN)) @@ -102,10 +95,8 @@ endif # Dependencies .depend: Makefile $(SRCS) -ifeq ($(CONFIG_BUILD_FLAT),y) $(Q) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >bin/Make.dep -else - $(Q) $(MKDEP) --obj-path ubin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >ubin/Make.dep +ifneq ($(CONFIG_BUILD_FLAT),y) $(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) $(KDEFINE) -- $(SRCS) >kbin/Make.dep endif $(Q) touch $@ @@ -116,10 +107,8 @@ depend: .depend clean: $(Q) $(MAKE) -C bin clean TOPDIR=$(TOPDIR) - $(Q) $(MAKE) -C ubin clean TOPDIR=$(TOPDIR) $(Q) $(MAKE) -C kbin clean TOPDIR=$(TOPDIR) $(call DELFILE, $(BIN)) - $(call DELFILE, $(UBIN)) $(call DELFILE, $(KBIN)) $(call CLEAN) @@ -127,13 +116,10 @@ clean: distclean: clean $(Q) $(MAKE) -C bin distclean TOPDIR=$(TOPDIR) - $(Q) $(MAKE) -C ubin distclean TOPDIR=$(TOPDIR) $(Q) $(MAKE) -C kbin distclean TOPDIR=$(TOPDIR) $(call DELFILE, bin/Make.dep) - $(call DELFILE, ubin/Make.dep) $(call DELFILE, kbin/Make.dep) $(call DELFILE, .depend) -include bin/Make.dep --include ubin/Make.dep -include kbin/Make.dep diff --git a/mm/ubin/.gitignore b/mm/ubin/.gitignore deleted file mode 100644 index 4e358a8c57..0000000000 --- a/mm/ubin/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/*.asm -/*.obj -/*.rel -/*.lst -/*.sym -/*.adb -/*.lib -/*.src diff --git a/mm/ubin/Makefile b/mm/ubin/Makefile deleted file mode 100644 index af29b32a44..0000000000 --- a/mm/ubin/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -############################################################################ -# mm/ubin/Makefile -# -# Copyright (C) 2013 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. -# -########################################################################### - --include $(TOPDIR)/Make.defs - -all: -.PHONY: clean distclean - -# Clean Targets: - -clean: - $(call CLEAN) - -# Deep clean -- removes all traces of the configuration - -distclean: clean diff --git a/tools/KernelLibs.mk b/tools/KernelLibs.mk index 16df064c73..93c4b127a7 100644 --- a/tools/KernelLibs.mk +++ b/tools/KernelLibs.mk @@ -56,8 +56,8 @@ NUTTXLIBS += staging$(DELIM)libboards$(LIBEXT) NUTTXLIBS += staging$(DELIM)libstubs$(LIBEXT) staging$(DELIM)libkc$(LIBEXT) NUTTXLIBS += staging$(DELIM)libkmm$(LIBEXT) staging$(DELIM)libkarch$(LIBEXT) -USERLIBS += staging$(DELIM)libproxies$(LIBEXT) staging$(DELIM)libuc$(LIBEXT) -USERLIBS += staging$(DELIM)libumm$(LIBEXT) staging$(DELIM)libuarch$(LIBEXT) +USERLIBS += staging$(DELIM)libproxies$(LIBEXT) staging$(DELIM)libc$(LIBEXT) +USERLIBS += staging$(DELIM)libmm$(LIBEXT) staging$(DELIM)libarch$(LIBEXT) # Add libraries for C++ support. CXX, CXXFLAGS, and COMPILEXX must # be defined in Make.defs for this to work! @@ -87,10 +87,10 @@ NUTTXLIBS += staging$(DELIM)libfs$(LIBEXT) staging$(DELIM)libbinfmt$(LIBEXT) ifeq ($(CONFIG_NX),y) NUTTXLIBS += staging$(DELIM)libgraphics$(LIBEXT) NUTTXLIBS += staging$(DELIM)libknx$(LIBEXT) -USERLIBS += staging$(DELIM)libunx$(LIBEXT) +USERLIBS += staging$(DELIM)libnx$(LIBEXT) else ifeq ($(CONFIG_NXFONTS),y) NUTTXLIBS += staging$(DELIM)libknx$(LIBEXT) -USERLIBS += staging$(DELIM)libunx$(LIBEXT) +USERLIBS += staging$(DELIM)libnx$(LIBEXT) endif # Add libraries for the Audio sub-system diff --git a/tools/LibTargets.mk b/tools/LibTargets.mk index 60665b22d9..6760bfcb17 100644 --- a/tools/LibTargets.mk +++ b/tools/LibTargets.mk @@ -136,78 +136,32 @@ wireless$(DELIM)libwireless$(LIBEXT): context staging$(DELIM)libwireless$(LIBEXT): wireless$(DELIM)libwireless$(LIBEXT) $(Q) $(call INSTALL_LIB,$<,$@) -$(ARCH_SRC)$(DELIM)libarch$(LIBEXT): context - $(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) EXTRAFLAGS="$(KDEFINE) $(EXTRAFLAGS)" - -staging$(DELIM)libarch$(LIBEXT): $(ARCH_SRC)$(DELIM)libarch$(LIBEXT) - $(Q) $(call INSTALL_LIB,$<,$@) - -libs$(DELIM)libdsp$(DELIM)libdsp$(LIBEXT): context - $(Q) $(MAKE) -C libs$(DELIM)libdsp TOPDIR="$(TOPDIR)" libdsp$(LIBEXT) EXTRAFLAGS="$(KDEFINE) $(EXTRAFLAGS)" - -staging$(DELIM)libdsp$(LIBEXT): libs$(DELIM)libdsp$(DELIM)libdsp$(LIBEXT) - $(Q) $(call INSTALL_LIB,$<,$@) - openamp$(DELIM)libopenamp$(LIBEXT): context $(Q) $(MAKE) -C openamp TOPDIR="$(TOPDIR)" libopenamp$(LIBEXT) EXTRAFLAGS="$(KDEFINE) $(EXTRAFLAGS)" staging$(DELIM)libopenamp$(LIBEXT): openamp$(DELIM)libopenamp$(LIBEXT) $(Q) $(call INSTALL_LIB,$<,$@) -# Special case - syscall$(DELIM)libstubs$(LIBEXT): context $(Q) $(MAKE) -C syscall TOPDIR="$(TOPDIR)" libstubs$(LIBEXT) # EXTRAFLAGS="$(KDEFINE) $(EXTRAFLAGS)" staging$(DELIM)libstubs$(LIBEXT): syscall$(DELIM)libstubs$(LIBEXT) $(Q) $(call INSTALL_LIB,$<,$@) +# Special case + +$(ARCH_SRC)$(DELIM)libarch$(LIBEXT): context +ifeq ($(CONFIG_BUILD_FLAT),y) + $(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) EXTRAFLAGS="$(KDEFINE) $(EXTRAFLAGS)" +else + $(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)" +endif + +staging$(DELIM)libarch$(LIBEXT): $(ARCH_SRC)$(DELIM)libarch$(LIBEXT) + $(Q) $(call INSTALL_LIB,$<,$@) + # Possible user-mode builds -libs$(DELIM)libc$(DELIM)libuc$(LIBEXT): context - $(Q) $(MAKE) -C libs$(DELIM)libc TOPDIR="$(TOPDIR)" libuc$(LIBEXT) - -staging$(DELIM)libuc$(LIBEXT): libs$(DELIM)libc$(DELIM)libuc$(LIBEXT) - $(Q) $(call INSTALL_LIB,$<,$@) - -libs$(DELIM)libnx$(DELIM)libunx$(LIBEXT): context - $(Q) $(MAKE) -C libs$(DELIM)libnx TOPDIR="$(TOPDIR)" libunx$(LIBEXT) - -staging$(DELIM)libunx$(LIBEXT): libs$(DELIM)libnx$(DELIM)libunx$(LIBEXT) - $(Q) $(call INSTALL_LIB,$<,$@) - -mm$(DELIM)libumm$(LIBEXT): context - $(Q) $(MAKE) -C mm TOPDIR="$(TOPDIR)" libumm$(LIBEXT) - -staging$(DELIM)libumm$(LIBEXT): mm$(DELIM)libumm$(LIBEXT) - $(Q) $(call INSTALL_LIB,$<,$@) - -$(ARCH_SRC)$(DELIM)libuarch$(LIBEXT): context - $(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" libuarch$(LIBEXT) - -staging$(DELIM)libuarch$(LIBEXT): $(ARCH_SRC)$(DELIM)libuarch$(LIBEXT) - $(Q) $(call INSTALL_LIB,$<,$@) - -libs$(DELIM)libxx$(DELIM)libxx$(LIBEXT): context - $(Q) $(MAKE) -C libs$(DELIM)libxx TOPDIR="$(TOPDIR)" libxx$(LIBEXT) - -staging$(DELIM)libxx$(LIBEXT): libs$(DELIM)libxx$(DELIM)libxx$(LIBEXT) - $(Q) $(call INSTALL_LIB,$<,$@) - -$(APPDIR)$(DELIM)libapps$(LIBEXT): context - $(Q) $(MAKE) -C $(APPDIR) TOPDIR="$(TOPDIR)" - -staging$(DELIM)libapps$(LIBEXT): $(APPDIR)$(DELIM)libapps$(LIBEXT) - $(Q) $(call INSTALL_LIB,$<,$@) - -syscall$(DELIM)libproxies$(LIBEXT): context - $(Q) $(MAKE) -C syscall TOPDIR="$(TOPDIR)" libproxies$(LIBEXT) - -staging$(DELIM)libproxies$(LIBEXT): syscall$(DELIM)libproxies$(LIBEXT) - $(Q) $(call INSTALL_LIB,$<,$@) - -# Possible non-kernel builds - libs$(DELIM)libc$(DELIM)libc$(LIBEXT): context $(Q) $(MAKE) -C libs$(DELIM)libc TOPDIR="$(TOPDIR)" libc$(LIBEXT) @@ -225,3 +179,27 @@ mm$(DELIM)libmm$(LIBEXT): context staging$(DELIM)libmm$(LIBEXT): mm$(DELIM)libmm$(LIBEXT) $(Q) $(call INSTALL_LIB,$<,$@) + +libs$(DELIM)libxx$(DELIM)libxx$(LIBEXT): context + $(Q) $(MAKE) -C libs$(DELIM)libxx TOPDIR="$(TOPDIR)" libxx$(LIBEXT) + +staging$(DELIM)libxx$(LIBEXT): libs$(DELIM)libxx$(DELIM)libxx$(LIBEXT) + $(Q) $(call INSTALL_LIB,$<,$@) + +libs$(DELIM)libdsp$(DELIM)libdsp$(LIBEXT): context + $(Q) $(MAKE) -C libs$(DELIM)libdsp TOPDIR="$(TOPDIR)" libdsp$(LIBEXT) EXTRAFLAGS="$(EXTRAFLAGS)" + +staging$(DELIM)libdsp$(LIBEXT): libs$(DELIM)libdsp$(DELIM)libdsp$(LIBEXT) + $(Q) $(call INSTALL_LIB,$<,$@) + +$(APPDIR)$(DELIM)libapps$(LIBEXT): context + $(Q) $(MAKE) -C $(APPDIR) TOPDIR="$(TOPDIR)" + +staging$(DELIM)libapps$(LIBEXT): $(APPDIR)$(DELIM)libapps$(LIBEXT) + $(Q) $(call INSTALL_LIB,$<,$@) + +syscall$(DELIM)libproxies$(LIBEXT): context + $(Q) $(MAKE) -C syscall TOPDIR="$(TOPDIR)" libproxies$(LIBEXT) + +staging$(DELIM)libproxies$(LIBEXT): syscall$(DELIM)libproxies$(LIBEXT) + $(Q) $(call INSTALL_LIB,$<,$@) diff --git a/tools/ProtectedLibs.mk b/tools/ProtectedLibs.mk index 8edf90a177..816bd7d041 100644 --- a/tools/ProtectedLibs.mk +++ b/tools/ProtectedLibs.mk @@ -57,8 +57,8 @@ NUTTXLIBS += staging$(DELIM)libboards$(LIBEXT) NUTTXLIBS += staging$(DELIM)libstubs$(LIBEXT) staging$(DELIM)libkc$(LIBEXT) NUTTXLIBS += staging$(DELIM)libkmm$(LIBEXT) staging$(DELIM)libkarch$(LIBEXT) -USERLIBS += staging$(DELIM)libproxies$(LIBEXT) staging$(DELIM)libuc$(LIBEXT) -USERLIBS += staging$(DELIM)libumm$(LIBEXT) staging$(DELIM)libuarch$(LIBEXT) +USERLIBS += staging$(DELIM)libproxies$(LIBEXT) staging$(DELIM)libc$(LIBEXT) +USERLIBS += staging$(DELIM)libmm$(LIBEXT) staging$(DELIM)libarch$(LIBEXT) # Add libraries for two pass build support. The special directory pass1 # may be populated so that application generated logic can be included into @@ -102,10 +102,10 @@ NUTTXLIBS += staging$(DELIM)libfs$(LIBEXT) staging$(DELIM)libbinfmt$(LIBEXT) ifeq ($(CONFIG_NX),y) NUTTXLIBS += staging$(DELIM)libgraphics$(LIBEXT) NUTTXLIBS += staging$(DELIM)libknx$(LIBEXT) -USERLIBS += staging$(DELIM)libunx$(LIBEXT) +USERLIBS += staging$(DELIM)libnx$(LIBEXT) else ifeq ($(CONFIG_NXFONTS),y) NUTTXLIBS += staging$(DELIM)libknx$(LIBEXT) -USERLIBS += staging$(DELIM)libunx$(LIBEXT) +USERLIBS += staging$(DELIM)libnx$(LIBEXT) endif # Add libraries for the Audio sub-system