summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-12-23 22:17:09 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-12-23 22:17:09 +0000
commit0cafa6176d2a38082056e3aa2193590a7eea808b (patch)
treeadbf30bfdbb86648a4b292c16abd5c71a8548ba1
parent11e331a9ca6df348e97e57948fed9d23b9bba2ef (diff)
Remove .context kludge from apps/ directory
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5455 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--apps/ChangeLog.txt4
-rw-r--r--apps/Make.defs9
-rw-r--r--apps/Makefile9
-rw-r--r--apps/builtin/Makefile33
-rw-r--r--apps/builtin/registry/Makefile54
-rw-r--r--apps/examples/adc/Makefile9
-rw-r--r--apps/examples/buttons/Makefile9
-rw-r--r--apps/examples/can/Makefile9
-rw-r--r--apps/examples/cdcacm/Makefile11
-rw-r--r--apps/examples/composite/Makefile11
-rw-r--r--apps/examples/cxxtest/Makefile9
-rw-r--r--apps/examples/dhcpd/Makefile9
-rw-r--r--apps/examples/discover/Makefile9
-rw-r--r--apps/examples/ftpc/Makefile10
-rw-r--r--apps/examples/ftpd/Makefile11
-rw-r--r--apps/examples/hello/Makefile9
-rw-r--r--apps/examples/helloxx/Makefile9
-rw-r--r--apps/examples/json/Makefile9
-rw-r--r--apps/examples/keypadtest/Makefile9
-rw-r--r--apps/examples/lcdrw/Makefile9
-rw-r--r--apps/examples/modbus/Makefile9
-rw-r--r--apps/examples/nettest/Makefile9
-rw-r--r--apps/examples/nx/Makefile9
-rw-r--r--apps/examples/nxhello/Makefile9
-rw-r--r--apps/examples/nximage/Makefile9
-rw-r--r--apps/examples/nxlines/Makefile9
-rw-r--r--apps/examples/nxtext/Makefile9
-rw-r--r--apps/examples/ostest/Makefile9
-rw-r--r--apps/examples/pwm/Makefile9
-rw-r--r--apps/examples/qencoder/Makefile9
-rw-r--r--apps/examples/relays/Makefile9
-rw-r--r--apps/examples/telnetd/Makefile9
-rw-r--r--apps/examples/tiff/Makefile9
-rw-r--r--apps/examples/touchscreen/Makefile9
-rw-r--r--apps/examples/usbstorage/Makefile11
-rw-r--r--apps/examples/usbterm/Makefile9
-rw-r--r--apps/examples/watchdog/Makefile9
-rw-r--r--apps/examples/wgetjson/Makefile9
-rw-r--r--apps/examples/xmlrpc/Makefile9
-rw-r--r--apps/graphics/tiff/Makefile1
-rw-r--r--apps/interpreters/ficl/Makefile1
-rw-r--r--apps/modbus/Makefile1
-rw-r--r--apps/nshlib/Makefile1
-rw-r--r--apps/system/free/Makefile10
-rw-r--r--apps/system/i2c/Makefile12
-rw-r--r--apps/system/install/Makefile10
-rw-r--r--apps/system/poweroff/Makefile10
-rw-r--r--apps/system/ramtron/Makefile10
-rw-r--r--apps/system/readline/Makefile1
-rw-r--r--apps/system/sdcard/Makefile10
-rw-r--r--apps/system/sysinfo/Makefile10
-rw-r--r--nuttx/Documentation/NuttShell.html9
-rw-r--r--nuttx/configs/vsn/src/Makefile9
53 files changed, 318 insertions, 201 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt
index 886526b187..8999047ef1 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 12b351e7f2..217137a29c 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 299560195c..cf6b33cd7e 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 72ba0347f7..6633146e93 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 0000000000..9117f53d6e
--- /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 <gnutt@nuttx.org>
+#
+# 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 69862b383d..55bc259e4b 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 77c1cd67df..ac1f2f05aa 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 8924797e37..5df96e1e7d 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 e8d03807d8..d9e19e9064 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 016ccbe3eb..b1fe493082 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 f0764b6e94..cba9f0a4f0 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 a41db5cdd7..0522d4cc47 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 2ce52a18e9..b0285fbff3 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 29960fb94c..e09779abdf 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 0b43b85a9c..dc53bfdeab 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 560b0da358..c4e6f735a5 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 062da7d588..df1b360a50 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 c3e9203f93..1e42757b86 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 3de0556a2b..0c40a5c6c1 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 ed612e0bec..61d6bcce6e 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 d6caefe81d..da31c3b524 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 085b9406d8..e6f56e7659 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 ad2bee84ea..4474a58c3f 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 b1ac6f116f..52ced123d5 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 e2e9201e74..98f04c2d53 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 cdda7ad8cd..9673a5520d 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 dffe66ba1f..738209754f 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 3e78c64e83..dfb500387a 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 3a6f2520a0..d33d1c2775 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 7d2427c6bf..1caff2ed30 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 8e91ab5723..17bf7a6a4b 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 8f5e5b6d2f..63876baa03 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 f62209931a..853e904a73 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 b3943951ef..8761cc5b50 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 5492e47dc4..a1eb77836e 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 c5fb95331e..3b3ca6cd7f 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 9890959fb5..cf947b0119 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 fa8f302c68..38bd8ac04f 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 7053f54d38..4756bfabbb 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 e42091ad94..b5f6c5b73b 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 990630fb89..3b2dc7ab9b 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 d2b1481628..27548f3d61 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 73325e899d..7ddbb67bf3 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 dada00d992..4f6424f50d 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 029d2b6fe4..7f42801a9f 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 6a02d859ff..aa65e60edd 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 bbceccb9e9..0067a13abe 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 9f5af1659b..1c92398f32 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 3a48d324e7..040fd2e28f 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 6d5d129608..6c580ba868 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 fa6aebf711..d233aa3d80 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 cc3f078ddf..7ad96da79b 100644
--- a/nuttx/Documentation/NuttShell.html
+++ b/nuttx/Documentation/NuttShell.html
@@ -3349,11 +3349,7 @@ int hello_main(int argc, char *argv[])
</p>
<li>
<p>
- And finally, the <code>apps/examples/Makefile</code>will execute the <i>context</i> target in all configured <code>example</code>sub-directores, getting us finally to <code>apps/examples/Makefile</code> (which is covered below).</p>
- <li>
- <p>
- At the conclusion of the <i>context</i> phase, the <code> apps/Makefile</code> will touch a file called <code>.context</code> in the <code>apps/</code> directory, preventing any further configurations during any subsequent <i>context</i> phase build attempts.
- </p>
+ And finally, the <code>apps/examples/Makefile</code> will execute the <i>context</i> target in all configured <code>example</code>sub-directores, getting us finally to <code>apps/examples/Makefile</code> which is covered below.</p>
</ol>
<p>
@@ -3417,9 +3413,8 @@ STACKSIZE = 2048
When the <code>hello</code> command is executed, it will start the task with entry point <code>hello_main()</code> with the default priority and with a stack size of 2K.
</p>
<ul><pre>
-.context:
+context:
$(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main)
- @touch $@
</pre></ul>
</ol>
diff --git a/nuttx/configs/vsn/src/Makefile b/nuttx/configs/vsn/src/Makefile
index a71c80c8ab..b0eba0a20b 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