From 5cfde412bb9cbd55db2854939d25c2d8e053aaa5 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 23 Dec 2012 20:22:41 +0000 Subject: Rename namedapp as simply builtin git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5454 42af7a65-404d-4744-a932-0658087f49c3 --- apps/builtin/Makefile | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 apps/builtin/Makefile (limited to 'apps/builtin/Makefile') diff --git a/apps/builtin/Makefile b/apps/builtin/Makefile new file mode 100644 index 000000000..72ba0347f --- /dev/null +++ b/apps/builtin/Makefile @@ -0,0 +1,110 @@ +############################################################################ +# apps/builtin/Makefile +# +# 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 +# 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)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# NSH Library + +# Source and object files + +ASRCS = +CSRCS = builtin.c exec_builtin.c + +ifeq ($(CONFIG_APPS_BINDIR),y) +CSRCS += binfs.c +endif + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + BIN = ..\libapps$(LIBEXT) +else +ifeq ($(WINTOOL),y) + BIN = ..\\libapps$(LIBEXT) +else + BIN = ../libapps$(LIBEXT) +endif +endif + +ROOTDEPPATH = --dep-path . +VPATH = + +# Build Targets + +all: .built +.PHONY: .context context depend clean distclean + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +.built: $(OBJS) + $(call ARCHIVE, $(BIN), $(OBJS)) + $(Q) touch .built + +.context: + @echo "/* List of application requirements, generated during make context. */" > builtin_list.h + @echo "/* List of application entry points, generated during make context. */" > builtin_proto.h + $(Q) touch $@ + +context: .context + +.depend: Makefile $(SRCS) + $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ + +depend: .depend + +clean: + $(call DELFILE, .built) + $(call CLEAN) + +distclean: clean + $(call DELFILE, .context) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + $(call DELFILE, builtin_list.h) + $(call DELFILE, builtin_proto.h) + +-include Make.dep + -- cgit v1.2.3 From 3fe53af6be14a28174eec48b5740dbbe7c1f818a Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 23 Dec 2012 22:17:09 +0000 Subject: Remove .context kludge from apps/ directory git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5455 42af7a65-404d-4744-a932-0658087f49c3 --- apps/ChangeLog.txt | 4 +++ apps/Make.defs | 9 ++++--- apps/Makefile | 9 +------ apps/builtin/Makefile | 33 ++++++++++++++--------- apps/builtin/registry/Makefile | 54 ++++++++++++++++++++++++++++++++++++++ apps/examples/adc/Makefile | 9 ++++--- apps/examples/buttons/Makefile | 9 ++++--- apps/examples/can/Makefile | 9 ++++--- apps/examples/cdcacm/Makefile | 11 +++++--- apps/examples/composite/Makefile | 11 +++++--- apps/examples/cxxtest/Makefile | 9 ++++--- apps/examples/dhcpd/Makefile | 9 ++++--- apps/examples/discover/Makefile | 9 ++++--- apps/examples/ftpc/Makefile | 10 ++++--- apps/examples/ftpd/Makefile | 11 +++++--- apps/examples/hello/Makefile | 9 ++++--- apps/examples/helloxx/Makefile | 9 ++++--- apps/examples/json/Makefile | 9 ++++--- apps/examples/keypadtest/Makefile | 9 ++++--- apps/examples/lcdrw/Makefile | 9 ++++--- apps/examples/modbus/Makefile | 9 ++++--- apps/examples/nettest/Makefile | 9 ++++--- apps/examples/nx/Makefile | 9 ++++--- apps/examples/nxhello/Makefile | 9 ++++--- apps/examples/nximage/Makefile | 9 ++++--- apps/examples/nxlines/Makefile | 9 ++++--- apps/examples/nxtext/Makefile | 9 ++++--- apps/examples/ostest/Makefile | 9 ++++--- apps/examples/pwm/Makefile | 9 ++++--- apps/examples/qencoder/Makefile | 9 ++++--- apps/examples/relays/Makefile | 9 ++++--- apps/examples/telnetd/Makefile | 9 ++++--- apps/examples/tiff/Makefile | 9 ++++--- apps/examples/touchscreen/Makefile | 9 ++++--- apps/examples/usbstorage/Makefile | 11 +++++--- apps/examples/usbterm/Makefile | 9 ++++--- apps/examples/watchdog/Makefile | 9 ++++--- apps/examples/wgetjson/Makefile | 9 ++++--- apps/examples/xmlrpc/Makefile | 9 ++++--- apps/graphics/tiff/Makefile | 1 - apps/interpreters/ficl/Makefile | 1 - apps/modbus/Makefile | 1 - apps/nshlib/Makefile | 1 - apps/system/free/Makefile | 10 ++++--- apps/system/i2c/Makefile | 12 +++++---- apps/system/install/Makefile | 10 ++++--- apps/system/poweroff/Makefile | 10 ++++--- apps/system/ramtron/Makefile | 10 ++++--- apps/system/readline/Makefile | 1 - apps/system/sdcard/Makefile | 10 ++++--- apps/system/sysinfo/Makefile | 10 ++++--- nuttx/Documentation/NuttShell.html | 9 ++----- nuttx/configs/vsn/src/Makefile | 9 ++++--- 53 files changed, 318 insertions(+), 201 deletions(-) create mode 100644 apps/builtin/registry/Makefile (limited to 'apps/builtin/Makefile') diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 886526b18..8999047ef 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -440,4 +440,8 @@ files. It makes sense for 'leaf' Makefiles to have this dependency, but it does not make sense for upper-level Makefiles. * namedapp/: Renamed to builtins in preparation for another change. + * .context: Removed the .context kludge. This causes lots of problems + when changing configurations because there is no easy way to get the + system to rebuild the context. Now, the context will be rebuilt + whenever there is a change in either .config or the Makefile. diff --git a/apps/Make.defs b/apps/Make.defs index 12b351e7f..217137a29 100644 --- a/apps/Make.defs +++ b/apps/Make.defs @@ -34,8 +34,11 @@ # ############################################################################ +BUILTIN_REGISTRY = $(APPDIR)$(DELIM)builtin$(DELIM)registry + define REGISTER - @echo "Register: $1" - @echo "{ \"$1\", $2, $3, $4 }," >> "$(APPDIR)/builtin/builtin_list.h" - @echo "EXTERN int $4(int argc, char *argv[]);" >> "$(APPDIR)/builtin/builtin_proto.h" + $(Q) echo "Register: $1" + $(Q) echo "{ \"$1\", $2, $3, $4 }," > "$(BUILTIN_REGISTRY)$(DELIM)$4.bdat" + $(Q) echo "int $4(int argc, char *argv[]);" > "$(BUILTIN_REGISTRY)$(DELIM)$4.pdat" + $(Q) touch "$(BUILTIN_REGISTRY)$(DELIM).updated" endef diff --git a/apps/Makefile b/apps/Makefile index 299560195..cf6b33cd7 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -132,21 +132,16 @@ $(INSTALLED_APPS): $(BIN): $(INSTALLED_APPS) -.context: +context: ifeq ($(CONFIG_WINDOWS_NATIVE),y) $(Q) for %%G in ($(INSTALLED_APPS)) do ( \ - if exist %%G\.context del /f /q %%G\.context \ $(MAKE) -C %%G TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" context \ ) else $(Q) for dir in $(INSTALLED_APPS) ; do \ - rm -f $$dir/.context ; \ $(MAKE) -C $$dir TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" context ; \ done endif - $(Q) touch $@ - -context: .context .depend: context Makefile $(SRCS) ifeq ($(CONFIG_WINDOWS_NATIVE),y) @@ -183,7 +178,6 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) $(MAKE) -C %%G distclean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" \ ) $(call DELFILE, .config) - $(call DELFILE, .context) $(call DELFILE, .depend) $(Q) ( if exist external ( \ echo ********************************************************" \ @@ -195,7 +189,6 @@ else $(MAKE) -C $$dir distclean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"; \ done $(call DELFILE, .config) - $(call DELFILE, .context) $(call DELFILE, .depend) $(Q) ( if [ -e external ]; then \ echo "********************************************************"; \ diff --git a/apps/builtin/Makefile b/apps/builtin/Makefile index 72ba0347f..6633146e9 100644 --- a/apps/builtin/Makefile +++ b/apps/builtin/Makefile @@ -33,12 +33,9 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs -# NSH Library - # Source and object files ASRCS = @@ -70,7 +67,7 @@ VPATH = # Build Targets all: .built -.PHONY: .context context depend clean distclean +.PHONY: context depend clean distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -78,16 +75,27 @@ $(AOBJS): %$(OBJEXT): %.S $(COBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) -.built: $(OBJS) +builtin_list.h: registry/.updated + $(call DELFILE, builtin_list.h) +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + $(Q) for /f %%G in ('dir /b registry\*.bdat`) do ( type registry\%%G >> builtin_list.h ) +else + $(Q) for file in `ls registry/*.bdat`; do cat $$file >> builtin_list.h; done +endif + +builtin_proto.h: registry/.updated + $(call DELFILE, builtin_proto.h) +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + $(Q) for /f %%G in ('dir /b registry\*.pdat`) do ( type registry\%%G >> builtin_proto.h ) +else + $(Q) for file in `ls registry/*.pdat`; do cat $$file >> builtin_proto.h; done +endif + +.built: builtin_list.h builtin_proto.h $(OBJS) $(call ARCHIVE, $(BIN), $(OBJS)) $(Q) touch .built -.context: - @echo "/* List of application requirements, generated during make context. */" > builtin_list.h - @echo "/* List of application entry points, generated during make context. */" > builtin_proto.h - $(Q) touch $@ - -context: .context +context: .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep @@ -100,11 +108,10 @@ clean: $(call CLEAN) distclean: clean - $(call DELFILE, .context) + $(Q) $(MAKE) -C registry distclean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" $(call DELFILE, Make.dep) $(call DELFILE, .depend) $(call DELFILE, builtin_list.h) $(call DELFILE, builtin_proto.h) -include Make.dep - diff --git a/apps/builtin/registry/Makefile b/apps/builtin/registry/Makefile new file mode 100644 index 000000000..9117f53d6 --- /dev/null +++ b/apps/builtin/registry/Makefile @@ -0,0 +1,54 @@ +############################################################################ +# apps/builtin/registry/Makefile +# +# Copyright (C) 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 +# 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 +include $(APPDIR)/Make.defs + +# NSH Library + +all: +.PHONY: context depend clean distclean + +context: + +depend: + +clean: + $(call CLEAN) + +distclean: clean + $(call DELFILE, *.bdat) + $(call DELFILE, *.pdat) + $(call DELFILE, .updated) diff --git a/apps/examples/adc/Makefile b/apps/examples/adc/Makefile index 69862b383..55bc259e4 100644 --- a/apps/examples/adc/Makefile +++ b/apps/examples/adc/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/buttons/Makefile b/apps/examples/buttons/Makefile index 77c1cd67d..ac1f2f05a 100644 --- a/apps/examples/buttons/Makefile +++ b/apps/examples/buttons/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/can/Makefile b/apps/examples/can/Makefile index 8924797e3..5df96e1e7 100644 --- a/apps/examples/can/Makefile +++ b/apps/examples/can/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/cdcacm/Makefile b/apps/examples/cdcacm/Makefile index e8d03807d..d9e19e906 100644 --- a/apps/examples/cdcacm/Makefile +++ b/apps/examples/cdcacm/Makefile @@ -87,12 +87,17 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(APPNAME1)_main) + +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME2),$(PRIORITY2),$(STACKSIZE2),$(APPNAME2)_main) - @touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/composite/Makefile b/apps/examples/composite/Makefile index 016ccbe3e..b1fe49308 100644 --- a/apps/examples/composite/Makefile +++ b/apps/examples/composite/Makefile @@ -87,14 +87,17 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(APPNAME1)_main) + +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME2),$(PRIORITY2),$(STACKSIZE2),$(APPNAME2)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/cxxtest/Makefile b/apps/examples/cxxtest/Makefile index f0764b6e9..cba9f0a4f 100644 --- a/apps/examples/cxxtest/Makefile +++ b/apps/examples/cxxtest/Makefile @@ -100,13 +100,14 @@ $(CXXOBJS): %$(OBJEXT): %.cxx $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_EXAMPLES_HELLOXX_BUILTIN),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CXX)" -- $(CXXFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/dhcpd/Makefile b/apps/examples/dhcpd/Makefile index a41db5cdd..0522d4cc4 100644 --- a/apps/examples/dhcpd/Makefile +++ b/apps/examples/dhcpd/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/discover/Makefile b/apps/examples/discover/Makefile index 2ce52a18e..b0285fbff 100644 --- a/apps/examples/discover/Makefile +++ b/apps/examples/discover/Makefile @@ -84,13 +84,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/ftpc/Makefile b/apps/examples/ftpc/Makefile index 29960fb94..e09779abd 100644 --- a/apps/examples/ftpc/Makefile +++ b/apps/examples/ftpc/Makefile @@ -83,11 +83,14 @@ $(COBJS): %$(OBJEXT): %.c # Register application -.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif # Create dependencies @@ -102,7 +105,6 @@ clean: $(call CLEAN) distclean: clean - $(call DELFILE, .context) $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/apps/examples/ftpd/Makefile b/apps/examples/ftpd/Makefile index 0b43b85a9..dc53bfdea 100644 --- a/apps/examples/ftpd/Makefile +++ b/apps/examples/ftpd/Makefile @@ -78,14 +78,17 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)ftpd_start.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,ftpd_start,SCHED_PRIORITY_DEFAULT,2048,ftpd_start) + +$(BUILTIN_REGISTRY)$(DELIM)ftpd_stop.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,ftpd_stop,SCHED_PRIORITY_DEFAULT,2048,ftpd_stop) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)ftpd_start.bdat $(BUILTIN_REGISTRY)$(DELIM)ftpd_stop.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/hello/Makefile b/apps/examples/hello/Makefile index 560b0da35..c4e6f735a 100644 --- a/apps/examples/hello/Makefile +++ b/apps/examples/hello/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_EXAMPLES_HELLO_BUILTIN),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/helloxx/Makefile b/apps/examples/helloxx/Makefile index 062da7d58..df1b360a5 100644 --- a/apps/examples/helloxx/Makefile +++ b/apps/examples/helloxx/Makefile @@ -100,13 +100,14 @@ $(CXXOBJS): %$(OBJEXT): %.cxx $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_EXAMPLES_HELLOXX_BUILTIN),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/json/Makefile b/apps/examples/json/Makefile index c3e9203f9..1e42757b8 100644 --- a/apps/examples/json/Makefile +++ b/apps/examples/json/Makefile @@ -81,13 +81,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/keypadtest/Makefile b/apps/examples/keypadtest/Makefile index 3de0556a2..0c40a5c6c 100644 --- a/apps/examples/keypadtest/Makefile +++ b/apps/examples/keypadtest/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/lcdrw/Makefile b/apps/examples/lcdrw/Makefile index ed612e0be..61d6bcce6 100644 --- a/apps/examples/lcdrw/Makefile +++ b/apps/examples/lcdrw/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_EXAMPLES_LCDRW_BUILTIN),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/modbus/Makefile b/apps/examples/modbus/Makefile index d6caefe81..da31c3b52 100644 --- a/apps/examples/modbus/Makefile +++ b/apps/examples/modbus/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/nettest/Makefile b/apps/examples/nettest/Makefile index 085b9406d..e6f56e765 100644 --- a/apps/examples/nettest/Makefile +++ b/apps/examples/nettest/Makefile @@ -116,13 +116,14 @@ $(HOST_BIN): $(HOST_OBJS) $(call ARCHIVE, $(BIN), $(TARG_OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(TARG_SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(TARG_SRCS) >Make.dep diff --git a/apps/examples/nx/Makefile b/apps/examples/nx/Makefile index ad2bee84e..4474a58c3 100644 --- a/apps/examples/nx/Makefile +++ b/apps/examples/nx/Makefile @@ -86,13 +86,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_EXAMPLES_NX_BUILTIN),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/nxhello/Makefile b/apps/examples/nxhello/Makefile index b1ac6f116..52ced123d 100644 --- a/apps/examples/nxhello/Makefile +++ b/apps/examples/nxhello/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_EXAMPLES_NXHELLO_BUILTIN),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/nximage/Makefile b/apps/examples/nximage/Makefile index e2e9201e7..98f04c2d5 100644 --- a/apps/examples/nximage/Makefile +++ b/apps/examples/nximage/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_EXAMPLES_NXIMAGE_BUILTIN),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/nxlines/Makefile b/apps/examples/nxlines/Makefile index cdda7ad8c..9673a5520 100644 --- a/apps/examples/nxlines/Makefile +++ b/apps/examples/nxlines/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/nxtext/Makefile b/apps/examples/nxtext/Makefile index dffe66ba1..738209754 100644 --- a/apps/examples/nxtext/Makefile +++ b/apps/examples/nxtext/Makefile @@ -87,13 +87,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_EXAMPLES_NXTEXT_BUILTIN),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/ostest/Makefile b/apps/examples/ostest/Makefile index 3e78c64e8..dfb500387 100644 --- a/apps/examples/ostest/Makefile +++ b/apps/examples/ostest/Makefile @@ -127,13 +127,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_EXAMPLES_OSTEST_BUILTIN),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/pwm/Makefile b/apps/examples/pwm/Makefile index 3a6f2520a..d33d1c277 100644 --- a/apps/examples/pwm/Makefile +++ b/apps/examples/pwm/Makefile @@ -83,11 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/qencoder/Makefile b/apps/examples/qencoder/Makefile index 7d2427c6b..1caff2ed3 100644 --- a/apps/examples/qencoder/Makefile +++ b/apps/examples/qencoder/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/relays/Makefile b/apps/examples/relays/Makefile index 8e91ab572..17bf7a6a4 100644 --- a/apps/examples/relays/Makefile +++ b/apps/examples/relays/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/telnetd/Makefile b/apps/examples/telnetd/Makefile index 8f5e5b6d2..63876baa0 100644 --- a/apps/examples/telnetd/Makefile +++ b/apps/examples/telnetd/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/tiff/Makefile b/apps/examples/tiff/Makefile index f62209931..853e904a7 100644 --- a/apps/examples/tiff/Makefile +++ b/apps/examples/tiff/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_EXAMPLES_TIFF_BUILTIN),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/touchscreen/Makefile b/apps/examples/touchscreen/Makefile index b3943951e..8761cc5b5 100644 --- a/apps/examples/touchscreen/Makefile +++ b/apps/examples/touchscreen/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/usbstorage/Makefile b/apps/examples/usbstorage/Makefile index 5492e47dc..a1eb77836 100644 --- a/apps/examples/usbstorage/Makefile +++ b/apps/examples/usbstorage/Makefile @@ -87,14 +87,17 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_EXAMPLES_USBMSC_BUILTIN),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(APPNAME1)_main) + +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME2),$(PRIORITY2),$(STACKSIZE2),$(APPNAME2)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/usbterm/Makefile b/apps/examples/usbterm/Makefile index c5fb95331..3b3ca6cd7 100644 --- a/apps/examples/usbterm/Makefile +++ b/apps/examples/usbterm/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_EXAMPLES_USBTERM_BUILTIN),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/watchdog/Makefile b/apps/examples/watchdog/Makefile index 9890959fb..cf947b011 100644 --- a/apps/examples/watchdog/Makefile +++ b/apps/examples/watchdog/Makefile @@ -83,11 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/wgetjson/Makefile b/apps/examples/wgetjson/Makefile index fa8f302c6..38bd8ac04 100644 --- a/apps/examples/wgetjson/Makefile +++ b/apps/examples/wgetjson/Makefile @@ -83,13 +83,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/examples/xmlrpc/Makefile b/apps/examples/xmlrpc/Makefile index 7053f54d3..4756bfabb 100644 --- a/apps/examples/xmlrpc/Makefile +++ b/apps/examples/xmlrpc/Makefile @@ -84,13 +84,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) @touch .built -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ -endif -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/apps/graphics/tiff/Makefile b/apps/graphics/tiff/Makefile index e42091ad9..b5f6c5b73 100644 --- a/apps/graphics/tiff/Makefile +++ b/apps/graphics/tiff/Makefile @@ -90,7 +90,6 @@ clean: $(call CLEAN) distclean: clean - $(call DELFILE, .context) $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/apps/interpreters/ficl/Makefile b/apps/interpreters/ficl/Makefile index 990630fb8..3b2dc7ab9 100644 --- a/apps/interpreters/ficl/Makefile +++ b/apps/interpreters/ficl/Makefile @@ -108,7 +108,6 @@ context: depend: .depend clean: - $(call DELFILE, .context) $(call DELFILE, .built) $(call CLEAN) diff --git a/apps/modbus/Makefile b/apps/modbus/Makefile index d2b148162..27548f3d6 100644 --- a/apps/modbus/Makefile +++ b/apps/modbus/Makefile @@ -111,7 +111,6 @@ clean: $(call CLEAN) distclean: clean - $(call DELFILE, .context) $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/apps/nshlib/Makefile b/apps/nshlib/Makefile index 73325e899..7ddbb67bf 100644 --- a/apps/nshlib/Makefile +++ b/apps/nshlib/Makefile @@ -130,7 +130,6 @@ clean: $(call CLEAN) distclean: clean - $(call DELFILE, .context) $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/apps/system/free/Makefile b/apps/system/free/Makefile index dada00d99..4f6424f50 100644 --- a/apps/system/free/Makefile +++ b/apps/system/free/Makefile @@ -92,11 +92,14 @@ $(COBJS): %$(OBJEXT): %.c # Register application -.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif # Create dependencies @@ -111,7 +114,6 @@ clean: $(call CLEAN) distclean: clean - $(call DELFILE, .context) $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/apps/system/i2c/Makefile b/apps/system/i2c/Makefile index 029d2b6fe..7f42801a9 100644 --- a/apps/system/i2c/Makefile +++ b/apps/system/i2c/Makefile @@ -68,7 +68,7 @@ STACKSIZE = 2048 # Build targets all: .built -.PHONY: .context context .depend depend clean distclean +.PHONY: context .depend depend clean distclean $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -80,11 +80,14 @@ $(COBJS): %$(OBJEXT): %.c $(call ARCHIVE, $(BIN), $(OBJS)) $(Q) touch .built -.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep @@ -97,7 +100,6 @@ clean: $(call CLEAN) distclean: clean - $(call DELFILE, .context) $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/apps/system/install/Makefile b/apps/system/install/Makefile index 6a02d859f..aa65e60ed 100644 --- a/apps/system/install/Makefile +++ b/apps/system/install/Makefile @@ -93,11 +93,14 @@ $(COBJS): %$(OBJEXT): %.c # Register application -.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif # Create dependencies @@ -112,7 +115,6 @@ clean: $(call CLEAN) distclean: clean - $(call DELFILE, .context) $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/apps/system/poweroff/Makefile b/apps/system/poweroff/Makefile index bbceccb9e..0067a13ab 100644 --- a/apps/system/poweroff/Makefile +++ b/apps/system/poweroff/Makefile @@ -93,11 +93,14 @@ $(COBJS): %$(OBJEXT): %.c # Register application -.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif # Create dependencies @@ -112,7 +115,6 @@ clean: $(call CLEAN) distclean: clean - $(call DELFILE, .context) $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/apps/system/ramtron/Makefile b/apps/system/ramtron/Makefile index 9f5af1659..1c92398f3 100644 --- a/apps/system/ramtron/Makefile +++ b/apps/system/ramtron/Makefile @@ -93,11 +93,14 @@ $(COBJS): %$(OBJEXT): %.c # Register application -.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif # Create dependencies @@ -112,7 +115,6 @@ clean: $(call CLEAN) distclean: clean - $(call DELFILE, .context) $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/apps/system/readline/Makefile b/apps/system/readline/Makefile index 3a48d324e..040fd2e28 100644 --- a/apps/system/readline/Makefile +++ b/apps/system/readline/Makefile @@ -100,7 +100,6 @@ clean: $(call CLEAN) distclean: clean - $(call DELFILE, .context) $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/apps/system/sdcard/Makefile b/apps/system/sdcard/Makefile index 6d5d12960..6c580ba86 100644 --- a/apps/system/sdcard/Makefile +++ b/apps/system/sdcard/Makefile @@ -93,11 +93,14 @@ $(COBJS): %$(OBJEXT): %.c # Register application -.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif # Create dependencies @@ -112,7 +115,6 @@ clean: $(call CLEAN) distclean: clean - $(call DELFILE, .context) $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/apps/system/sysinfo/Makefile b/apps/system/sysinfo/Makefile index fa6aebf71..d233aa3d8 100644 --- a/apps/system/sysinfo/Makefile +++ b/apps/system/sysinfo/Makefile @@ -93,11 +93,14 @@ $(COBJS): %$(OBJEXT): %.c # Register application -.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif # Create dependencies @@ -112,7 +115,6 @@ clean: $(call CLEAN) distclean: clean - $(call DELFILE, .context) $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/nuttx/Documentation/NuttShell.html b/nuttx/Documentation/NuttShell.html index cc3f078dd..7ad96da79 100644 --- a/nuttx/Documentation/NuttShell.html +++ b/nuttx/Documentation/NuttShell.html @@ -3349,11 +3349,7 @@ int hello_main(int argc, char *argv[])

  • - And finally, the apps/examples/Makefilewill execute the context target in all configured examplesub-directores, getting us finally to apps/examples/Makefile (which is covered below).

    -
  • -

    - At the conclusion of the context phase, the apps/Makefile will touch a file called .context in the apps/ directory, preventing any further configurations during any subsequent context phase build attempts. -

    + And finally, the apps/examples/Makefile will execute the context target in all configured examplesub-directores, getting us finally to apps/examples/Makefile which is covered below.

    @@ -3417,9 +3413,8 @@ STACKSIZE = 2048 When the hello command is executed, it will start the task with entry point hello_main() with the default priority and with a stack size of 2K.

      -.context:
      +context:
         $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main)
      -  @touch $@
       
    diff --git a/nuttx/configs/vsn/src/Makefile b/nuttx/configs/vsn/src/Makefile index a71c80c8a..b0eba0a20 100644 --- a/nuttx/configs/vsn/src/Makefile +++ b/nuttx/configs/vsn/src/Makefile @@ -85,11 +85,14 @@ libboard$(LIBEXT): $(OBJS) # Register application -.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif # Create dependencies -- cgit v1.2.3 From 424d1af00f29a81ec98b9b91bc518b70fb8e2013 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 24 Dec 2012 13:15:57 +0000 Subject: Some fixes to apps/builtin/registry need to handle some additional cases git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5456 42af7a65-404d-4744-a932-0658087f49c3 --- apps/ChangeLog.txt | 5 ++++- apps/Make.defs | 6 ++++++ apps/builtin/Makefile | 2 ++ apps/builtin/registry/Makefile | 9 ++++++++- apps/examples/adc/Makefile | 2 +- apps/examples/buttons/Makefile | 2 +- apps/examples/can/Makefile | 2 +- apps/examples/cdcacm/Makefile | 4 ++-- apps/examples/composite/Makefile | 4 ++-- apps/examples/cxxtest/Makefile | 2 +- apps/examples/dhcpd/Makefile | 2 +- apps/examples/discover/Makefile | 2 +- apps/examples/ftpc/Makefile | 2 +- apps/examples/ftpd/Makefile | 4 ++-- apps/examples/hello/Makefile | 2 +- apps/examples/helloxx/Makefile | 2 +- apps/examples/json/Makefile | 2 +- apps/examples/keypadtest/Makefile | 2 +- apps/examples/lcdrw/Makefile | 2 +- apps/examples/modbus/Makefile | 2 +- apps/examples/nettest/Makefile | 2 +- apps/examples/nx/Makefile | 2 +- apps/examples/nxhello/Makefile | 2 +- apps/examples/nximage/Makefile | 2 +- apps/examples/nxlines/Makefile | 2 +- apps/examples/nxtext/Makefile | 2 +- apps/examples/ostest/Makefile | 2 +- apps/examples/pwm/Makefile | 2 +- apps/examples/qencoder/Makefile | 2 +- apps/examples/relays/Makefile | 2 +- apps/examples/telnetd/Makefile | 2 +- apps/examples/tiff/Makefile | 2 +- apps/examples/touchscreen/Makefile | 2 +- apps/examples/usbstorage/Makefile | 4 ++-- apps/examples/usbterm/Makefile | 2 +- apps/examples/watchdog/Makefile | 2 +- apps/examples/wgetjson/Makefile | 2 +- apps/examples/xmlrpc/Makefile | 2 +- apps/system/free/Makefile | 2 +- apps/system/i2c/Makefile | 2 +- apps/system/install/Makefile | 2 +- apps/system/poweroff/Makefile | 2 +- apps/system/ramtron/Makefile | 2 +- apps/system/sdcard/Makefile | 2 +- apps/system/sysinfo/Makefile | 2 +- 45 files changed, 65 insertions(+), 47 deletions(-) (limited to 'apps/builtin/Makefile') diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 8999047ef..09a4f634d 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -440,8 +440,11 @@ files. It makes sense for 'leaf' Makefiles to have this dependency, but it does not make sense for upper-level Makefiles. * namedapp/: Renamed to builtins in preparation for another change. - * .context: Removed the .context kludge. This causes lots of problems + * .context: Removed the .context kludge. This caused lots of problems when changing configurations because there is no easy way to get the system to rebuild the context. Now, the context will be rebuilt whenever there is a change in either .config or the Makefile. + * builtin/registry: Updated new built-in registration logic to handle + cases where (1) old apps/.config is used, and (2) applications ared + removed, not just added. diff --git a/apps/Make.defs b/apps/Make.defs index 217137a29..c62999804 100644 --- a/apps/Make.defs +++ b/apps/Make.defs @@ -36,6 +36,12 @@ BUILTIN_REGISTRY = $(APPDIR)$(DELIM)builtin$(DELIM)registry +ifeq ($(CONFIG_NUTTX_NEWCONFIG),y) +DEPCONFIG = $(TOPDIR)/.config +else +DEPCONFIG = $(TOPDIR)/.config $(APPDIR)/.config +endif + define REGISTER $(Q) echo "Register: $1" $(Q) echo "{ \"$1\", $2, $3, $4 }," > "$(BUILTIN_REGISTRY)$(DELIM)$4.bdat" diff --git a/apps/builtin/Makefile b/apps/builtin/Makefile index 6633146e9..2d8b0193e 100644 --- a/apps/builtin/Makefile +++ b/apps/builtin/Makefile @@ -96,6 +96,7 @@ endif $(Q) touch .built context: + $(Q) $(MAKE) -C registry context TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep @@ -104,6 +105,7 @@ context: depend: .depend clean: + $(Q) $(MAKE) -C registry clean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" $(call DELFILE, .built) $(call CLEAN) diff --git a/apps/builtin/registry/Makefile b/apps/builtin/registry/Makefile index 9117f53d6..4ecd5da9f 100644 --- a/apps/builtin/registry/Makefile +++ b/apps/builtin/registry/Makefile @@ -41,7 +41,14 @@ include $(APPDIR)/Make.defs all: .PHONY: context depend clean distclean -context: +.updated: $(DEPCONFIG) + $(call DELFILE, *.bdat) + $(call DELFILE, *.pdat) + $(Q) touch .updated + +# This must run before any other context target + +context: .updated depend: diff --git a/apps/examples/adc/Makefile b/apps/examples/adc/Makefile index 55bc259e4..3cbe843f6 100644 --- a/apps/examples/adc/Makefile +++ b/apps/examples/adc/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/buttons/Makefile b/apps/examples/buttons/Makefile index ac1f2f05a..a2e8679d4 100644 --- a/apps/examples/buttons/Makefile +++ b/apps/examples/buttons/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/can/Makefile b/apps/examples/can/Makefile index 5df96e1e7..548c6702c 100644 --- a/apps/examples/can/Makefile +++ b/apps/examples/can/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/cdcacm/Makefile b/apps/examples/cdcacm/Makefile index d9e19e906..2cf3a107f 100644 --- a/apps/examples/cdcacm/Makefile +++ b/apps/examples/cdcacm/Makefile @@ -88,10 +88,10 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(APPNAME1)_main) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME2),$(PRIORITY2),$(STACKSIZE2),$(APPNAME2)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat diff --git a/apps/examples/composite/Makefile b/apps/examples/composite/Makefile index b1fe49308..1f05d9c64 100644 --- a/apps/examples/composite/Makefile +++ b/apps/examples/composite/Makefile @@ -88,10 +88,10 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(APPNAME1)_main) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME2),$(PRIORITY2),$(STACKSIZE2),$(APPNAME2)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat diff --git a/apps/examples/cxxtest/Makefile b/apps/examples/cxxtest/Makefile index cba9f0a4f..97fdb6ede 100644 --- a/apps/examples/cxxtest/Makefile +++ b/apps/examples/cxxtest/Makefile @@ -101,7 +101,7 @@ $(CXXOBJS): %$(OBJEXT): %.cxx @touch .built ifeq ($(CONFIG_EXAMPLES_HELLOXX_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/dhcpd/Makefile b/apps/examples/dhcpd/Makefile index 0522d4cc4..d718d79e1 100644 --- a/apps/examples/dhcpd/Makefile +++ b/apps/examples/dhcpd/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/discover/Makefile b/apps/examples/discover/Makefile index b0285fbff..033ab1131 100644 --- a/apps/examples/discover/Makefile +++ b/apps/examples/discover/Makefile @@ -85,7 +85,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/ftpc/Makefile b/apps/examples/ftpc/Makefile index e09779abd..cc966f8d6 100644 --- a/apps/examples/ftpc/Makefile +++ b/apps/examples/ftpc/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c # Register application ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/ftpd/Makefile b/apps/examples/ftpd/Makefile index dc53bfdea..dd18d5043 100644 --- a/apps/examples/ftpd/Makefile +++ b/apps/examples/ftpd/Makefile @@ -79,10 +79,10 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)ftpd_start.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)ftpd_start.bdat: $(DEPCONFIG) Makefile $(call REGISTER,ftpd_start,SCHED_PRIORITY_DEFAULT,2048,ftpd_start) -$(BUILTIN_REGISTRY)$(DELIM)ftpd_stop.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)ftpd_stop.bdat: $(DEPCONFIG) Makefile $(call REGISTER,ftpd_stop,SCHED_PRIORITY_DEFAULT,2048,ftpd_stop) context: $(BUILTIN_REGISTRY)$(DELIM)ftpd_start.bdat $(BUILTIN_REGISTRY)$(DELIM)ftpd_stop.bdat diff --git a/apps/examples/hello/Makefile b/apps/examples/hello/Makefile index c4e6f735a..fc98fa7f4 100644 --- a/apps/examples/hello/Makefile +++ b/apps/examples/hello/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_EXAMPLES_HELLO_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/helloxx/Makefile b/apps/examples/helloxx/Makefile index df1b360a5..44d880658 100644 --- a/apps/examples/helloxx/Makefile +++ b/apps/examples/helloxx/Makefile @@ -101,7 +101,7 @@ $(CXXOBJS): %$(OBJEXT): %.cxx @touch .built ifeq ($(CONFIG_EXAMPLES_HELLOXX_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/json/Makefile b/apps/examples/json/Makefile index 1e42757b8..f6a38fb1a 100644 --- a/apps/examples/json/Makefile +++ b/apps/examples/json/Makefile @@ -82,7 +82,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/keypadtest/Makefile b/apps/examples/keypadtest/Makefile index 0c40a5c6c..e38e66a82 100644 --- a/apps/examples/keypadtest/Makefile +++ b/apps/examples/keypadtest/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/lcdrw/Makefile b/apps/examples/lcdrw/Makefile index 61d6bcce6..aab04acf5 100644 --- a/apps/examples/lcdrw/Makefile +++ b/apps/examples/lcdrw/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_EXAMPLES_LCDRW_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/modbus/Makefile b/apps/examples/modbus/Makefile index da31c3b52..b2fba6764 100644 --- a/apps/examples/modbus/Makefile +++ b/apps/examples/modbus/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/nettest/Makefile b/apps/examples/nettest/Makefile index e6f56e765..a0308713c 100644 --- a/apps/examples/nettest/Makefile +++ b/apps/examples/nettest/Makefile @@ -117,7 +117,7 @@ $(HOST_BIN): $(HOST_OBJS) @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/nx/Makefile b/apps/examples/nx/Makefile index 4474a58c3..13a938821 100644 --- a/apps/examples/nx/Makefile +++ b/apps/examples/nx/Makefile @@ -87,7 +87,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_EXAMPLES_NX_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/nxhello/Makefile b/apps/examples/nxhello/Makefile index 52ced123d..4a72eb8c7 100644 --- a/apps/examples/nxhello/Makefile +++ b/apps/examples/nxhello/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_EXAMPLES_NXHELLO_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/nximage/Makefile b/apps/examples/nximage/Makefile index 98f04c2d5..7bdaa46d2 100644 --- a/apps/examples/nximage/Makefile +++ b/apps/examples/nximage/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_EXAMPLES_NXIMAGE_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/nxlines/Makefile b/apps/examples/nxlines/Makefile index 9673a5520..54495b292 100644 --- a/apps/examples/nxlines/Makefile +++ b/apps/examples/nxlines/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/nxtext/Makefile b/apps/examples/nxtext/Makefile index 738209754..dfb165608 100644 --- a/apps/examples/nxtext/Makefile +++ b/apps/examples/nxtext/Makefile @@ -88,7 +88,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_EXAMPLES_NXTEXT_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/ostest/Makefile b/apps/examples/ostest/Makefile index dfb500387..3d19f6a78 100644 --- a/apps/examples/ostest/Makefile +++ b/apps/examples/ostest/Makefile @@ -128,7 +128,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_EXAMPLES_OSTEST_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/pwm/Makefile b/apps/examples/pwm/Makefile index d33d1c277..ece901a99 100644 --- a/apps/examples/pwm/Makefile +++ b/apps/examples/pwm/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/qencoder/Makefile b/apps/examples/qencoder/Makefile index 1caff2ed3..9668796e6 100644 --- a/apps/examples/qencoder/Makefile +++ b/apps/examples/qencoder/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/relays/Makefile b/apps/examples/relays/Makefile index 17bf7a6a4..1ab4c8716 100644 --- a/apps/examples/relays/Makefile +++ b/apps/examples/relays/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/telnetd/Makefile b/apps/examples/telnetd/Makefile index 63876baa0..4391870c0 100644 --- a/apps/examples/telnetd/Makefile +++ b/apps/examples/telnetd/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/tiff/Makefile b/apps/examples/tiff/Makefile index 853e904a7..17b3bb92c 100644 --- a/apps/examples/tiff/Makefile +++ b/apps/examples/tiff/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_EXAMPLES_TIFF_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/touchscreen/Makefile b/apps/examples/touchscreen/Makefile index 8761cc5b5..1a65c7282 100644 --- a/apps/examples/touchscreen/Makefile +++ b/apps/examples/touchscreen/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/usbstorage/Makefile b/apps/examples/usbstorage/Makefile index a1eb77836..6c486bf9c 100644 --- a/apps/examples/usbstorage/Makefile +++ b/apps/examples/usbstorage/Makefile @@ -88,10 +88,10 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_EXAMPLES_USBMSC_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(APPNAME1)_main) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME2),$(PRIORITY2),$(STACKSIZE2),$(APPNAME2)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat diff --git a/apps/examples/usbterm/Makefile b/apps/examples/usbterm/Makefile index 3b3ca6cd7..91e80686e 100644 --- a/apps/examples/usbterm/Makefile +++ b/apps/examples/usbterm/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_EXAMPLES_USBTERM_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/watchdog/Makefile b/apps/examples/watchdog/Makefile index cf947b011..076272fe3 100644 --- a/apps/examples/watchdog/Makefile +++ b/apps/examples/watchdog/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/wgetjson/Makefile b/apps/examples/wgetjson/Makefile index 38bd8ac04..89cb3e11e 100644 --- a/apps/examples/wgetjson/Makefile +++ b/apps/examples/wgetjson/Makefile @@ -84,7 +84,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/examples/xmlrpc/Makefile b/apps/examples/xmlrpc/Makefile index 4756bfabb..b103fd7ed 100644 --- a/apps/examples/xmlrpc/Makefile +++ b/apps/examples/xmlrpc/Makefile @@ -85,7 +85,7 @@ $(COBJS): %$(OBJEXT): %.c @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/system/free/Makefile b/apps/system/free/Makefile index 4f6424f50..58ca7956c 100644 --- a/apps/system/free/Makefile +++ b/apps/system/free/Makefile @@ -93,7 +93,7 @@ $(COBJS): %$(OBJEXT): %.c # Register application ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/system/i2c/Makefile b/apps/system/i2c/Makefile index 7f42801a9..1ed7a2fae 100644 --- a/apps/system/i2c/Makefile +++ b/apps/system/i2c/Makefile @@ -81,7 +81,7 @@ $(COBJS): %$(OBJEXT): %.c $(Q) touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/system/install/Makefile b/apps/system/install/Makefile index aa65e60ed..07d42887a 100644 --- a/apps/system/install/Makefile +++ b/apps/system/install/Makefile @@ -94,7 +94,7 @@ $(COBJS): %$(OBJEXT): %.c # Register application ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/system/poweroff/Makefile b/apps/system/poweroff/Makefile index 0067a13ab..eb7518fbc 100644 --- a/apps/system/poweroff/Makefile +++ b/apps/system/poweroff/Makefile @@ -94,7 +94,7 @@ $(COBJS): %$(OBJEXT): %.c # Register application ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/system/ramtron/Makefile b/apps/system/ramtron/Makefile index 1c92398f3..b47781095 100644 --- a/apps/system/ramtron/Makefile +++ b/apps/system/ramtron/Makefile @@ -94,7 +94,7 @@ $(COBJS): %$(OBJEXT): %.c # Register application ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/system/sdcard/Makefile b/apps/system/sdcard/Makefile index 6c580ba86..d748b2b04 100644 --- a/apps/system/sdcard/Makefile +++ b/apps/system/sdcard/Makefile @@ -94,7 +94,7 @@ $(COBJS): %$(OBJEXT): %.c # Register application ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat diff --git a/apps/system/sysinfo/Makefile b/apps/system/sysinfo/Makefile index d233aa3d8..eb788b01a 100644 --- a/apps/system/sysinfo/Makefile +++ b/apps/system/sysinfo/Makefile @@ -94,7 +94,7 @@ $(COBJS): %$(OBJEXT): %.c # Register application ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(TOPDIR)$(DELIM).config Makefile +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -- cgit v1.2.3 From 7c73fe57c659ce9f9a31a247b04f7068a0b62cb1 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 24 Dec 2012 17:49:58 +0000 Subject: Fixes for l3s, USB composite, nfsmount, apps context build problems git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5458 42af7a65-404d-4744-a932-0658087f49c3 --- apps/builtin/Makefile | 16 ++++++++++++++-- apps/nshlib/nsh_mntcmds.c | 3 +++ apps/nshlib/nsh_netcmds.c | 1 + nuttx/configs/ekk-lm3s9b96/nsh/setenv.sh | 12 ++++++++---- nuttx/configs/ekk-lm3s9b96/ostest/setenv.sh | 12 ++++++++---- nuttx/configs/lm3s8962-ek/nsh/appconfig | 2 +- nuttx/configs/lm3s8962-ek/nsh/setenv.sh | 26 +++++++++++++++++++++----- nuttx/configs/lm3s8962-ek/nx/setenv.sh | 26 +++++++++++++++++++++----- nuttx/configs/lm3s8962-ek/ostest/setenv.sh | 26 +++++++++++++++++++++----- nuttx/configs/stm3210e-eval/RIDE/defconfig | 2 +- nuttx/drivers/usbdev/composite.c | 4 ++-- nuttx/include/nuttx/clock.h | 2 +- nuttx/sched/sig_timedwait.c | 5 +++-- 13 files changed, 105 insertions(+), 32 deletions(-) (limited to 'apps/builtin/Makefile') diff --git a/apps/builtin/Makefile b/apps/builtin/Makefile index 2d8b0193e..0efb832f8 100644 --- a/apps/builtin/Makefile +++ b/apps/builtin/Makefile @@ -77,18 +77,30 @@ $(COBJS): %$(OBJEXT): %.c builtin_list.h: registry/.updated $(call DELFILE, builtin_list.h) + $(Q) touch builtin_list.h ifeq ($(CONFIG_WINDOWS_NATIVE),y) $(Q) for /f %%G in ('dir /b registry\*.bdat`) do ( type registry\%%G >> builtin_list.h ) else - $(Q) for file in `ls registry/*.bdat`; do cat $$file >> builtin_list.h; done + $(Q) ( \ + filelist=`ls registry/*.bdat 2>/dev/null || echo ""`; \ + for file in $$filelist; \ + do cat $$file >> builtin_list.h; \ + done; \ + ) endif builtin_proto.h: registry/.updated $(call DELFILE, builtin_proto.h) + $(Q) touch builtin_proto.h ifeq ($(CONFIG_WINDOWS_NATIVE),y) $(Q) for /f %%G in ('dir /b registry\*.pdat`) do ( type registry\%%G >> builtin_proto.h ) else - $(Q) for file in `ls registry/*.pdat`; do cat $$file >> builtin_proto.h; done + $(Q) ( \ + filelist=`ls registry/*.pdat 2>/dev/null || echo ""`; \ + for file in $$filelist; \ + do cat $$file >> builtin_proto.h; \ + done; \ + ) endif .built: builtin_list.h builtin_proto.h $(OBJS) diff --git a/apps/nshlib/nsh_mntcmds.c b/apps/nshlib/nsh_mntcmds.c index 690d027ca..f6eb26c31 100644 --- a/apps/nshlib/nsh_mntcmds.c +++ b/apps/nshlib/nsh_mntcmds.c @@ -45,10 +45,13 @@ #include #include +#include #include #include #include +#include + #include "nsh.h" #include "nsh_console.h" diff --git a/apps/nshlib/nsh_netcmds.c b/apps/nshlib/nsh_netcmds.c index 371d30460..506950e14 100644 --- a/apps/nshlib/nsh_netcmds.c +++ b/apps/nshlib/nsh_netcmds.c @@ -67,6 +67,7 @@ #if defined(CONFIG_NET_ICMP) && defined(CONFIG_NET_ICMP_PING) && \ !defined(CONFIG_DISABLE_CLOCK) && !defined(CONFIG_DISABLE_SIGNALS) # include +# include #endif #if defined(CONFIG_NET_UDP) && CONFIG_NFILE_DESCRIPTORS > 0 diff --git a/nuttx/configs/ekk-lm3s9b96/nsh/setenv.sh b/nuttx/configs/ekk-lm3s9b96/nsh/setenv.sh index 6e591e0dd..bba7595de 100755 --- a/nuttx/configs/ekk-lm3s9b96/nsh/setenv.sh +++ b/nuttx/configs/ekk-lm3s9b96/nsh/setenv.sh @@ -48,12 +48,16 @@ if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}" fi -# TOOLCHAIN_BIN must be defined to the full path to the location where you -# have installed the toolchain of your choice. Modify the following: +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" +# This is the Cygwin path to the location where I build the buildroot +# toolchain. export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" -# Andd add the toolchain path to the PATH variable - +# Add the path to the toolchain to the PATH varialble export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" + echo "PATH : ${PATH}" diff --git a/nuttx/configs/ekk-lm3s9b96/ostest/setenv.sh b/nuttx/configs/ekk-lm3s9b96/ostest/setenv.sh index d98c6cc40..60dfa3c71 100755 --- a/nuttx/configs/ekk-lm3s9b96/ostest/setenv.sh +++ b/nuttx/configs/ekk-lm3s9b96/ostest/setenv.sh @@ -48,12 +48,16 @@ if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}" fi -# TOOLCHAIN_BIN must be defined to the full path to the location where you -# have installed the toolchain of your choice. Modify the following: +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" +# This is the Cygwin path to the location where I build the buildroot +# toolchain. export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" -# Andd add the toolchain path to the PATH variable - +# Add the path to the toolchain to the PATH varialble export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" + echo "PATH : ${PATH}" diff --git a/nuttx/configs/lm3s8962-ek/nsh/appconfig b/nuttx/configs/lm3s8962-ek/nsh/appconfig index 5eeb56607..2e2421b67 100644 --- a/nuttx/configs/lm3s8962-ek/nsh/appconfig +++ b/nuttx/configs/lm3s8962-ek/nsh/appconfig @@ -40,7 +40,7 @@ CONFIGURED_APPS += examples/nsh # NSH library CONFIGURED_APPS += system/readline -CONFIGURED_APPS += nshlibO +CONFIGURED_APPS += nshlib # Networking support diff --git a/nuttx/configs/lm3s8962-ek/nsh/setenv.sh b/nuttx/configs/lm3s8962-ek/nsh/setenv.sh index 511552d94..1db7f8ee2 100755 --- a/nuttx/configs/lm3s8962-ek/nsh/setenv.sh +++ b/nuttx/configs/lm3s8962-ek/nsh/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi - WD=`pwd` -export BUILDROOT_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" -export PATH="${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/nuttx/configs/lm3s8962-ek/nx/setenv.sh b/nuttx/configs/lm3s8962-ek/nx/setenv.sh index a36725083..c716ddf5e 100755 --- a/nuttx/configs/lm3s8962-ek/nx/setenv.sh +++ b/nuttx/configs/lm3s8962-ek/nx/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi - WD=`pwd` -export BUILDROOT_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" -export PATH="${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/nuttx/configs/lm3s8962-ek/ostest/setenv.sh b/nuttx/configs/lm3s8962-ek/ostest/setenv.sh index 6bd49b6fa..91bf1095b 100755 --- a/nuttx/configs/lm3s8962-ek/ostest/setenv.sh +++ b/nuttx/configs/lm3s8962-ek/ostest/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi - WD=`pwd` -export BUILDROOT_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" -export PATH="${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/nuttx/configs/stm3210e-eval/RIDE/defconfig b/nuttx/configs/stm3210e-eval/RIDE/defconfig index 64665f47e..e71540c24 100755 --- a/nuttx/configs/stm3210e-eval/RIDE/defconfig +++ b/nuttx/configs/stm3210e-eval/RIDE/defconfig @@ -169,7 +169,7 @@ CONFIG_RAW_BINARY=n # # General OS setup # -#CONFIG_USER_ENTRYPOINT= +CONFIG_USER_ENTRYPOINT="null_main" CONFIG_DEBUG=n CONFIG_DEBUG_VERBOSE=n CONFIG_DEBUG_SYMBOLS=n diff --git a/nuttx/drivers/usbdev/composite.c b/nuttx/drivers/usbdev/composite.c index 4cad8af86..530d64416 100644 --- a/nuttx/drivers/usbdev/composite.c +++ b/nuttx/drivers/usbdev/composite.c @@ -523,12 +523,12 @@ static int composite_setup(FAR struct usbdevclass_driver_s *driver, { /* Save the configuration and inform the constituent classes */ - ret = CLASS_SETUP(priv->dev1, dev, ctrl); + ret = CLASS_SETUP(priv->dev1, dev, ctrl, dataout, outlen); dispatched = true; if (ret >= 0) { - ret = CLASS_SETUP(priv->dev2, dev, ctrl); + ret = CLASS_SETUP(priv->dev2, dev, ctrl, dataout, outlen); if (ret >= 0) { priv->config = value; diff --git a/nuttx/include/nuttx/clock.h b/nuttx/include/nuttx/clock.h index 952e0e5ef..e640ecd2e 100644 --- a/nuttx/include/nuttx/clock.h +++ b/nuttx/include/nuttx/clock.h @@ -113,7 +113,7 @@ #define USEC2TICK(usec) (((usec)+(USEC_PER_TICK/2))/USEC_PER_TICK) /* Rounds */ #define MSEC2TICK(msec) (((msec)+(MSEC_PER_TICK/2))/MSEC_PER_TICK) /* Rounds */ #define DSEC2TICK(dsec) MSEC2TICK((dsec)*MSEC_PER_DSEC) -#define SEC2TICK(sec) MSEC2TICK((sec)*MSEC_PER_SEC) +#define SEC2TICK(sec) MSEC2TICK((sec)*MSEC_PER_SEC) /* Exact */ #define TICK2NSEC(tick) ((tick)*NSEC_PER_TICK) /* Exact */ #define TICK2USEC(tick) ((tick)*USEC_PER_TICK) /* Exact */ diff --git a/nuttx/sched/sig_timedwait.c b/nuttx/sched/sig_timedwait.c index d03611610..d7610cd49 100644 --- a/nuttx/sched/sig_timedwait.c +++ b/nuttx/sched/sig_timedwait.c @@ -38,6 +38,7 @@ ****************************************************************************/ #include +#include #include #include @@ -244,8 +245,8 @@ int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info, */ #ifdef CONFIG_HAVE_LONG_LONG - uint64_t waitticks64 = (timeout->tv_sec * NSEC_PER_SEC + - timeout->tv_nsec + NSEC_PER_TICK - 1) / + uint64_t waitticks64 = ((uint64_t)timeout->tv_sec * NSEC_PER_SEC + + (uint64_t)timeout->tv_nsec + NSEC_PER_TICK - 1) / NSEC_PER_TICK; DEBUGASSERT(waitticks64 <= UINT32_MAX); waitticks = (uint32_t)waitticks64; -- cgit v1.2.3 From 6953365d30f06846a8f3877b73e01ee7d8321db0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 24 Dec 2012 20:22:14 +0000 Subject: Fix several build issues noted by Mike Smith git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5459 42af7a65-404d-4744-a932-0658087f49c3 --- apps/ChangeLog.txt | 10 ++++- apps/builtin/Makefile | 5 ++- apps/examples/nettest/Makefile | 57 +++++++++++++++-------------- nuttx/ChangeLog | 3 ++ nuttx/arch/arm/src/arm/up_head.S | 51 +++++++++++++++++++------- nuttx/configs/ntosd-dm320/nettest/setenv.sh | 26 ++++++++++--- nuttx/configs/ntosd-dm320/nsh/setenv.sh | 26 ++++++++++--- nuttx/configs/ntosd-dm320/ostest/setenv.sh | 26 ++++++++++--- nuttx/configs/ntosd-dm320/poll/setenv.sh | 26 ++++++++++--- nuttx/configs/ntosd-dm320/thttpd/setenv.sh | 26 ++++++++++--- nuttx/configs/ntosd-dm320/udp/setenv.sh | 26 ++++++++++--- nuttx/configs/ntosd-dm320/uip/setenv.sh | 26 ++++++++++--- 12 files changed, 228 insertions(+), 80 deletions(-) (limited to 'apps/builtin/Makefile') diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 09a4f634d..ea1b247f5 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -439,12 +439,18 @@ * Makefiles: Removed dependency of distclean on clean in most top-level files. It makes sense for 'leaf' Makefiles to have this dependency, but it does not make sense for upper-level Makefiles. - * namedapp/: Renamed to builtins in preparation for another change. + * apps/namedapp/: Renamed to builtins in preparation for another change. * .context: Removed the .context kludge. This caused lots of problems when changing configurations because there is no easy way to get the system to rebuild the context. Now, the context will be rebuilt whenever there is a change in either .config or the Makefile. - * builtin/registry: Updated new built-in registration logic to handle + * apps/builtin/registry: Updated new built-in registration logic to handle cases where (1) old apps/.config is used, and (2) applications ared removed, not just added. + * apps/examples/nettest/Makefile: Fix an error that crept in during + some of the recent, massive build system changes. + * apps/builtin/Makefile: Need to have auto-generated header files + in place early in the dependency generation phase to avoid warnings. + It is not important if they are only stubbed out header files at + this build phase. diff --git a/apps/builtin/Makefile b/apps/builtin/Makefile index 0efb832f8..ccb860c88 100644 --- a/apps/builtin/Makefile +++ b/apps/builtin/Makefile @@ -75,6 +75,9 @@ $(AOBJS): %$(OBJEXT): %.S $(COBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) +registry/.updated: + $(V) $(MAKE) -C registry .updated TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" + builtin_list.h: registry/.updated $(call DELFILE, builtin_list.h) $(Q) touch builtin_list.h @@ -110,7 +113,7 @@ endif context: $(Q) $(MAKE) -C registry context TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" -.depend: Makefile $(SRCS) +.depend: Makefile $(SRCS) builtin_list.h builtin_proto.h $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep $(Q) touch $@ diff --git a/apps/examples/nettest/Makefile b/apps/examples/nettest/Makefile index a0308713c..5368bdefc 100644 --- a/apps/examples/nettest/Makefile +++ b/apps/examples/nettest/Makefile @@ -39,64 +39,64 @@ include $(APPDIR)/Make.defs # Basic TCP networking test -TARG_ASRCS = -TARG_AOBJS = $(TARG_ASRCS:.S=$(OBJEXT)) +TARG_ASRCS = +TARG_AOBJS = $(TARG_ASRCS:.S=$(OBJEXT)) -TARG_CSRCS = nettest.c +TARG_CSRCS = nettest.c ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y) -TARG_CSRCS += nettest_server.c +TARG_CSRCS += nettest_server.c else -TARG_CSRCS += nettest_client.c +TARG_CSRCS += nettest_client.c endif -TARG_COBJS = $(TARG_CSRCS:.c=$(OBJEXT)) +TARG_COBJS = $(TARG_CSRCS:.c=$(OBJEXT)) -TARG_SRCS = $(TARG_ASRCS) $(TARG_CSRCS) -TARG_OBJS = $(TARG_AOBJS) $(TARG_COBJS) +TARG_SRCS = $(TARG_ASRCS) $(TARG_CSRCS) +TARG_OBJS = $(TARG_AOBJS) $(TARG_COBJS) ifeq ($(CONFIG_WINDOWS_NATIVE),y) - TARG_BIN = ..\..\libapps$(LIBEXT) + TARG_BIN = ..\..\libapps$(LIBEXT) else ifeq ($(WINTOOL),y) - TARG_BIN = ..\\..\\libapps$(LIBEXT) + TARG_BIN = ..\\..\\libapps$(LIBEXT) else - TARG_BIN = ../../libapps$(LIBEXT) + TARG_BIN = ../../libapps$(LIBEXT) endif endif -HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_HOST=1 +HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_HOST=1 ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y) -HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_SERVER=1 \ - -DCONFIG_EXAMPLES_NETTEST_CLIENTIP="$(CONFIG_EXAMPLES_NETTEST_CLIENTIP)" +HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_SERVER=1 -DCONFIG_EXAMPLES_NETTEST_CLIENTIP="$(CONFIG_EXAMPLES_NETTEST_CLIENTIP)" endif ifeq ($(CONFIG_EXAMPLES_NETTEST_PERFORMANCE),y) -HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_PERFORMANCE=1 +HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_PERFORMANCE=1 endif -HOST_SRCS = host.c +HOST_SRCS = host.c ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y) -HOST_SRCS += nettest_client.c +HOST_SRCS += nettest_client.c else -HOST_SRCS += nettest_server.c +HOST_SRCS += nettest_server.c endif -HOST_OBJS = $(HOST_SRCS:.c=.o) -HOST_BIN = host +HOSTOBJEXT ?= .hobj +HOST_OBJS = $(HOST_SRCS:.c=$(HOSTOBJEXT)) +HOST_BIN = host -ROOTDEPPATH = --dep-path . +ROOTDEPPATH = --dep-path . # NET test built-in application info -APPNAME = nettest -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 +APPNAME = nettest +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built $(HOST_BIN) -.PHONY: clean depend distclean +.PHONY: clean depend distclean $(TARG_AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -104,7 +104,7 @@ $(TARG_AOBJS): %$(OBJEXT): %.S $(TARG_COBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) -$(HOST_OBJS): %.o: %.c +$(HOST_OBJS): %$(HOSTOBJEXT): %.c @echo "CC: $<" @$(HOSTCC) -c $(HOSTCFLAGS) $< -o $@ @@ -113,7 +113,7 @@ $(HOST_BIN): $(HOST_OBJS) @$(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS) -o $@ .built: $(TARG_OBJS) - $(call ARCHIVE, $(BIN), $(TARG_OBJS)) + $(call ARCHIVE, $(TARG_BIN), $(TARG_OBJS)) @touch .built ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) @@ -132,6 +132,7 @@ endif depend: .depend clean: + $(call DELFILE, *$(HOSTOBJEXT)) $(call DELFILE, $(HOST_BIN)) $(call DELFILE, .built) $(call CLEAN) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 6c6fd7843..c5cc9b54a 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3815,4 +3815,7 @@ * sched/sig_timedwait.c: Should always move the time up to the next largest number of system ticks. The logic was rounding. Noted by Petteri Aimonen. + * arch/arm/src/up_head.S: Fix backward conditional compilation. NOTE + there is a issue of ARM9 systems with low vectors and large memories + that will have to be addressed in the future. diff --git a/nuttx/arch/arm/src/arm/up_head.S b/nuttx/arch/arm/src/arm/up_head.S index 91d67fd15..46efd8772 100644 --- a/nuttx/arch/arm/src/arm/up_head.S +++ b/nuttx/arch/arm/src/arm/up_head.S @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/arm/src/arm/up_head.S + * arch/arm/src/arm/up_pghead.S * * Copyright (C) 2007, 2009-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -78,6 +78,10 @@ * beginning of FLASH. */ +# if !defined(CONFIG_FLASH_START) || !defined(CONFIG_FLASH_VSTART) +# error "CONFIG_FLASH_START or CONFIG_FLASH_VSTART is not defined" +# endif + # if CONFIG_FLASH_START == CONFIG_FLASH_VSTART # define CONFIG_IDENTITY_TEXTMAP 1 # endif @@ -102,6 +106,10 @@ * beginning of FLASH. */ +# if !defined(CONFIG_FLASH_START) || !defined(CONFIG_FLASH_VSTART) +# error "CONFIG_FLASH_START or CONFIG_FLASH_VSTART is not defined" +# endif + # if CONFIG_FLASH_START == CONFIG_FLASH_VSTART # define CONFIG_IDENTITY_TEXTMAP 1 # endif @@ -120,6 +128,10 @@ * beginning of RAM. */ +# if !defined(CONFIG_DRAM_START) || !defined(CONFIG_DRAM_VSTART) +# error "CONFIG_DRAM_START or CONFIG_DRAM_VSTART is not defined" +# endif + # if CONFIG_DRAM_START == CONFIG_DRAM_VSTART # define CONFIG_IDENTITY_TEXTMAP 1 # endif @@ -162,26 +174,37 @@ * Assembly Macros ****************************************************************************/ -/* The ARM9 L1 page table can be placed at the beginning or at the end of the - * RAM space. This decision is based on the placement of the vector area: - * If the vectors are place in low memory at address 0x0000 0000, then the - * page table is placed in high memory; if the vectors are placed in high - * memory at address 0xfff0 0000, then the page table is locating at the - * beginning of RAM. +/* The ARM9 L1 page table can be placed at the beginning or at the end of + * the RAM space. This decision is based on the placement of the vector + * area: If the vectors are place in low memory at address 0x0000 0000, then + * the page table is placed in high memory; if the vectors are placed in + * high memory at address 0xfff0 0000, then the page table is locating at + * the beginning of RAM. * - * For the special case where (1) the program executes out of RAM, and (2) the - * page is located at the beginning of RAM, then the following macro can - * easily find the physical address of the section that includes the first - * part of the text region: Since the page table is closely related to the - * NuttX base address in this case, we can convert the page table base address - * to the base address of the section containing both. + * For the special case where (1) the program executes out of RAM, and (2) + * the page is located at the beginning of RAM (i.e., the high vector case), + * then the following macro can easily find the physical address of the + * section that includes the first part of the text region: Since the page + * table is closely related to the NuttX base address in this case, we can + * convert the page table base address to the base address of the section + * containing both. + */ + +/* REVISIT: This works now of the low vector case only because the RAM + * sizes that we have been dealing with are less then 1MB so that both the + * page table and the vector table are in the same 1MB RAM block. But + * this will certainly break later. Hence, the annoying warning. */ #ifdef CONFIG_ARCH_LOWVECTORS +# warning "REVISIT" +#endif + +//#ifndef CONFIG_ARCH_LOWVECTORS .macro mksection, section, pgtable bic \section, \pgtable, #0x000ff000 .endm -#endif +//#endif /* This macro will modify r0, r1, r2 and r14 */ diff --git a/nuttx/configs/ntosd-dm320/nettest/setenv.sh b/nuttx/configs/ntosd-dm320/nettest/setenv.sh index 6090d4cea..cfb438ce7 100755 --- a/nuttx/configs/ntosd-dm320/nettest/setenv.sh +++ b/nuttx/configs/ntosd-dm320/nettest/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - WD=`pwd` -export BUILDROOT_BIN=${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin -export PATH=${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG} +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/nuttx/configs/ntosd-dm320/nsh/setenv.sh b/nuttx/configs/ntosd-dm320/nsh/setenv.sh index a84e68884..005aa8153 100755 --- a/nuttx/configs/ntosd-dm320/nsh/setenv.sh +++ b/nuttx/configs/ntosd-dm320/nsh/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - WD=`pwd` -export BUILDROOT_BIN=${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin -export PATH=${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG} +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/nuttx/configs/ntosd-dm320/ostest/setenv.sh b/nuttx/configs/ntosd-dm320/ostest/setenv.sh index a65be2677..75d6f0cd0 100755 --- a/nuttx/configs/ntosd-dm320/ostest/setenv.sh +++ b/nuttx/configs/ntosd-dm320/ostest/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - WD=`pwd` -export BUILDROOT_BIN=${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin -export PATH=${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG} +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/nuttx/configs/ntosd-dm320/poll/setenv.sh b/nuttx/configs/ntosd-dm320/poll/setenv.sh index de3b64ea9..427ffe26a 100755 --- a/nuttx/configs/ntosd-dm320/poll/setenv.sh +++ b/nuttx/configs/ntosd-dm320/poll/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - WD=`pwd` -export BUILDROOT_BIN=${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin -export PATH=${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG} +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/nuttx/configs/ntosd-dm320/thttpd/setenv.sh b/nuttx/configs/ntosd-dm320/thttpd/setenv.sh index 92ff91700..ea38c09a5 100755 --- a/nuttx/configs/ntosd-dm320/thttpd/setenv.sh +++ b/nuttx/configs/ntosd-dm320/thttpd/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - WD=`pwd` -export BUILDROOT_BIN=${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin -export PATH=${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG} +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/nuttx/configs/ntosd-dm320/udp/setenv.sh b/nuttx/configs/ntosd-dm320/udp/setenv.sh index 052413b08..92995bee5 100755 --- a/nuttx/configs/ntosd-dm320/udp/setenv.sh +++ b/nuttx/configs/ntosd-dm320/udp/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - WD=`pwd` -export BUILDROOT_BIN=${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin -export PATH=${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG} +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/nuttx/configs/ntosd-dm320/uip/setenv.sh b/nuttx/configs/ntosd-dm320/uip/setenv.sh index 988e0a126..33c252e1e 100755 --- a/nuttx/configs/ntosd-dm320/uip/setenv.sh +++ b/nuttx/configs/ntosd-dm320/uip/setenv.sh @@ -32,15 +32,31 @@ # POSSIBILITY OF SUCH DAMAGE. # -if [ "$(basename $0)" = "setenv.sh" ] ; then +if [ "$_" = "$0" ] ; then echo "You must source this script, not run it!" 1>&2 exit 1 fi -if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi - WD=`pwd` -export BUILDROOT_BIN=${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin -export PATH=${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG} +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +# export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" -- cgit v1.2.3 From 292d4db37a4080585577c43434157db335cd5158 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 25 Dec 2012 17:22:58 +0000 Subject: Add logic to serialize and marshal out-of-band keyboard commands git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5460 42af7a65-404d-4744-a932-0658087f49c3 --- apps/Make.defs | 4 +- apps/builtin/Makefile | 6 +- nuttx/ChangeLog | 4 +- nuttx/include/nuttx/input/kbd_codec.h | 292 ++++++++++++++++++++++++++++++++++ nuttx/include/nuttx/usb/hid.h | 2 +- nuttx/libc/misc/Make.defs | 2 +- nuttx/libc/misc/lib_kbddecode.c | 258 ++++++++++++++++++++++++++++++ nuttx/libc/misc/lib_kbdencode.c | 81 ++++++++++ 8 files changed, 641 insertions(+), 8 deletions(-) create mode 100644 nuttx/include/nuttx/input/kbd_codec.h create mode 100644 nuttx/libc/misc/lib_kbddecode.c create mode 100644 nuttx/libc/misc/lib_kbdencode.c (limited to 'apps/builtin/Makefile') diff --git a/apps/Make.defs b/apps/Make.defs index c62999804..f7e6aa08d 100644 --- a/apps/Make.defs +++ b/apps/Make.defs @@ -37,9 +37,9 @@ BUILTIN_REGISTRY = $(APPDIR)$(DELIM)builtin$(DELIM)registry ifeq ($(CONFIG_NUTTX_NEWCONFIG),y) -DEPCONFIG = $(TOPDIR)/.config +DEPCONFIG = $(TOPDIR)$(DELIM).config else -DEPCONFIG = $(TOPDIR)/.config $(APPDIR)/.config +DEPCONFIG = $(TOPDIR)$(DELIM).config $(APPDIR)$(DELIM).config endif define REGISTER diff --git a/apps/builtin/Makefile b/apps/builtin/Makefile index ccb860c88..8c8928886 100644 --- a/apps/builtin/Makefile +++ b/apps/builtin/Makefile @@ -75,10 +75,10 @@ $(AOBJS): %$(OBJEXT): %.S $(COBJS): %$(OBJEXT): %.c $(call COMPILE, $<, $@) -registry/.updated: +registry$(DELIM).updated: $(V) $(MAKE) -C registry .updated TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" -builtin_list.h: registry/.updated +builtin_list.h: registry$(DELIM).updated $(call DELFILE, builtin_list.h) $(Q) touch builtin_list.h ifeq ($(CONFIG_WINDOWS_NATIVE),y) @@ -92,7 +92,7 @@ else ) endif -builtin_proto.h: registry/.updated +builtin_proto.h: registry$(DELIM).updated $(call DELFILE, builtin_proto.h) $(Q) touch builtin_proto.h ifeq ($(CONFIG_WINDOWS_NATIVE),y) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index c5cc9b54a..80ddb56c6 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3818,4 +3818,6 @@ * arch/arm/src/up_head.S: Fix backward conditional compilation. NOTE there is a issue of ARM9 systems with low vectors and large memories that will have to be addressed in the future. - + * libc/misc/lib_kbdencode.c and lib_kbddecode.c: Add logic to marshal + and serialized "out-of-band" keyboard commands intermixed with normal + ASCII data (not yet hooked into anything). diff --git a/nuttx/include/nuttx/input/kbd_codec.h b/nuttx/include/nuttx/input/kbd_codec.h new file mode 100644 index 000000000..b103d544e --- /dev/null +++ b/nuttx/include/nuttx/input/kbd_codec.h @@ -0,0 +1,292 @@ +/************************************************************************************ + * include/nuttx/input/kbd_codec.h + * Serialize and marshaling out-of-band keyboard data + * + * Copyright (C) 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 + * 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. + * + ************************************************************************************/ + +#ifndef __INCLUDE_NUTTX_INPUT_KBD_CODEC_H +#define __INCLUDE_NUTTX_INPUT_KBD_CODEC_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* These are the special, "out-of-band" keyboard commands recognized by the + * CODEC. + */ + +enum kbd_keycode_e +{ + KEYCODE_NORMAL = 0, /* Not a special keycode */ + + /* Delete and Backspace keycodes (in case they may be different than the + * ASCII BKSP and DEL values. + */ + + KEYCODE_FWDDEL, /* DELete (forward delete) */ + KEYCODE_BACKDEL, /* Backspace (backward delete) */ + + /* Cursor movement */ + + KEYCODE_HOME, /* Home */ + KEYCODE_END, /* End */ + KEYCODE_LEFT, /* Left arrow */ + KEYCODE_RIGHT, /* Right arrow */ + KEYCODE_UP, /* Up arrow */ + KEYCODE_DOWN, /* Down arrow */ + KEYCODE_PAGEUP, /* Page up */ + KEYCODE_PAGEDOWN, /* Page down */ + + /* Edit commands */ + + KEYCODE_INSERT, /* Insert */ + KEYCODE_AGAIN, /* Again */ + KEYCODE_UNDO, /* Undo */ + KEYCODE_REDO, /* Redo */ + KEYCODE_CUT, /* Cut */ + KEYCODE_COPY, /* Copy */ + KEYCODE_PASTE, /* Paste */ + KEYCODE_FIND , /* Find */ + + /* Selection codes */ + + KEYCODE_ENTER, /* Enter */ + KEYCODE_SELECT, /* Select */ + KEYCODE_EXECUTE, /* Execute */ + + /* Keyboard modes */ + + KEYCODE_CAPSLOCK, /* Caps Lock */ + KEYCODE_SCROLLLOCK, /* Scroll Lock */ + KEYCODE_NUMLOCK, /* Keypad Num Lock and Clear */ + KEYCODE_LCAPSLOCK, /* Locking Caps Lock */ + KEYCODE_LNUMLOCK, /* Locking Num Lock */ + KEYCODE_LSCROLLLOCK, /* Locking Scroll Lock */ + + /* Misc control codes */ + + KEYCODE_POWER, /* Power */ + KEYCODE_HELP, /* Help */ + KEYCODE_MENU, /* Menu */ + KEYCODE_STOP, /* Stop */ + KEYCODE_PAUSE, /* Pause */ + KEYCODE_BREAK, /* Break */ + KEYCODE_CANCEL, /* Cancel */ + KEYCODE_PRINTSCN, /* PrintScreen */ + KEYCODE_SYSREQ, /* SysReq/Attention */ + + /* Audio */ + + KEYCODE_MUTE, /* Mute */ + KEYCODE_VOLUP, /* Volume Up */ + KEYCODE_VOLDOWN, /* Volume Down */ + + /* Telephone */ + + KEYCODE_ANSWER, /* Answer (phone) */ + KEYCODE_HANGUP, /* Hang-up (phone) */ + + /* Calculator */ + + KEYCODE_CLEAR, /* Clear */ + KEYCODE_CLEARENTRY, /* Clear entry */ + + KEYCODE_MEMSET, /* Memory set */ + KEYCODE_MEMCLEAR, /* Memory clear */ + KEYCODE_MEMRECALL, /* Memory recall */ + KEYCODE_MEMADD, /* Memory add */ + KEYCODE_MEMSUBTRACT, /* Memory substract */ + KEYCODE_MEMMULTIPY, /* Memory multiply */ + KEYCODE_MEMDIVIDE, /* Memory divide */ + + KEYCODE_BINARY, /* Binary mode */ + KEYCODE_OCTAL, /* Octal mode */ + KEYCODE_DECIMAL, /* Decimal mode */ + KEYCODE_HEXADECIMAL, /* Hexadecimal mode */ + + /* Languages */ + + KEYCODE_LANG1, /* LANG1 */ + KEYCODE_LANG2, /* LANG2 */ + KEYCODE_LANG3, /* LANG3 */ + KEYCODE_LANG4, /* LANG4 */ + KEYCODE_LANG5, /* LANG5 */ + KEYCODE_LANG6, /* LANG6 */ + KEYCODE_LANG7, /* LANG7 */ + KEYCODE_LANG8, /* LANG8 */ + + /* Context-specific function keys */ + + KEYCODE_F1, /* Function key 1 */ + KEYCODE_F2, /* Function key 2 */ + KEYCODE_F3, /* Function key 3 */ + KEYCODE_F4, /* Function key 4 */ + KEYCODE_F5, /* Function key 5 */ + KEYCODE_F6, /* Function key 6 */ + KEYCODE_F7, /* Function key 7 */ + KEYCODE_F8, /* Function key 8 */ + KEYCODE_F9, /* Function key 9 */ + KEYCODE_F10, /* Function key 10 */ + KEYCODE_F11, /* Function key 11 */ + KEYCODE_F12, /* Function key 12 */ + KEYCODE_F13, /* Function key 13 */ + KEYCODE_F14, /* Function key 14 */ + KEYCODE_F15, /* Function key 15 */ + KEYCODE_F16, /* Function key 16 */ + KEYCODE_F17, /* Function key 17 */ + KEYCODE_F18, /* Function key 18 */ + KEYCODE_F19, /* Function key 19 */ + KEYCODE_F20, /* Function key 20 */ + KEYCODE_F21, /* Function key 21 */ + KEYCODE_F22, /* Function key 22 */ + KEYCODE_F23, /* Function key 23 */ + KEYCODE_F24 /* Function key 24 */ +}; + +#define FIRST_KEYCODE KEYCODE_FWDDEL +#define LAST_KEYCODE KEYCODE_F24 + +/* kbd_get return values */ + +#define KBD_NORMAL 0 +#define KBD_SPECIAL 1 +#define KBD_ERROR EOF + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +struct kget_getstate_s +{ + uint8_t nch; /* Number of characters in the buffer */ + uint8_t ndx; /* Index to next character in the buffer */ + uint8_t buf[4]; /* Buffer of ungotten data */ +}; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +/**************************************************************************** + * The following functions are intended for use by "producer", keyboard + * or keypad drivers to encode information into driver buffers. + ****************************************************************************/ + +/**************************************************************************** + * Name: kbd_puttext + * + * Description: + * Put one byte of normal, "in-band" ASCII data into the output stream. + * + * Input Parameters: + * ch - The character to be into the output stream. + * stream - An instance of lib_outstream_s to do the low-level put + * operation. + * + * Returned Value: + * None + * + ****************************************************************************/ + +#define kbd_puttext(ch, stream) (stream)->put((stream), (int)(ch)) + +/**************************************************************************** + * Name: kbd_putspecial + * + * Description: + * Put one special, "out-of-band" command into the output stream. + * + * Input Parameters: + * + * Returned Value: + * None + * + ****************************************************************************/ + +void kbd_putspecial(enum kbd_keycode_e keycode, + FAR struct lib_outstream_s *stream); + +/**************************************************************************** + * The following functions are intended for use by "consumer" applications + * to remove and decode information from the driver provided buffer. + ****************************************************************************/ + +/**************************************************************************** + * Name: kbd_get + * + * Description: + * Put one byte of data or special command from the driver provided input + * buffer. + * + * Input Parameters: + * stream - An instance of lib_instream_s to do the low-level get + * operation. + * pch - The location character to save the returned value. This may be + * either a normal, "in-band" ASCII characer or a special, "out-of-band" + * command. + * state - A user provided buffer to support parsing. This structure + * should be cleared the first time that kbd_get is called. + * + * Returned Value: + * 1 - Indicates the successful receipt of a special, "out-of-band" command + * 0 - Indicates the successful receipt of normal, "in-band" ASCII data. + * EOF - An error has getting the next character (reported by the stream). + * Normally indicates the end of file. + * + ****************************************************************************/ + +int kbd_get(FAR struct lib_instream_s *stream, + FAR struct kget_getstate_s *state, FAR uint8_t *pch); + +#ifdef __cplusplus +} +#endif + +#endif /* __INCLUDE_NUTTX_INPUT_KBD_CODEC_H */ + diff --git a/nuttx/include/nuttx/usb/hid.h b/nuttx/include/nuttx/usb/hid.h index 5b83f08fc..877203a9c 100644 --- a/nuttx/include/nuttx/usb/hid.h +++ b/nuttx/include/nuttx/usb/hid.h @@ -619,7 +619,7 @@ #define USBHID_KBDUSE_RCTRL 0xe4 /* Keyboard RightControl */ #define USBHID_KBDUSE_RSHIFT 0xe5 /* Keyboard RightShift */ #define USBHID_KBDUSE_RALT 0xe6 /* Keyboard RightAlt */ -#define USBHID_KBDUSE_RGUI 0xe7 /* Keyboard Right GUI*/ +#define USBHID_KBDUSE_RGUI 0xe7 /* Keyboard Right GUI */ #define USBHID_KBDUSE_MAX 0xe7 diff --git a/nuttx/libc/misc/Make.defs b/nuttx/libc/misc/Make.defs index f4284ac60..c6af5f860 100644 --- a/nuttx/libc/misc/Make.defs +++ b/nuttx/libc/misc/Make.defs @@ -35,7 +35,7 @@ # Add the internal C files to the build -CSRCS += lib_init.c lib_filesem.c +CSRCS += lib_init.c lib_filesem.c lib_kbdencode.c lib_kbddecode.c # Add C files that depend on file OR socket descriptors diff --git a/nuttx/libc/misc/lib_kbddecode.c b/nuttx/libc/misc/lib_kbddecode.c new file mode 100644 index 000000000..046d570f9 --- /dev/null +++ b/nuttx/libc/misc/lib_kbddecode.c @@ -0,0 +1,258 @@ +/******************************************************************************************** + * libc/msic/lib_kbddecode.c + * Decoding side of the Keyboard CODEC + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Authors: 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include + +#include +#include +#include + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define NDX_ESC 0 +#define NDX_BRACKET 1 +#define NDX_CODE 2 +#define NCX_SEMICOLON 3 + +#define NCH_ESC 1 +#define NCH_BRACKET 2 +#define NCH_CODE 3 +#define NCH_SEMICOLON 4 + +/******************************************************************************************** + * Private Functions + ********************************************************************************************/ + +/**************************************************************************** + * Name: kbd_reget + * + * Description: + * We have unused characters from the last, unsuccessful. Return one of + * these instead of the . + * + * Input Parameters: + * stream - An instance of lib_instream_s to do the low-level get + * operation. + * pch - The location character to save the returned value. This may be + * either a normal, "in-band" ASCII characer or a special, "out-of-band" + * command. + * state - A user provided buffer to support parsing. This structure + * should be cleared the first time that kbd_get is called. + * + * Returned Value: + * 2 - Indicates the successful receipt of a special, "out-of-band" command + * 1 - Indicates the successful receipt of normal, "in-band" ASCII data. + * 0 - Indicates end-of-file or that the stream has been closed + * EOF - An error has getting the next character (reported by the stream). + * + ****************************************************************************/ + +static int kbd_reget(FAR struct kget_getstate_s *state, FAR uint8_t *pch) +{ + /* Return the next character */ + + *pch = state->buf[state->ndx]; + state->ndx++; + state->nch--; + return KBD_NORMAL; +} + +/******************************************************************************************** + * Public Functions + ********************************************************************************************/ + +/**************************************************************************** + * Name: kbd_get + * + * Description: + * Put one byte of data or special command from the driver provided input + * buffer. + * + * Input Parameters: + * stream - An instance of lib_instream_s to do the low-level get + * operation. + * pch - The location character to save the returned value. This may be + * either a normal, "in-band" ASCII characer or a special, "out-of-band" + * command. + * state - A user provided buffer to support parsing. This structure + * should be cleared the first time that kbd_get is called. + * + * Returned Value: + * 1 - Indicates the successful receipt of a special, "out-of-band" command + * 0 - Indicates the successful receipt of normal, "in-band" ASCII data. + * EOF - An error has getting the next character (reported by the stream). + * Normally indicates the end of file. + * + ****************************************************************************/ + +int kbd_get(FAR struct lib_instream_s *stream, + FAR struct kget_getstate_s *state, FAR uint8_t *pch) +{ + int ch; + + DEBUGASSERT(stream && state && pch); + + /* Are their ungotten characters from the last, failed parse? */ + + if (state->nch > 0) + { + /* Yes, return the next ungotten character */ + + return kbd_reget(state, pch); + } + + state->ndx = 0; + + /* No, ungotten characters. Check for the beginning of an esc sequence. */ + + ch = stream->get(stream); + if (ch == EOF) + { + /* End of file/stream */ + + return KBD_ERROR; + } + else + { + state->buf[NDX_ESC] = (uint8_t)ch; + state->nch = NCH_ESC; + + if (ch != ASCII_ESC) + { + /* Not the beginning of an escape sequence. Return the character. */ + + return kbd_reget(state, pch); + } + } + + /* Check for ESC-[ */ + + ch = stream->get(stream); + if (ch == EOF) + { + /* End of file/stream. Return the escape character now. We will + * return the EOF indication next time. + */ + + return kbd_reget(state, pch); + } + else + { + state->buf[NDX_BRACKET] = ch; + state->nch = NCH_BRACKET; + + if (ch != '[') + { + /* Not the beginning of an escape sequence. Return the ESC now, + * return the following character later. + */ + + return kbd_reget(state, pch); + } + } + + /* Get and verify the special, "out-of-band" command code */ + + ch = stream->get(stream); + if (ch == EOF) + { + /* End of file/stream. Unget everything and return the ESC character. + */ + + return kbd_reget(state, pch); + } + else + { + state->buf[NDX_CODE] = (uint8_t)ch; + state->nch = NCH_CODE; + + /* Check for a valid special command code */ + + if (ch < FIRST_KEYCODE || ch > LAST_KEYCODE) + { + /* Not a special command code, return the ESC now and the next two + * characters later. + */ + + return kbd_reget(state, pch); + } + } + + /* Check for the final semicolon */ + + ch = stream->get(stream); + if (ch == EOF) + { + /* End of file/stream. Unget everything and return the ESC character. + */ + + return kbd_reget(state, pch); + } + else + { + state->buf[NCX_SEMICOLON] = (uint8_t)ch; + state->nch = NCH_SEMICOLON; + + /* Check for a valid special command code */ + + if (ch != ';') + { + /* Not a special command code, return the ESC now and the next two + * characters later. + */ + + return kbd_reget(state, pch); + } + } + + /* We have successfully parsed the the entire escape sequence. Return the + * special code in pch and the value 2. + */ + + *pch = state->buf[NDX_CODE]; + state->nch = 0; + return KBD_SPECIAL; +} + diff --git a/nuttx/libc/misc/lib_kbdencode.c b/nuttx/libc/misc/lib_kbdencode.c new file mode 100644 index 000000000..80bf14777 --- /dev/null +++ b/nuttx/libc/misc/lib_kbdencode.c @@ -0,0 +1,81 @@ +/******************************************************************************************** + * libc/msic/lib_kbdencode.c + * Encoding side of the Keyboard CODEC + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Authors: 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include + +#include +#include +#include + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +/******************************************************************************************** + * Public Functions + ********************************************************************************************/ + +/**************************************************************************** + * Name: kbd_putspecial + * + * Description: + * Put one special, "out-of-band" command into the output stream. + * + * Input Parameters: + * + * Returned Value: + * None + * + ****************************************************************************/ + +void kbd_putspecial(enum kbd_keycode_e keycode, + FAR struct lib_outstream_s *stream) +{ + DEBUGASSERT(stream && keycode >= KEYCODE_FWDDEL && keycode <= LAST_KEYCODE); + + stream->put(stream, ASCII_ESC); + stream->put(stream, '['); + stream->put(stream, (int)keycode); + stream->put(stream, ';'); +} + -- cgit v1.2.3 From 4f7967b4c678bef1a42eda3acf739c8bbefd9a07 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 16 Jan 2013 15:41:27 +0000 Subject: apps/builtin/binfs.c moved to nuttx/fs/binfs/fs_binfs.c git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5523 42af7a65-404d-4744-a932-0658087f49c3 --- apps/ChangeLog.txt | 2 + apps/builtin/Kconfig | 14 -- apps/builtin/Makefile | 4 - apps/builtin/binfs.c | 448 ----------------------------------- apps/builtin/builtin.c | 2 + apps/builtin/builtin.h | 77 ------ apps/builtin/exec_builtin.c | 3 +- apps/include/apps.h | 17 -- apps/nshlib/nsh_mntcmds.c | 2 +- nuttx/ChangeLog | 3 +- nuttx/configs/sim/README.txt | 7 +- nuttx/configs/sim/nsh/appconfig | 3 + nuttx/configs/sim/nsh/defconfig | 12 +- nuttx/configs/vsn/nsh/defconfig | 2 +- nuttx/fs/Kconfig | 3 +- nuttx/fs/Makefile | 15 +- nuttx/fs/binfs/Kconfig | 19 ++ nuttx/fs/binfs/Make.defs | 48 ++++ nuttx/fs/binfs/fs_binfs.c | 447 ++++++++++++++++++++++++++++++++++ nuttx/fs/fat/Make.defs | 9 +- nuttx/fs/fs_mount.c | 13 +- nuttx/fs/mmap/Make.defs | 9 +- nuttx/fs/nfs/Make.defs | 9 +- nuttx/fs/nxffs/Make.defs | 9 +- nuttx/fs/romfs/Make.defs | 9 +- nuttx/include/nuttx/binfmt/builtin.h | 85 +++++++ nuttx/include/nuttx/fs/binfs.h | 16 +- nuttx/include/nuttx/fs/dirent.h | 6 +- nuttx/tools/mkconfig.c | 6 +- 29 files changed, 694 insertions(+), 605 deletions(-) delete mode 100644 apps/builtin/binfs.c delete mode 100644 apps/builtin/builtin.h create mode 100644 nuttx/fs/binfs/Kconfig create mode 100644 nuttx/fs/binfs/Make.defs create mode 100644 nuttx/fs/binfs/fs_binfs.c create mode 100644 nuttx/include/nuttx/binfmt/builtin.h (limited to 'apps/builtin/Makefile') diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index f91dc318b..5bc3b2149 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -473,3 +473,5 @@ very lightweight). Now supports open, close, and a new ioctl to recover the builtin filename. The latter will be needed to support a binfs binfmt. + * builtin/binfs.c: Move apps/builtin/binfs.c to fs/binfs/fs_binfs.c + CONFIG_APPS_BINDIR rename CONFIG_FS_BINFS diff --git a/apps/builtin/Kconfig b/apps/builtin/Kconfig index 1049712aa..37150e8a9 100644 --- a/apps/builtin/Kconfig +++ b/apps/builtin/Kconfig @@ -13,20 +13,6 @@ config BUILTIN if BUILTIN - config APPS_BINDIR - bool "BINFS File System" - default n - ---help--- - The BINFS file system is current just a toy. The BINFS may, for example, - be mount at /bin. Then all of the built-in applications will appear as - executable file in /bin if you list them from NSH like: - - nsh> ls -l /bin - - At present, the BINFS supports nothing more than that. It is planned, - however, to support execution of the builtin applications from BINFS as - well (via a binfmt/ loader). However, that is down the road. - config BUILTIN_PROXY_STACKSIZE int "Builtin Proxy Stack Size" default 1024 diff --git a/apps/builtin/Makefile b/apps/builtin/Makefile index 8c8928886..d77054f41 100644 --- a/apps/builtin/Makefile +++ b/apps/builtin/Makefile @@ -41,10 +41,6 @@ include $(APPDIR)/Make.defs ASRCS = CSRCS = builtin.c exec_builtin.c -ifeq ($(CONFIG_APPS_BINDIR),y) -CSRCS += binfs.c -endif - AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/apps/builtin/binfs.c b/apps/builtin/binfs.c deleted file mode 100644 index 611e2b3bb..000000000 --- a/apps/builtin/binfs.c +++ /dev/null @@ -1,448 +0,0 @@ -/**************************************************************************** - * apps/builtin/binfs.c - * - * Copyright (C) 2011-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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include "builtin.h" - -#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_APPS_BINDIR) - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -static int binfs_open(FAR struct file *filep, const char *relpath, - int oflags, mode_t mode); -static int binfs_close(FAR struct file *filep); -static ssize_t binfs_read(FAR struct file *filep, char *buffer, size_t buflen); -static int binfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg); - -static int binfs_dup(FAR const struct file *oldp, FAR struct file *newp); - -static int binfs_opendir(struct inode *mountpt, const char *relpath, - struct fs_dirent_s *dir); -static int binfs_readdir(FAR struct inode *mountpt, - FAR struct fs_dirent_s *dir); -static int binfs_rewinddir(FAR struct inode *mountpt, - FAR struct fs_dirent_s *dir); - -static int binfs_bind(FAR struct inode *blkdriver, FAR const void *data, - FAR void **handle); -static int binfs_unbind(FAR void *handle, FAR struct inode **blkdriver); -static int binfs_statfs(FAR struct inode *mountpt, - FAR struct statfs *buf); - -static int binfs_stat(FAR struct inode *mountpt, FAR const char *relpath, - FAR struct stat *buf); - -/**************************************************************************** - * Private Variables - ****************************************************************************/ - -/**************************************************************************** - * Public Variables - ****************************************************************************/ - -/* See fs_mount.c -- this structure is explicitly externed there. - * We use the old-fashioned kind of initializers so that this will compile - * with any compiler. - */ - -const struct mountpt_operations binfs_operations = -{ - binfs_open, /* open */ - binfs_close, /* close */ - binfs_read, /* read */ - NULL, /* write */ - NULL, /* seek */ - binfs_ioctl, /* ioctl */ - - NULL, /* sync */ - binfs_dup, /* dup */ - - binfs_opendir, /* opendir */ - NULL, /* closedir */ - binfs_readdir, /* readdir */ - binfs_rewinddir, /* rewinddir */ - - binfs_bind, /* bind */ - binfs_unbind, /* unbind */ - binfs_statfs, /* statfs */ - - NULL, /* unlink */ - NULL, /* mkdir */ - NULL, /* rmdir */ - NULL, /* rename */ - binfs_stat /* stat */ -}; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: binfs_open - ****************************************************************************/ - -static int binfs_open(FAR struct file *filep, FAR const char *relpath, - int oflags, mode_t mode) -{ - int index; - - fvdbg("Open '%s'\n", relpath); - - /* BINFS is read-only. Any attempt to open with any kind of write - * access is not permitted. - */ - - if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) - { - fdbg("ERROR: Only O_RDONLY supported\n"); - return -EACCES; - } - - /* Check if the an entry exists with this name in the root directory. - * so the 'relpath' must be the name of the builtin function. - */ - - index = builtin_isavail(relpath); - if (index < 0) - { - fdbg("ERROR: Builting %s does not exist\n", relpath); - return -ENOENT; - } - - /* Save the index as the open-specific state in filep->f_priv */ - - filep->f_priv = (FAR void *)index; - return OK; -} - -/**************************************************************************** - * Name: binfs_close - ****************************************************************************/ - -static int binfs_close(FAR struct file *filep) -{ - fvdbg("Closing\n"); - return OK; -} - -/**************************************************************************** - * Name: binfs_read - ****************************************************************************/ - -static ssize_t binfs_read(FAR struct file *filep, char *buffer, size_t buflen) -{ - /* Reading is not supported. Just return end-of-file */ - - fvdbg("Read %d bytes from offset %d\n", buflen, filep->f_pos); - return 0; -} - -/**************************************************************************** - * Name: binfs_ioctl - ****************************************************************************/ - -static int binfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg) -{ - int ret; - - fvdbg("cmd: %d arg: %08lx\n", cmd, arg); - - /* Only one IOCTL command is supported */ - - if (cmd == FIOC_FILENAME) - { - /* IN: FAR char const ** pointer - * OUT: Pointer to a persistent file name (Guaranteed to persist while - * the file is open). - */ - - FAR const char **ptr = (FAR const char **)((uintptr_t)arg); - if (ptr == NULL) - { - ret = -EINVAL; - } - else - { - *ptr = g_builtins[(int)filep->f_priv].name; - ret = OK; - } - } - else - { - ret = -ENOTTY; - } - - return ret; -} - -/**************************************************************************** - * Name: binfs_dup - * - * Description: - * Duplicate open file data in the new file structure. - * - ****************************************************************************/ - -static int binfs_dup(FAR const struct file *oldp, FAR struct file *newp) -{ - fvdbg("Dup %p->%p\n", oldp, newp); - - /* Copy the index from the old to the new file structure */ - - newp->f_priv = oldp->f_priv; - return OK; -} - -/**************************************************************************** - * Name: binfs_opendir - * - * Description: - * Open a directory for read access - * - ****************************************************************************/ - -static int binfs_opendir(struct inode *mountpt, const char *relpath, - struct fs_dirent_s *dir) -{ - fvdbg("relpath: \"%s\"\n", relpath ? relpath : "NULL"); - - /* The requested directory must be the volume-relative "root" directory */ - - if (relpath && relpath[0] != '\0') - { - return -ENOENT; - } - - /* Set the index to the first entry */ - - dir->u.binfs.fb_index = 0; - return OK; -} - -/**************************************************************************** - * Name: binfs_readdir - * - * Description: Read the next directory entry - * - ****************************************************************************/ - -static int binfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir) -{ - unsigned int index; - int ret; - - /* Have we reached the end of the directory */ - - index = dir->u.binfs.fb_index; - if (g_builtins[index].name == NULL) - { - /* We signal the end of the directory by returning the - * special error -ENOENT - */ - - fvdbg("Entry %d: End of directory\n", index); - ret = -ENOENT; - } - else - { - /* Save the filename and file type */ - - fvdbg("Entry %d: \"%s\"\n", index, g_builtins[index].name); - dir->fd_dir.d_type = DTYPE_FILE; - strncpy(dir->fd_dir.d_name, g_builtins[index].name, NAME_MAX+1); - - /* The application list is terminated by an entry with a NULL name. - * Therefore, there is at least one more entry in the list. - */ - - index++; - - /* Set up the next directory entry offset. NOTE that we could use the - * standard f_pos instead of our own private fb_index. - */ - - dir->u.binfs.fb_index = index; - ret = OK; - } - - return ret; -} - -/**************************************************************************** - * Name: binfs_rewindir - * - * Description: Reset directory read to the first entry - * - ****************************************************************************/ - -static int binfs_rewinddir(struct inode *mountpt, struct fs_dirent_s *dir) -{ - fvdbg("Entry\n"); - - dir->u.binfs.fb_index = 0; - return OK; -} - -/**************************************************************************** - * Name: binfs_bind - * - * Description: This implements a portion of the mount operation. This - * function allocates and initializes the mountpoint private data and - * binds the blockdriver inode to the filesystem private data. The final - * binding of the private data (containing the blockdriver) to the - * mountpoint is performed by mount(). - * - ****************************************************************************/ - -static int binfs_bind(FAR struct inode *blkdriver, const void *data, - void **handle) -{ - fvdbg("Entry\n"); - return OK; -} - -/**************************************************************************** - * Name: binfs_unbind - * - * Description: This implements the filesystem portion of the umount - * operation. - * - ****************************************************************************/ - -static int binfs_unbind(void *handle, FAR struct inode **blkdriver) -{ - fvdbg("Entry\n"); - return OK; -} - -/**************************************************************************** - * Name: binfs_statfs - * - * Description: Return filesystem statistics - * - ****************************************************************************/ - -static int binfs_statfs(struct inode *mountpt, struct statfs *buf) -{ - fvdbg("Entry\n"); - - /* Fill in the statfs info */ - - memset(buf, 0, sizeof(struct statfs)); - buf->f_type = BINFS_MAGIC; - buf->f_bsize = 0; - buf->f_blocks = 0; - buf->f_bfree = 0; - buf->f_bavail = 0; - buf->f_namelen = NAME_MAX; - return OK; -} - -/**************************************************************************** - * Name: binfs_stat - * - * Description: Return information about a file or directory - * - ****************************************************************************/ - -static int binfs_stat(struct inode *mountpt, const char *relpath, struct stat *buf) -{ - fvdbg("Entry\n"); - - /* The requested directory must be the volume-relative "root" directory */ - - if (relpath && relpath[0] != '\0') - { - /* Check if there is a file with this name. */ - - if (builtin_isavail(relpath) < 0) - { - return -ENOENT; - } - - /* It's a execute-only file name */ - - buf->st_mode = S_IFREG|S_IXOTH|S_IXGRP|S_IXUSR; - } - else - { - /* It's a read/execute-only directory name */ - - buf->st_mode = S_IFDIR|S_IROTH|S_IRGRP|S_IRUSR|S_IXOTH|S_IXGRP|S_IXUSR; - } - - /* File/directory size, access block size */ - - buf->st_size = 0; - buf->st_blksize = 0; - buf->st_blocks = 0; - return OK; -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_APPS_BINDIR */ - diff --git a/apps/builtin/builtin.c b/apps/builtin/builtin.c index e0ae9888a..90c0b1353 100644 --- a/apps/builtin/builtin.c +++ b/apps/builtin/builtin.c @@ -40,6 +40,8 @@ ****************************************************************************/ #include + +#include #include /**************************************************************************** diff --git a/apps/builtin/builtin.h b/apps/builtin/builtin.h deleted file mode 100644 index 4593809ee..000000000 --- a/apps/builtin/builtin.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** - * apps/builtin/builtin.h - * - * Copyright (C) 2011 Uros Platise. All rights reserved. - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. - * Authors: Uros Platise - * 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. - * - ****************************************************************************/ - -#ifndef __APPS_BUILTIN_BUILTIN_H -#define __APPS_BUILTIN_BUILTIN_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern -#endif - -EXTERN const struct builtin_s g_builtins[]; - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -EXTERN int number_builtins(void); - -#undef EXTERN -#if defined(__cplusplus) -} -#endif - -#endif /* __APPS_BUILTIN_BUILTIN_H */ - diff --git a/apps/builtin/exec_builtin.c b/apps/builtin/exec_builtin.c index a3e79a945..6868d7ee7 100644 --- a/apps/builtin/exec_builtin.c +++ b/apps/builtin/exec_builtin.c @@ -53,10 +53,9 @@ #include #include +#include #include -#include "builtin.h" - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ diff --git a/apps/include/apps.h b/apps/include/apps.h index 9f1918e57..0fb807c14 100644 --- a/apps/include/apps.h +++ b/apps/include/apps.h @@ -62,14 +62,6 @@ * Public Types ****************************************************************************/ -struct builtin_s -{ - const char *name; /* Invocation name and as seen under /sbin/ */ - int priority; /* Use: SCHED_PRIORITY_DEFAULT */ - int stacksize; /* Desired stack size */ - main_t main; /* Entry point: main(int argc, char *argv[]) */ -}; - /**************************************************************************** * Public Data ****************************************************************************/ @@ -82,15 +74,6 @@ extern "C" { #define EXTERN extern #endif -/* The "bindir" is file system that supports access to the builtin applications. - * It is typically mounted under /bin. - */ - -#ifdef CONFIG_APPS_BINDIR -EXTERN mountpt_operations; -EXTERN const struct mountpt_operations binfs_operations; -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/apps/nshlib/nsh_mntcmds.c b/apps/nshlib/nsh_mntcmds.c index f6eb26c31..b16ba8465 100644 --- a/apps/nshlib/nsh_mntcmds.c +++ b/apps/nshlib/nsh_mntcmds.c @@ -131,7 +131,7 @@ static int mount_handler(FAR const char *mountpoint, break; #endif -#ifdef CONFIG_APPS_BINDIR +#ifdef CONFIG_FS_BINFS case BINFS_MAGIC: fstype = "bindir"; break; diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 2d2cd8259..ed85f06e1 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3955,4 +3955,5 @@ * arch/mips/src/mips32/up_vfork.c, up_vfork.h, and vfork.S: Implement vfork() for MIPS32 (no floating point support) * configs/ubw32/ostest: Enable the vfork() test. - + * fs/binfs: Move apps/builtin/binfs.c to fs/binfs/fs_binfs.c + CONFIG_APPS_BINDIR rename CONFIG_FS_BINFS diff --git a/nuttx/configs/sim/README.txt b/nuttx/configs/sim/README.txt index 8abfd9c23..165e92b96 100644 --- a/nuttx/configs/sim/README.txt +++ b/nuttx/configs/sim/README.txt @@ -270,8 +270,9 @@ nsh Description ----------- - Configures to use the NuttShell at apps/examples/nsh. This configuration - may be selected as follows: + Configures to use the NuttShell at apps/examples/nsh. This version has + one builtin function: This configuration: apps/examples/hello. This + configuration may be selected as follows: cd /tools ./configure.sh sim/nsh @@ -281,7 +282,7 @@ nsh2 Description ----------- This is another example that configures to use the NuttShell at apps/examples/nsh. - Unlike nsh, this version uses NSH built-in functions. The nx, nxhello, and + Like nsh, this version uses NSH built-in functions: The nx, nxhello, and nxlines examples are included as built-in functions. X11 Configuration diff --git a/nuttx/configs/sim/nsh/appconfig b/nuttx/configs/sim/nsh/appconfig index 264588e51..3f50f6818 100644 --- a/nuttx/configs/sim/nsh/appconfig +++ b/nuttx/configs/sim/nsh/appconfig @@ -42,3 +42,6 @@ CONFIGURED_APPS += examples/nsh CONFIGURED_APPS += system/readline CONFIGURED_APPS += nshlib +# Example built-in application + +CONFIGURED_APPS += examples/hello diff --git a/nuttx/configs/sim/nsh/defconfig b/nuttx/configs/sim/nsh/defconfig index cec10459a..146519aa6 100644 --- a/nuttx/configs/sim/nsh/defconfig +++ b/nuttx/configs/sim/nsh/defconfig @@ -1,7 +1,7 @@ ############################################################################ # sim/nsh/defconfig # -# Copyright (C) 2008-2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2008-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -46,7 +46,7 @@ CONFIG_ARCH_BOARD_SIM=y CONFIG_USER_ENTRYPOINT="nsh_main" CONFIG_DEBUG=n CONFIG_DEBUG_VERBOSE=n -CONFIG_DEBUG_SYMBOLS=n +CONFIG_DEBUG_SYMBOLS=y CONFIG_HAVE_CXX=n CONFIG_HAVE_CXXINITIALIZE=n @@ -170,6 +170,7 @@ CONFIG_FAT_LFN=n CONFIG_FAT_MAXFNAME=32 CONFIG_FS_NXFFS=n CONFIG_FS_ROMFS=y +CONFIG_FS_BINFS=y # # TCP/IP and UDP support via uIP @@ -193,6 +194,11 @@ CONFIG_NET_STATISTICS=y #CONFIG_NET_ARPTAB_SIZE=8 CONFIG_NET_BROADCAST=n +# +# Settings for examples/hello +# +CONFIG_EXAMPLES_HELLO_BUILTIN=y + # # UIP Network Utilities # @@ -224,7 +230,7 @@ CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192 # # Settings for apps/nshlib # -CONFIG_NSH_BUILTIN_APPS=n +CONFIG_NSH_BUILTIN_APPS=y CONFIG_NSH_FILEIOSIZE=1024 CONFIG_NSH_STRERROR=n CONFIG_NSH_LINELEN=80 diff --git a/nuttx/configs/vsn/nsh/defconfig b/nuttx/configs/vsn/nsh/defconfig index 5952f4724..5ec7e06eb 100755 --- a/nuttx/configs/vsn/nsh/defconfig +++ b/nuttx/configs/vsn/nsh/defconfig @@ -526,4 +526,4 @@ CONFIG_HEAP_SIZE= CONFIG_APPS_DIR="../apps" # Provide /dev/ramX and then: mount -t binfs /dev/ram0 /bin -CONFIG_APPS_BINDIR=y +CONFIG_FS_BINFS=y diff --git a/nuttx/fs/Kconfig b/nuttx/fs/Kconfig index 1d1046735..dfbfda3fa 100644 --- a/nuttx/fs/Kconfig +++ b/nuttx/fs/Kconfig @@ -5,11 +5,12 @@ comment "File system configuration" -source fs/fat/Kconfig source fs/mmap/Kconfig +source fs/fat/Kconfig source fs/nfs/Kconfig source fs/nxffs/Kconfig source fs/romfs/Kconfig +source fs/binfs/Kconfig comment "System Logging" diff --git a/nuttx/fs/Makefile b/nuttx/fs/Makefile index 6955c164b..2a1fd75a8 100644 --- a/nuttx/fs/Makefile +++ b/nuttx/fs/Makefile @@ -1,7 +1,7 @@ ############################################################################ # fs/Makefile # -# Copyright (C) 2007, 2008, 2011-2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2007, 2008, 2011-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -72,6 +72,9 @@ CSRCS += fs_registerdriver.c fs_unregisterdriver.c CSRCS += fs_registerblockdriver.c fs_unregisterblockdriver.c \ fs_findblockdriver.c fs_openblockdriver.c fs_closeblockdriver.c +DEPPATH = +VPATH = . + include mmap/Make.defs # Stream support @@ -91,13 +94,17 @@ endif # Additional files required is mount-able file systems are supported ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y) + CSRCS += fs_fsync.c fs_mkdir.c fs_mount.c fs_rename.c fs_rmdir.c \ fs_umount.c fs_unlink.c CSRCS += fs_foreachmountpoint.c + include fat/Make.defs include romfs/Make.defs include nxffs/Make.defs include nfs/Make.defs +include binfs/Make.defs + endif endif @@ -108,8 +115,7 @@ OBJS = $(AOBJS) $(COBJS) BIN = libfs$(LIBEXT) -SUBDIRS = mmap fat romfs nxffs:nfs -VPATH = mmap:fat:romfs:nxffs:nfs +SUBDIRS = mmap fat romfs nxffs nfs binfs all: $(BIN) @@ -123,8 +129,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $(OBJS)) .depend: Makefile $(SRCS) - $(Q) $(MKDEP) --dep-path . $(MMAPDEPPATH) $(FATDEPPATH) $(ROMFSDEPPATH) $(NXFFSDEPPATH) $(NFSDEPPATH) \ - "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) $(MKDEP) --dep-path . $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep $(Q) touch $@ depend: .depend diff --git a/nuttx/fs/binfs/Kconfig b/nuttx/fs/binfs/Kconfig new file mode 100644 index 000000000..eedbe497d --- /dev/null +++ b/nuttx/fs/binfs/Kconfig @@ -0,0 +1,19 @@ +# +# For a description of the syntax of this configuration file, +# see misc/tools/kconfig-language.txt. +# + +config FS_BINFS + bool "BINFS File System" + default n + depends on BUILTIN + ---help--- + The BINFS file system is provides access to builtin applications through + the NuttX file system. The BINFS may, for example, be mount at /bin. + Then all of the built-in applications will appear as executable files in + /bin. Then, for example, you list them from NSH like: + + nsh> ls -l /bin + + If the BINFS BINFMT loader is also enabled, then the builtin applications + can be executed through the normal mechanisms (posix_spawn(), exev(), etc.) diff --git a/nuttx/fs/binfs/Make.defs b/nuttx/fs/binfs/Make.defs new file mode 100644 index 000000000..a65b7367f --- /dev/null +++ b/nuttx/fs/binfs/Make.defs @@ -0,0 +1,48 @@ +############################################################################ +# fs/binfs/Make.defs +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_FS_BINFS),y) +# Files required for BINFS file system support + +ASRCS += +CSRCS += fs_binfs.c + +# Include BINFS build support + +DEPPATH += --dep-path binfs +VPATH += :binfs +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)fs$(DELIM)binfs} + +endif diff --git a/nuttx/fs/binfs/fs_binfs.c b/nuttx/fs/binfs/fs_binfs.c new file mode 100644 index 000000000..2508719e7 --- /dev/null +++ b/nuttx/fs/binfs/fs_binfs.c @@ -0,0 +1,447 @@ +/**************************************************************************** + * fs/binfs/fs_binfs.c + * + * Copyright (C) 2011-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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_BINFS) + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static int binfs_open(FAR struct file *filep, const char *relpath, + int oflags, mode_t mode); +static int binfs_close(FAR struct file *filep); +static ssize_t binfs_read(FAR struct file *filep, char *buffer, size_t buflen); +static int binfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg); + +static int binfs_dup(FAR const struct file *oldp, FAR struct file *newp); + +static int binfs_opendir(struct inode *mountpt, const char *relpath, + struct fs_dirent_s *dir); +static int binfs_readdir(FAR struct inode *mountpt, + FAR struct fs_dirent_s *dir); +static int binfs_rewinddir(FAR struct inode *mountpt, + FAR struct fs_dirent_s *dir); + +static int binfs_bind(FAR struct inode *blkdriver, FAR const void *data, + FAR void **handle); +static int binfs_unbind(FAR void *handle, FAR struct inode **blkdriver); +static int binfs_statfs(FAR struct inode *mountpt, + FAR struct statfs *buf); + +static int binfs_stat(FAR struct inode *mountpt, FAR const char *relpath, + FAR struct stat *buf); + +/**************************************************************************** + * Private Variables + ****************************************************************************/ + +/**************************************************************************** + * Public Variables + ****************************************************************************/ + +/* See fs_mount.c -- this structure is explicitly externed there. + * We use the old-fashioned kind of initializers so that this will compile + * with any compiler. + */ + +const struct mountpt_operations binfs_operations = +{ + binfs_open, /* open */ + binfs_close, /* close */ + binfs_read, /* read */ + NULL, /* write */ + NULL, /* seek */ + binfs_ioctl, /* ioctl */ + + NULL, /* sync */ + binfs_dup, /* dup */ + + binfs_opendir, /* opendir */ + NULL, /* closedir */ + binfs_readdir, /* readdir */ + binfs_rewinddir, /* rewinddir */ + + binfs_bind, /* bind */ + binfs_unbind, /* unbind */ + binfs_statfs, /* statfs */ + + NULL, /* unlink */ + NULL, /* mkdir */ + NULL, /* rmdir */ + NULL, /* rename */ + binfs_stat /* stat */ +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: binfs_open + ****************************************************************************/ + +static int binfs_open(FAR struct file *filep, FAR const char *relpath, + int oflags, mode_t mode) +{ + int index; + + fvdbg("Open '%s'\n", relpath); + + /* BINFS is read-only. Any attempt to open with any kind of write + * access is not permitted. + */ + + if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) + { + fdbg("ERROR: Only O_RDONLY supported\n"); + return -EACCES; + } + + /* Check if the an entry exists with this name in the root directory. + * so the 'relpath' must be the name of the builtin function. + */ + + index = builtin_isavail(relpath); + if (index < 0) + { + fdbg("ERROR: Builting %s does not exist\n", relpath); + return -ENOENT; + } + + /* Save the index as the open-specific state in filep->f_priv */ + + filep->f_priv = (FAR void *)index; + return OK; +} + +/**************************************************************************** + * Name: binfs_close + ****************************************************************************/ + +static int binfs_close(FAR struct file *filep) +{ + fvdbg("Closing\n"); + return OK; +} + +/**************************************************************************** + * Name: binfs_read + ****************************************************************************/ + +static ssize_t binfs_read(FAR struct file *filep, char *buffer, size_t buflen) +{ + /* Reading is not supported. Just return end-of-file */ + + fvdbg("Read %d bytes from offset %d\n", buflen, filep->f_pos); + return 0; +} + +/**************************************************************************** + * Name: binfs_ioctl + ****************************************************************************/ + +static int binfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg) +{ + int ret; + + fvdbg("cmd: %d arg: %08lx\n", cmd, arg); + + /* Only one IOCTL command is supported */ + + if (cmd == FIOC_FILENAME) + { + /* IN: FAR char const ** pointer + * OUT: Pointer to a persistent file name (Guaranteed to persist while + * the file is open). + */ + + FAR const char **ptr = (FAR const char **)((uintptr_t)arg); + if (ptr == NULL) + { + ret = -EINVAL; + } + else + { + *ptr = g_builtins[(int)filep->f_priv].name; + ret = OK; + } + } + else + { + ret = -ENOTTY; + } + + return ret; +} + +/**************************************************************************** + * Name: binfs_dup + * + * Description: + * Duplicate open file data in the new file structure. + * + ****************************************************************************/ + +static int binfs_dup(FAR const struct file *oldp, FAR struct file *newp) +{ + fvdbg("Dup %p->%p\n", oldp, newp); + + /* Copy the index from the old to the new file structure */ + + newp->f_priv = oldp->f_priv; + return OK; +} + +/**************************************************************************** + * Name: binfs_opendir + * + * Description: + * Open a directory for read access + * + ****************************************************************************/ + +static int binfs_opendir(struct inode *mountpt, const char *relpath, + struct fs_dirent_s *dir) +{ + fvdbg("relpath: \"%s\"\n", relpath ? relpath : "NULL"); + + /* The requested directory must be the volume-relative "root" directory */ + + if (relpath && relpath[0] != '\0') + { + return -ENOENT; + } + + /* Set the index to the first entry */ + + dir->u.binfs.fb_index = 0; + return OK; +} + +/**************************************************************************** + * Name: binfs_readdir + * + * Description: Read the next directory entry + * + ****************************************************************************/ + +static int binfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir) +{ + unsigned int index; + int ret; + + /* Have we reached the end of the directory */ + + index = dir->u.binfs.fb_index; + if (g_builtins[index].name == NULL) + { + /* We signal the end of the directory by returning the + * special error -ENOENT + */ + + fvdbg("Entry %d: End of directory\n", index); + ret = -ENOENT; + } + else + { + /* Save the filename and file type */ + + fvdbg("Entry %d: \"%s\"\n", index, g_builtins[index].name); + dir->fd_dir.d_type = DTYPE_FILE; + strncpy(dir->fd_dir.d_name, g_builtins[index].name, NAME_MAX+1); + + /* The application list is terminated by an entry with a NULL name. + * Therefore, there is at least one more entry in the list. + */ + + index++; + + /* Set up the next directory entry offset. NOTE that we could use the + * standard f_pos instead of our own private fb_index. + */ + + dir->u.binfs.fb_index = index; + ret = OK; + } + + return ret; +} + +/**************************************************************************** + * Name: binfs_rewindir + * + * Description: Reset directory read to the first entry + * + ****************************************************************************/ + +static int binfs_rewinddir(struct inode *mountpt, struct fs_dirent_s *dir) +{ + fvdbg("Entry\n"); + + dir->u.binfs.fb_index = 0; + return OK; +} + +/**************************************************************************** + * Name: binfs_bind + * + * Description: This implements a portion of the mount operation. This + * function allocates and initializes the mountpoint private data and + * binds the blockdriver inode to the filesystem private data. The final + * binding of the private data (containing the blockdriver) to the + * mountpoint is performed by mount(). + * + ****************************************************************************/ + +static int binfs_bind(FAR struct inode *blkdriver, const void *data, + void **handle) +{ + fvdbg("Entry\n"); + return OK; +} + +/**************************************************************************** + * Name: binfs_unbind + * + * Description: This implements the filesystem portion of the umount + * operation. + * + ****************************************************************************/ + +static int binfs_unbind(void *handle, FAR struct inode **blkdriver) +{ + fvdbg("Entry\n"); + return OK; +} + +/**************************************************************************** + * Name: binfs_statfs + * + * Description: Return filesystem statistics + * + ****************************************************************************/ + +static int binfs_statfs(struct inode *mountpt, struct statfs *buf) +{ + fvdbg("Entry\n"); + + /* Fill in the statfs info */ + + memset(buf, 0, sizeof(struct statfs)); + buf->f_type = BINFS_MAGIC; + buf->f_bsize = 0; + buf->f_blocks = 0; + buf->f_bfree = 0; + buf->f_bavail = 0; + buf->f_namelen = NAME_MAX; + return OK; +} + +/**************************************************************************** + * Name: binfs_stat + * + * Description: Return information about a file or directory + * + ****************************************************************************/ + +static int binfs_stat(struct inode *mountpt, const char *relpath, struct stat *buf) +{ + fvdbg("Entry\n"); + + /* The requested directory must be the volume-relative "root" directory */ + + if (relpath && relpath[0] != '\0') + { + /* Check if there is a file with this name. */ + + if (builtin_isavail(relpath) < 0) + { + return -ENOENT; + } + + /* It's a execute-only file name */ + + buf->st_mode = S_IFREG|S_IXOTH|S_IXGRP|S_IXUSR; + } + else + { + /* It's a read/execute-only directory name */ + + buf->st_mode = S_IFDIR|S_IROTH|S_IRGRP|S_IRUSR|S_IXOTH|S_IXGRP|S_IXUSR; + } + + /* File/directory size, access block size */ + + buf->st_size = 0; + buf->st_blksize = 0; + buf->st_blocks = 0; + return OK; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +#endif /* !CONFIG_DISABLE_MOUNTPOINT && CONFIG_FS_BINFS */ + diff --git a/nuttx/fs/fat/Make.defs b/nuttx/fs/fat/Make.defs index 136302b86..2769ab602 100644 --- a/nuttx/fs/fat/Make.defs +++ b/nuttx/fs/fat/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # Make.defs # -# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2011, 2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -44,7 +44,10 @@ CSRCS += fs_fat32.c fs_fat32dirent.c fs_fat32attrib.c fs_fat32util.c ASRCS += CSRCS += fs_mkfatfs.c fs_configfat.c fs_writefat.c -# Argument for dependency checking +# Include FAT build support + +DEPPATH += --dep-path fat +VPATH += :fat +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)fs$(DELIM)fat} -FATDEPPATH = --dep-path fat endif diff --git a/nuttx/fs/fs_mount.c b/nuttx/fs/fs_mount.c index 228c1fc6e..1b3da8dc3 100644 --- a/nuttx/fs/fs_mount.c +++ b/nuttx/fs/fs_mount.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/fs_mount.c * - * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,10 +47,6 @@ #include -#ifdef CONFIG_APPS_BINDIR -# include -#endif - #include "fs_internal.h" /* At least one filesystem must be defined, or this file will not compile. @@ -78,7 +74,7 @@ /* These file systems do not require block drivers */ -#if defined(CONFIG_FS_NXFFS) || defined(CONFIG_APPS_BINDIR) || defined(CONFIG_NFS) +#if defined(CONFIG_FS_NXFFS) || defined(CONFIG_FS_BINFS) || defined(CONFIG_NFS) # define NONBDFS_SUPPORT #endif @@ -123,6 +119,9 @@ extern const struct mountpt_operations nxffs_operations; #ifdef CONFIG_NFS extern const struct mountpt_operations nfs_operations; #endif +#ifdef CONFIG_FS_BINFS +extern const struct mountpt_operations binfs_operations; +#endif static const struct fsmap_t g_nonbdfsmap[] = { @@ -132,7 +131,7 @@ static const struct fsmap_t g_nonbdfsmap[] = #ifdef CONFIG_NFS { "nfs", &nfs_operations }, #endif -#ifdef CONFIG_APPS_BINDIR +#ifdef CONFIG_FS_BINFS { "binfs", &binfs_operations }, #endif { NULL, NULL }, diff --git a/nuttx/fs/mmap/Make.defs b/nuttx/fs/mmap/Make.defs index 59857fe9c..b85d9f60f 100644 --- a/nuttx/fs/mmap/Make.defs +++ b/nuttx/fs/mmap/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # fs/mmap/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -40,4 +40,9 @@ ifeq ($(CONFIG_FS_RAMMAP),y) CSRCS += fs_munmap.c fs_rammap.c endif -MMAPDEPPATH = --dep-path mmap +# Include MMAP build support + +DEPPATH += --dep-path mmap +VPATH += :mmap +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)fs$(DELIM)mmap} + diff --git a/nuttx/fs/nfs/Make.defs b/nuttx/fs/nfs/Make.defs index fc4682f85..ec2177fcf 100644 --- a/nuttx/fs/nfs/Make.defs +++ b/nuttx/fs/nfs/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # Make.defs # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -44,7 +44,10 @@ CSRCS += ASRCS += CSRCS += rpc_clnt.c nfs_util.c nfs_vfsops.c -# Argument for dependency checking +# Include NFS build support + +DEPPATH += --dep-path nfs +VPATH += :nfs +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)fs$(DELIM)nfs} -NFSDEPPATH = --dep-path nfs endif diff --git a/nuttx/fs/nxffs/Make.defs b/nuttx/fs/nxffs/Make.defs index b67ae4472..ccf1ba661 100644 --- a/nuttx/fs/nxffs/Make.defs +++ b/nuttx/fs/nxffs/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # fs/nxffs/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -40,7 +40,10 @@ CSRCS += nxffs_block.c nxffs_blockstats.c nxffs_cache.c nxffs_dirent.c \ nxffs_open.c nxffs_pack.c nxffs_read.c nxffs_reformat.c \ nxffs_stat.c nxffs_unlink.c nxffs_util.c nxffs_write.c -# Argument for dependency checking +# Include NXFFS build support + +DEPPATH += --dep-path nxffs +VPATH += :nxffs +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)fs$(DELIM)nxffs} -NXFFSDEPPATH = --dep-path nxffs endif diff --git a/nuttx/fs/romfs/Make.defs b/nuttx/fs/romfs/Make.defs index 77de93c05..e87cbdf9e 100644 --- a/nuttx/fs/romfs/Make.defs +++ b/nuttx/fs/romfs/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # fs/romfs/Make.defs # -# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2011, 2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -39,7 +39,10 @@ ifeq ($(CONFIG_FS_ROMFS),y) ASRCS += CSRCS += fs_romfs.c fs_romfsutil.c -# Argument for dependency checking +# Include ROMFS build support + +DEPPATH += --dep-path romfs +VPATH += :romfs +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)fs$(DELIM)romfs} -ROMFSDEPPATH = --dep-path romfs endif diff --git a/nuttx/include/nuttx/binfmt/builtin.h b/nuttx/include/nuttx/binfmt/builtin.h new file mode 100644 index 000000000..c27605cac --- /dev/null +++ b/nuttx/include/nuttx/binfmt/builtin.h @@ -0,0 +1,85 @@ +/**************************************************************************** + * include/nuttx/binfmt/builtin.h + * + * Copyright (C) 2011 Uros Platise. All rights reserved. + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Authors: Uros Platise + * 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. + * + ****************************************************************************/ + +#ifndef __INCLUDE_NUTTX_BINFMT_BUILTIN_H +#define __INCLUDE_NUTTX_BINFMT_BUILTIN_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +struct builtin_s +{ + const char *name; /* Invocation name and as seen under /sbin/ */ + int priority; /* Use: SCHED_PRIORITY_DEFAULT */ + int stacksize; /* Desired stack size */ + main_t main; /* Entry point: main(int argc, char *argv[]) */ +}; + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +EXTERN const struct builtin_s g_builtins[]; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +EXTERN int number_builtins(void); + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* __INCLUDE_NUTTX_BINFMT_BUILTIN_H */ + diff --git a/nuttx/include/nuttx/fs/binfs.h b/nuttx/include/nuttx/fs/binfs.h index 6125384a9..df92375e3 100644 --- a/nuttx/include/nuttx/fs/binfs.h +++ b/nuttx/include/nuttx/fs/binfs.h @@ -44,6 +44,8 @@ #include +#ifdef CONFIG_FS_BINFS + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -62,7 +64,7 @@ ****************************************************************************/ /**************************************************************************** - * Public Function Prototypes + * Public Data ****************************************************************************/ #ifdef __cplusplus @@ -72,9 +74,21 @@ extern "C" { #define EXTERN extern #endif +/* The "bindir" is file system that supports access to the builtin applications. + * It is typically mounted under /bin. + */ + +EXTERN mountpt_operations; +EXTERN const struct mountpt_operations binfs_operations; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + #undef EXTERN #ifdef __cplusplus } #endif +#endif /* CONFIG_FS_BINFS */ #endif /* __INCLUDE_NUTTX_FS_BINFS_H */ diff --git a/nuttx/include/nuttx/fs/dirent.h b/nuttx/include/nuttx/fs/dirent.h index 75867c87a..f8d356850 100644 --- a/nuttx/include/nuttx/fs/dirent.h +++ b/nuttx/include/nuttx/fs/dirent.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/nuttx/fs/dirent.h * - * Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -102,7 +102,7 @@ struct fs_romfsdir_s }; #endif /* CONFIG_FS_ROMFS */ -#ifdef CONFIG_APPS_BINDIR +#ifdef CONFIG_FS_BINFS /* The apps/ pseudo bin/ directory. The state value is simply an index */ struct fs_binfsdir_s @@ -179,7 +179,7 @@ struct fs_dirent_s #ifdef CONFIG_FS_ROMFS struct fs_romfsdir_s romfs; #endif -#ifdef CONFIG_APPS_BINDIR +#ifdef CONFIG_FS_BINFS struct fs_binfsdir_s binfs; #endif #ifdef CONFIG_FS_NXFFS diff --git a/nuttx/tools/mkconfig.c b/nuttx/tools/mkconfig.c index f4a1168c5..fe3e00491 100644 --- a/nuttx/tools/mkconfig.c +++ b/nuttx/tools/mkconfig.c @@ -1,7 +1,7 @@ /**************************************************************************** * tools/mkconfig.c * - * Copyright (C) 2007-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -213,14 +213,14 @@ int main(int argc, char **argv, char **envp) printf("# undef CONFIG_FS_FAT\n"); printf("# undef CONFIG_FS_ROMFS\n"); printf("# undef CONFIG_FS_NXFFS\n"); - printf("# undef CONFIG_APPS_BINDIR\n"); + printf("# undef CONFIG_FS_BINFS\n"); printf("# undef CONFIG_NFS\n"); printf("#endif\n\n"); printf("/* Check if any readable and writable filesystem (OR USB storage) is supported */\n\n"); printf("#undef CONFIG_FS_READABLE\n"); printf("#undef CONFIG_FS_WRITABLE\n"); printf("#if defined(CONFIG_FS_FAT) || defined(CONFIG_FS_ROMFS) || defined(CONFIG_USBMSC) || \\\n"); - printf(" defined(CONFIG_FS_NXFFS) || defined(CONFIG_APPS_BINDIR) || defined(CONFIG_NFS)\n"); + printf(" defined(CONFIG_FS_NXFFS) || defined(CONFIG_FS_BINFS) || defined(CONFIG_NFS)\n"); printf("# define CONFIG_FS_READABLE 1\n"); printf("#endif\n\n"); printf("#if defined(CONFIG_FS_FAT) || defined(CONFIG_USBMSC) || defined(CONFIG_FS_NXFFS) || \\\n"); -- cgit v1.2.3