Application.mk and main.c files: Change builtin's entry point from main to xxx_main by macro expansion. This change make the entry point fully compliant with POSIX/ANSI standard.

This commit is contained in:
Xiang Xiao 2019-10-06 06:14:39 -06:00 committed by Gregory Nutt
parent ab7c5a7d4e
commit e806097c70
550 changed files with 664 additions and 2928 deletions

View File

@ -42,20 +42,13 @@ include $(APPDIR)/Make.defs
# has the value "m" # has the value "m"
ifneq ($(MAINSRC),) ifneq ($(MAINSRC),)
ifeq ($($(MODULE)),m) ifeq ($(MODULE),m)
BUILD_MODULE = y BUILD_MODULE = y
endif endif
endif
ifeq ($(CONFIG_BUILD_KERNEL),y) ifeq ($(CONFIG_BUILD_KERNEL),y)
BUILD_MODULE = y BUILD_MODULE = y
endif endif
# Pass the definition to the C/C++ code via the CFLAGS/CXXFLAGS
ifeq ($(BUILD_MODULE),y)
CFLAGS += ${shell $(DEFINE) "$(CC)" BUILD_MODULE}
CXXFLAGS += ${shell $(DEFINE) "$(CC)" BUILD_MODULE}
endif endif
# File extensions # File extensions
@ -84,12 +77,13 @@ endif
# Module install directory # Module install directory
BIN ?= $(APPDIR)$(DELIM)libapps$(LIBEXT) BIN ?= $(APPDIR)$(DELIM)libapps$(LIBEXT)
INSTALL_DIR = $(BIN)
ifeq ($(WINTOOL),y) ifeq ($(WINTOOL),y)
TOOLBIN ?= "${shell cygpath -w $(BIN)}" TOOLBIN = "${shell cygpath -w $(BIN)}"
INSTALLDIR = "${shell cygpath -w $(BINDIR)}"
else else
TOOLBIN ?= $(BIN) TOOLBIN = $(BIN)
INSTALLDIR = $(BINDIR)
endif endif
ROOTDEPPATH += --dep-path . ROOTDEPPATH += --dep-path .
@ -102,27 +96,6 @@ all:: .built
.PHONY: clean preconfig depend distclean .PHONY: clean preconfig depend distclean
.PRECIOUS: $(BIN) .PRECIOUS: $(BIN)
ifneq ($(CONFIG_BUILD_LOADABLE),y)
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
$(CXXOBJS): %$(OBJEXT): %$(CXXEXT)
$(call COMPILEXX, $<, $@)
ifeq ($(suffix $(MAINSRC)),$(CXXEXT))
$(MAINOBJ): %$(OBJEXT): %$(CXXEXT)
$(call COMPILEXX, $<, $@)
else
$(MAINOBJ): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
endif
else
define ELFASSEMBLE define ELFASSEMBLE
@echo "AS: $1" @echo "AS: $1"
$(Q) $(CC) -c $(AELFFLAGS) $($(strip $1)_AELFFLAGS) $1 -o $2 $(Q) $(CC) -c $(AELFFLAGS) $($(strip $1)_AELFFLAGS) $1 -o $2
@ -138,69 +111,70 @@ define ELFCOMPILEXX
$(Q) $(CXX) -c $(CXXELFFLAGS) $($(strip $1)_CXXELFFLAGS) $1 -o $2 $(Q) $(CXX) -c $(CXXELFFLAGS) $($(strip $1)_CXXELFFLAGS) $1 -o $2
endef endef
define ELFLD
@echo "LD: $2"
$(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) $(ARCHCRT0OBJ) $1 $(LDLIBS) -o $2
# $(Q) $(STRIP) $2
$(Q) chmod +x $2
endef
$(AOBJS): %$(OBJEXT): %.S $(AOBJS): %$(OBJEXT): %.S
$(if $(AELFFLAGS), \ $(if $(and $(CONFIG_BUILD_LOADABLE),$(AELFFLAGS)), \
$(call ELFASSEMBLE, $<, $@), \ $(call ELFASSEMBLE, $<, $@), $(call ASSEMBLE, $<, $@))
$(call ASSEMBLE, $<, $@) \
)
$(COBJS): %$(OBJEXT): %.c $(COBJS): %$(OBJEXT): %.c
$(if $(CELFFLAGS), \ $(if $(and $(CONFIG_BUILD_LOADABLE),$(CELFFLAGS)), \
$(call ELFCOMPILE, $<, $@), \ $(call ELFCOMPILE, $<, $@), $(call COMPILE, $<, $@))
$(call COMPILE, $<, $@) \
)
$(CXXOBJS): %$(OBJEXT): %$(CXXEXT) $(CXXOBJS): %$(OBJEXT): %$(CXXEXT)
$(if $(CXXELFFLAGS), \ $(if $(and $(CONFIG_BUILD_LOADABLE),$(CXXELFFLAGS)), \
$(call ELFCOMPILEXX, $<, $@), \ $(call ELFCOMPILEXX, $<, $@), $(call COMPILEXX, $<, $@))
$(call COMPILEXX, $<, $@) \
)
ifeq ($(suffix $(MAINSRC)),$(CXXEXT))
$(MAINOBJ): %$(OBJEXT): %$(CXXEXT)
$(if $(CXXELFFLAGS), \
$(call ELFCOMPILEXX, $<, $@), \
$(call COMPILEXX, $<, $@) \
)
else
$(MAINOBJ): %$(OBJEXT): %.c
$(if $(CELFFLAGS), \
$(call ELFCOMPILE, $<, $@), \
$(call COMPILE, $<, $@) \
)
endif
endif
.built: $(OBJS) .built: $(OBJS)
$(call ARCHIVE, $(TOOLBIN), $(OBJS)) $(call ARCHIVE, $(TOOLBIN), $(OBJS))
$(Q) touch $@ $(Q) touch $@
ifeq ($(BUILD_MODULE), y) ifeq ($(BUILD_MODULE),y)
ifeq ($(WINTOOL), y) ifeq ($(suffix $(MAINSRC)),$(CXXEXT))
PROGPRFX = ${cygpath -u $(INSTALL_DIR)$(DELIM)} $(MAINOBJ): %$(OBJEXT): %$(CXXEXT)
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CXXELFFLAGS)), \
$(call ELFCOMPILEXX, $<, $@), $(call COMPILEXX, $<, $@))
else else
PROGPRFX = $(INSTALL_DIR)$(DELIM) $(MAINOBJ): %$(OBJEXT): %.c
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CELFFLAGS)), \
$(call ELFCOMPILE, $<, $@), $(call COMPILE, $<, $@))
endif endif
PROGLIST := $(addprefix $(PROGPRFX),$(PROGNAME)) PROGLIST := $(wordlist 1,$(words $(MAINOBJ)),$(PROGNAME))
PROGLIST := $(addprefix $(INSTALLDIR)$(DELIM),$(PROGLIST))
PROGOBJ := $(MAINOBJ) PROGOBJ := $(MAINOBJ)
$(PROGLIST): $(MAINOBJ) $(OBJS) $(PROGLIST): $(MAINOBJ)
ifneq ($(PROGOBJ),) $(call ELFLD,$(firstword $(PROGOBJ)),$(firstword $(PROGLIST)))
$(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) $(ARCHCRT0OBJ) $(firstword $(PROGOBJ)) $(LDLIBS) -o $(strip $(firstword $(PROGLIST)))_
$(Q) $(NM) -u $(strip $(firstword $(PROGLIST)))_
$(Q) install -m 0755 -D $(strip $(firstword $(PROGLIST)))_ $(firstword $(PROGLIST))
$(call DELFILE, $(strip $(firstword $(PROGLIST)))_)
# $(Q) $(STRIP) $(firstword $(PROGLIST))
$(eval PROGLIST=$(filter-out $(firstword $(PROGLIST)),$(PROGLIST))) $(eval PROGLIST=$(filter-out $(firstword $(PROGLIST)),$(PROGLIST)))
$(eval PROGOBJ=$(filter-out $(firstword $(PROGOBJ)),$(PROGOBJ))) $(eval PROGOBJ=$(filter-out $(firstword $(PROGOBJ)),$(PROGOBJ)))
endif
install:: $(PROGLIST) install:: $(PROGLIST)
else else
MAINNAME := $(addsuffix _main,$(PROGNAME))
ifeq ($(suffix $(MAINSRC)),$(CXXEXT))
$(MAINOBJ): %$(OBJEXT): %$(CXXEXT)
$(eval CXXFLAGS += ${shell $(DEFINE) "$(CXX)" main=$(firstword $(MAINNAME))})
$(eval MAINNAME=$(filter-out $(firstword $(MAINNAME)),$(MAINNAME)))
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CXXELFFLAGS)), \
$(call ELFCOMPILEXX, $<, $@), $(call COMPILEXX, $<, $@))
else
$(MAINOBJ): %$(OBJEXT): %.c
$(eval CFLAGS += ${shell $(DEFINE) "$(CC)" main=$(firstword $(MAINNAME))})
$(eval MAINNAME=$(filter-out $(firstword $(MAINNAME)),$(MAINNAME)))
$(if $(and $(CONFIG_BUILD_LOADABLE),$(CELFFLAGS)), \
$(call ELFCOMPILE, $<, $@), $(call COMPILE, $<, $@))
endif
install:: install::
endif # BUILD_MODULE endif # BUILD_MODULE
@ -208,13 +182,13 @@ endif # BUILD_MODULE
preconfig:: preconfig::
ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) ifeq ($(CONFIG_NSH_BUILTIN_APPS),y)
ifneq ($(BUILD_MODULE),y) ifneq ($(PROGNAME),)
REGLIST := $(addprefix $(BUILTIN_REGISTRY)$(DELIM),$(APPNAME)_main.bdat)
APPLIST := $(APPNAME)
ifneq ($(APPNAME),)
ifneq ($(PRIORITY),) ifneq ($(PRIORITY),)
ifneq ($(STACKSIZE),) ifneq ($(STACKSIZE),)
REGLIST := $(addprefix $(BUILTIN_REGISTRY)$(DELIM),$(addsuffix _main.bdat,$(PROGNAME)))
APPLIST := $(PROGNAME)
$(REGLIST): $(DEPCONFIG) Makefile $(REGLIST): $(DEPCONFIG) Makefile
$(call REGISTER,$(firstword $(APPLIST)),$(firstword $(PRIORITY)),$(firstword $(STACKSIZE)),$(if $(BUILD_MODULE),,$(firstword $(APPLIST))_main)) $(call REGISTER,$(firstword $(APPLIST)),$(firstword $(PRIORITY)),$(firstword $(STACKSIZE)),$(if $(BUILD_MODULE),,$(firstword $(APPLIST))_main))
$(eval APPLIST=$(filter-out $(firstword $(APPLIST)),$(APPLIST))) $(eval APPLIST=$(filter-out $(firstword $(APPLIST)),$(APPLIST)))
@ -234,9 +208,6 @@ endif
else else
context:: context::
endif endif
else
context::
endif
.depend: Makefile $(SRCS) .depend: Makefile $(SRCS)
ifeq ($(filter %$(CXXEXT),$(SRCS)),) ifeq ($(filter %$(CXXEXT),$(SRCS)),)

View File

@ -117,7 +117,7 @@ An example application skeleton can be found under the examples/hello
sub-directory. This example shows how a builtin application can be added sub-directory. This example shows how a builtin application can be added
to the project. One must: to the project. One must:
1. Create sub-directory as: appname 1. Create sub-directory as: progname
2. In this directory there should be: 2. In this directory there should be:
@ -129,11 +129,11 @@ to the project. One must:
- The application source code. - The application source code.
3. The application source code should provide the entry point: 3. The application source code should provide the entry point:
appname_main() main()
4. Set the requirements in the file: Makefile, specially the lines: 4. Set the requirements in the file: Makefile, specially the lines:
APPNAME = appname PROGNAME = progname
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 768 STACKSIZE = 768
ASRCS = asm source file list as a.asm b.asm ... ASRCS = asm source file list as a.asm b.asm ...
@ -141,8 +141,8 @@ to the project. One must:
4b. The Make.defs file should include a line like: 4b. The Make.defs file should include a line like:
ifeq ($(CONFIG_APPNAME),y) ifeq ($(CONFIG_PROGNAME),y)
CONFIGURED_APPS += appname CONFIGURED_APPS += progname
endif endif
Building NuttX with Board-Specific Pieces Outside the Source Tree Building NuttX with Board-Specific Pieces Outside the Source Tree

View File

@ -41,6 +41,4 @@ CSRCS = canlib_getbaud.c canlib_setbaud.c
CSRCS += canlib_getloopback.c canlib_setloopback.c CSRCS += canlib_getloopback.c canlib_setloopback.c
CSRCS += canlib_getsilent.c canlib_setsilent.c CSRCS += canlib_getsilent.c canlib_setsilent.c
APPNAME = canlib
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -39,6 +39,4 @@ include $(TOPDIR)/Make.defs
CSRCS = obd2.c obd_sendrequest.c obd_waitresponse.c obd_decodepid.c CSRCS = obd2.c obd_sendrequest.c obd_waitresponse.c obd_decodepid.c
APPNAME = libobd2
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -79,8 +79,8 @@ examples/alarm
Configuration: Configuration:
CONFIG_EXAMPLES_ALARM - Enable the RTC driver alarm test CONFIG_EXAMPLES_ALARM - Enable the RTC driver alarm test
CONFIG_EXAMPLES_ALARM_PROGNAME - If CONFIG_BUILD_LOADABLE=y, then this is CONFIG_EXAMPLES_ALARM_PROGNAME - this isthe name of the
the name of the program that will be used when the NSH ELF program is program that will be used when the NSH ELF program is
installed. installed.
CONFIG_EXAMPLES_ALARM_PRIORITY - Alarm daemon priority CONFIG_EXAMPLES_ALARM_PRIORITY - Alarm daemon priority
CONFIG_EXAMPLES_ALARM_STACKSIZE - Alarm daemon stack size CONFIG_EXAMPLES_ALARM_STACKSIZE - Alarm daemon stack size
@ -396,8 +396,6 @@ examples/flash_test
Dependencies: Dependencies:
* CONFIG_MTD_SMART=y - SMART block driver support * CONFIG_MTD_SMART=y - SMART block driver support
* CONFIG_NSH_BUILTIN_APPS=y - This example can only be built as an NSH
command
* CONFIG_BUILD_PROTECTED=n and CONFIG_BUILD_KERNEL=n - This test uses * CONFIG_BUILD_PROTECTED=n and CONFIG_BUILD_KERNEL=n - This test uses
internal OS interfaces and so is not available in the NUTTX kernel internal OS interfaces and so is not available in the NUTTX kernel
builds builds
@ -418,9 +416,7 @@ examples/ftpc
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
This is a simple FTP client shell used to exercise the capabilities This is a simple FTP client shell used to exercise the capabilities
of the FTPC library (apps/netutils/ftpc). This example is configured of the FTPC library (apps/netutils/ftpc).
to that it will only work as a "built-in" program that can be run from
NSH when CONFIG_NSH_BUILTIN_APPS is defined.
From NSH, the startup command sequence is as follows. This is only From NSH, the startup command sequence is as follows. This is only
an example, your configration could have different mass storage devices, an example, your configration could have different mass storage devices,
@ -901,7 +897,6 @@ examples/netloop
Dependencies: Dependencies:
CONFIG_NSH_BUILTIN_APPS=n - Does NOT work as an NSH built-in command
CONFIG_NET_LOOPBACK - Requires local loopback supprt CONFIG_NET_LOOPBACK - Requires local loopback supprt
CONFIG_NET_TCP - Requires TCP support with the following: CONFIG_NET_TCP - Requires TCP support with the following:
CONFIG_NET_TCPBACKLOG CONFIG_NET_TCPBACKLOG
@ -1418,8 +1413,6 @@ examples/pwm
CONFIG_PWM_PULSECOUNT - Enables PWM pulse count support (if the hardware CONFIG_PWM_PULSECOUNT - Enables PWM pulse count support (if the hardware
supports it). supports it).
CONFIG_NSH_BUILTIN_APPS - Build the PWM test as an NSH built-in function. CONFIG_NSH_BUILTIN_APPS - Build the PWM test as an NSH built-in function.
Default: Not built! The example can only be used as an NSH built-in
application
Specific configuration options for this example include: Specific configuration options for this example include:
@ -1757,11 +1750,7 @@ examples/tiff
This is a simple unit test for the TIFF creation library at apps/graphic/tiff. This is a simple unit test for the TIFF creation library at apps/graphic/tiff.
It is configured to work in the Linux user-mode simulation and has not been It is configured to work in the Linux user-mode simulation and has not been
tested in any other environment. Since the example also depends on some tested in any other environment.
other logic to mount a file system, currently it will only work as an NSH
built-on, i.e., if the following is defined:
CONFIG_NSH_BUILTIN_APPS=y
At a miniumum, to run in an embedded environment, you will probably have to At a miniumum, to run in an embedded environment, you will probably have to
change the configured paths to the TIFF files defined in the example. change the configured paths to the TIFF files defined in the example.
@ -1793,8 +1782,6 @@ examples/timer
microseconds. Default: 1000000 microseconds. Default: 1000000
CONFIG_EXAMPLES_TIMER_DELAY - This is the delay between timer samples in CONFIG_EXAMPLES_TIMER_DELAY - This is the delay between timer samples in
microseconds. Default: 10000 microseconds. Default: 10000
CONFIG_EXAMPLES_TIMER_APPNAME - This is the name of the built-in
application: Default: "timer"
CONFIG_EXAMPLES_TIMER_STACKSIZE - This is the stack size allocated when CONFIG_EXAMPLES_TIMER_STACKSIZE - This is the stack size allocated when
the timer task runs. Default: 2048 the timer task runs. Default: 2048
CONFIG_EXAMPLES_TIMER_PRIORITY - This is the priority of the timer task: CONFIG_EXAMPLES_TIMER_PRIORITY - This is the priority of the timer task:
@ -2012,8 +1999,7 @@ examples/watchdog
CONFIG_WATCHDOG- Enables watchdog timer support support. CONFIG_WATCHDOG- Enables watchdog timer support support.
CONFIG_NSH_BUILTIN_APPS - Build the watchdog time test as an NSH CONFIG_NSH_BUILTIN_APPS - Build the watchdog time test as an NSH
built-in function. Default: Not built! The example can only be used built-in function.
as an NSH built-in application
Specific configuration options for this example include: Specific configuration options for this example include:

View File

@ -15,7 +15,6 @@ if EXAMPLES_ABNTCODI
config EXAMPLES_ABNTCODI_PROGNAME config EXAMPLES_ABNTCODI_PROGNAME
string "Program name" string "Program name"
default "abntcodi" default "abntcodi"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,21 +37,14 @@ include $(TOPDIR)/Make.defs
# ABNTCODI built-in application info # ABNTCODI built-in application info
CONFIG_EXAMPLES_ABNTCODI_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_ABNTCODI_PROGNAME)
CONFIG_EXAMPLES_ABNTCODI_STACKSIZE ?= 2048
APPNAME = abntcodi
PRIORITY = $(CONFIG_EXAMPLES_ABNTCODI_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_ABNTCODI_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_ABNTCODI_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_ABNTCODI_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_ABNTCODI)
# ABNTCODI Example # ABNTCODI Example
MAINSRC = abntcodi_main.c MAINSRC = abntcodi_main.c
CONFIG_EXAMPLES_ABNTCODI_PROGNAME ?= abntcodi$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_ABNTCODI_PROGNAME)
MODULE = CONFIG_EXAMPLES_ABNTCODI
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -82,11 +82,7 @@ void print_abnt_codi(FAR struct abnt_codi_proto_s *proto)
* abntcodi_main * abntcodi_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int abntcodi_main(int argc, char *argv[])
#endif
{ {
FAR struct abnt_codi_proto_s *proto; FAR struct abnt_codi_proto_s *proto;
int fd; int fd;

View File

@ -39,15 +39,11 @@ include $(TOPDIR)/Make.defs
MAINSRC = adc_main.c MAINSRC = adc_main.c
CONFIG_XYZ_PROGNAME ?= adc$(EXEEXT)
PROGNAME = $(CONFIG_XYZ_PROGNAME)
# application info # application info
APPNAME = adc PROGNAME = adc
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_ADC)
MODULE = CONFIG_EXAMPLES_ADC
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -228,11 +228,7 @@ static void parse_args(FAR struct adc_state_s *adc, int argc, FAR char **argv)
* Name: adc_main * Name: adc_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int adc_main(int argc, char *argv[])
#endif
{ {
struct adc_msg_s sample[CONFIG_EXAMPLES_ADC_GROUPSIZE]; struct adc_msg_s sample[CONFIG_EXAMPLES_ADC_GROUPSIZE];
size_t readsize; size_t readsize;

View File

@ -13,18 +13,17 @@ if EXAMPLES_ADXL372_TEST
config EXAMPLES_ADXL372_TEST_PROGNAME config EXAMPLES_ADXL372_TEST_PROGNAME
string "Program name" string "Program name"
default "ADXL372_test" default "adxl372_test"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.
config EXAMPLES_ADXL372_TEST_PRIORITY config EXAMPLES_ADXL372_TEST_PRIORITY
int "ADXL372_test task priority" int "adxl372_test task priority"
default 100 default 100
config EXAMPLES_ADXL372_TEST_STACKSIZE config EXAMPLES_ADXL372_TEST_STACKSIZE
int "ADXL372_test stack size" int "adxl372_test stack size"
default 2048 default 2048
endif endif

View File

@ -35,20 +35,13 @@
include $(TOPDIR)/Make.defs include $(TOPDIR)/Make.defs
CONFIG_EXAMPLES_ADXL372_TEST_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_ADXL372_TEST_PROGNAME)
CONFIG_EXAMPLES_ADXL372_TEST_STACKSIZE ?= 2048
APPNAME = adxl372_test
PRIORITY = $(CONFIG_EXAMPLES_ADXL372_TEST_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_ADXL372_TEST_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_ADXL372_TEST_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_ADXL372_TEST_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_ADXL372_TEST)
# ADXL372 sensor test Example # ADXL372 sensor test Example
MAINSRC = adxl372_test_main.c MAINSRC = adxl372_test_main.c
CONFIG_EXAMPLES_ADXL372_TEST_PROGNAME ?= adxl372_test$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_ADXL372_TEST_PROGNAME)
MODULE = CONFIG_EXAMPLES_ADXL372_TEST
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -387,11 +387,7 @@ quick_exit:
* *
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int adxl372_test_main(int argc, FAR char *argv[])
#endif
{ {
int rc = 0; int rc = 0;
int step_rc = 0; int step_rc = 0;

View File

@ -39,16 +39,12 @@ include $(TOPDIR)/Make.defs
MAINSRC = ajoy_main.c MAINSRC = ajoy_main.c
CONFIG_AJOY_PROGNAME ?= ajoy$(EXEEXT)
PROGNAME = $(CONFIG_AJOY_PROGNAME)
# Buttons built-in application info # Buttons built-in application info
APPNAME = ajoy PROGNAME = ajoy
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_AJOYSTICK)
MODULE = CONFIG_EXAMPLES_AJOYSTICK
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -376,11 +376,7 @@ static int ajoy_calibrate(int fd)
* ajoy_main * ajoy_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE int main(int argc, char *argv[])
int main(int argc, FAR char *argv[])
#else
int ajoy_main(int argc, char *argv[])
#endif
{ {
struct timespec timeout; struct timespec timeout;
struct ajoy_notify_s notify; struct ajoy_notify_s notify;

View File

@ -15,7 +15,6 @@ if EXAMPLES_ALARM
config EXAMPLES_ALARM_PROGNAME config EXAMPLES_ALARM_PROGNAME
string "Program name" string "Program name"
default "alarm" default "alarm"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,20 +37,13 @@ include $(TOPDIR)/Make.defs
# RTC driver alarm test built-in application info # RTC driver alarm test built-in application info
CONFIG_EXAMPLES_ALARM_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_ALARM_PROGNAME)
CONFIG_EXAMPLES_ALARM_STACKSIZE ?= 2048
APPNAME = alarm
PRIORITY = $(CONFIG_EXAMPLES_ALARM_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_ALARM_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_ALARM_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_ALARM_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_ALARM)
# RTC driver alarm test # RTC driver alarm test
MAINSRC = alarm_main.c MAINSRC = alarm_main.c
CONFIG_EXAMPLES_ALARM_PROGNAME ?= alarm$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_ALARM_PROGNAME)
MODULE = CONFIG_EXAMPLES_ALARM
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -208,11 +208,7 @@ static void show_usage(FAR const char *progname)
* alarm_main * alarm_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int alarm_main(int argc, FAR char *argv[])
#endif
{ {
unsigned long seconds = 0; unsigned long seconds = 0;
bool badarg = false; bool badarg = false;

View File

@ -14,7 +14,6 @@ if EXAMPLES_APA102
config EXAMPLES_APA102_PROGNAME config EXAMPLES_APA102_PROGNAME
string "Program name" string "Program name"
default "apa102" default "apa102"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,17 +37,13 @@ include $(TOPDIR)/Make.defs
# APA102 built-in application info # APA102 built-in application info
APPNAME = apa102 PROGNAME = $(CONFIG_EXAMPLES_APA102_PROGNAME)
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_APA102)
# APA102 Test # APA102 Test
MAINSRC = apa102_main.c MAINSRC = apa102_main.c
CONFIG_EXAMPLES_APA102_PROGNAME ?= apa102$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_APA102_PROGNAME)
MODULE = CONFIG_EXAMPLES_APA102
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -150,11 +150,7 @@ static struct apa102_ledstrip_s hsvtorgb(uint16_t h, uint8_t s, uint8_t v)
* apa102_main * apa102_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int apa102_main(int argc, char *argv[])
#endif
{ {
int fd; int fd;
int ret; int ret;

View File

@ -15,7 +15,6 @@ if EXAMPLES_APDS9960
config EXAMPLES_APDS9960_PROGNAME config EXAMPLES_APDS9960_PROGNAME
string "APDS-9960 Test Program name" string "APDS-9960 Test Program name"
default "apds9960" default "apds9960"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,20 +37,13 @@ include $(TOPDIR)/Make.defs
# Hello, World! built-in application info # Hello, World! built-in application info
CONFIG_EXAMPLES_APDS9960_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_APDS9960_PROGNAME)
CONFIG_EXAMPLES_APDS9960_STACKSIZE ?= 2048
APPNAME = apds9960
PRIORITY = $(CONFIG_EXAMPLES_APDS9960_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_APDS9960_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_APDS9960_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_APDS9960_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_APDS9960)
# Hello, World! Example # Hello, World! Example
MAINSRC = apds9960_main.c MAINSRC = apds9960_main.c
CONFIG_EXAMPLES_APDS9960_PROGNAME ?= apds9960$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_APDS9960_PROGNAME)
MODULE = CONFIG_EXAMPLES_APDS9960
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -62,11 +62,7 @@
* apds9960_main * apds9960_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int apds9960_main(int argc, char *argv[])
#endif
{ {
int fd; int fd;
int nbytes; int nbytes;

View File

@ -37,9 +37,10 @@ include $(TOPDIR)/Make.defs
# BAS test volume mounter # BAS test volume mounter
APPNAME = bastest PROGNAME = bastest
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_BASTEST)
# Hello, World! Example # Hello, World! Example
@ -50,8 +51,6 @@ TESTS_DIR = $(BASTEST_DIR)$(DELIM)tests
ROMFS_IMG = romfs.img ROMFS_IMG = romfs.img
ROMFS_HDR = romfs.h ROMFS_HDR = romfs.h
PROGNAME = bastest$(EXEEXT)
# Common build # Common build
# Create the romfs.h header file from the tests/ directory # Create the romfs.h header file from the tests/ directory
@ -70,6 +69,4 @@ distclean::
$(call DELFILE, $(ROMFS_HDR)) $(call DELFILE, $(ROMFS_HDR))
$(call DELFILE, $(ROMFS_IMG)) $(call DELFILE, $(ROMFS_IMG))
MODULE = CONFIG_EXAMPLES_BASTEST
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -89,11 +89,7 @@
* bastest_main * bastest_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int bastest_main(int argc, char *argv[])
#endif
{ {
int ret; int ret;

View File

@ -14,7 +14,6 @@ if EXAMPLES_BATTERY
config EXAMPLES_BATTERY_PROGNAME config EXAMPLES_BATTERY_PROGNAME
string "Program name" string "Program name"
default "batt" default "batt"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,21 +37,13 @@ include $(TOPDIR)/Make.defs
# Battery built-in application info # Battery built-in application info
CONFIG_EXAMPLES_BATTERY_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_BATTERY_PROGNAME)
CONFIG_EXAMPLES_BATTERY_STACKSIZE ?= 2048
APPNAME = batt
PRIORITY = $(CONFIG_EXAMPLES_BATTERY_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_BATTERY_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_BATTERY_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_BATTERY_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_BATTERY)
# Hello, World! Example # Hello, World! Example
MAINSRC = batt_main.c MAINSRC = batt_main.c
CONFIG_EXAMPLES_BATTERY_PROGNAME ?= batt$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_BATTERY_PROGNAME)
MODULE = CONFIG_EXAMPLES_BATTERY
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -190,11 +190,7 @@ void health_report(int health)
* batt_main * batt_main
****************************************************************************/ ****************************************************************************/
#if defined(BUILD_MODULE)
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int batt_main(int argc, char *argv[])
#endif
{ {
int i; int i;
int fd; int fd;

View File

@ -15,7 +15,6 @@ if EXAMPLES_BMP180
config EXAMPLES_BMP180_PROGNAME config EXAMPLES_BMP180_PROGNAME
string "Program name" string "Program name"
default "bmp180" default "bmp180"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -39,20 +39,13 @@ include $(TOPDIR)/Make.defs
# BMP180 Barometer sensor example built-in application info # BMP180 Barometer sensor example built-in application info
CONFIG_EXAMPLES_BMP180_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_BMP180_PROGNAME)
CONFIG_EXAMPLES_BMP180_STACKSIZE ?= 2048
APPNAME = bmp180
PRIORITY = $(CONFIG_EXAMPLES_BMP180_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_BMP180_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_BMP180_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_BMP180_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_BMP180)
# BMP180 Barometer sensor example # BMP180 Barometer sensor example
MAINSRC = bmp180_main.c MAINSRC = bmp180_main.c
CONFIG_EXAMPLES_BMP180_PROGNAME ?= bmp180$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_BMP180_PROGNAME)
MODULE = CONFIG_EXAMPLES_BMP180
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -50,11 +50,7 @@
* bmp180_main * bmp180_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int bmp180_main(int argc, char *argv[])
#endif
{ {
int fd; int fd;
int ret; int ret;

View File

@ -38,9 +38,10 @@ include $(TOPDIR)/Make.defs
# Discover built-in application info # Discover built-in application info
APPNAME = bridge PROGNAME = bridge
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_BRIDGE)
MAINSRC = bridge_main.c MAINSRC = bridge_main.c
@ -54,9 +55,6 @@ HOST_OBJS = $(HOST_OBJS1) $(HOST_OBJS2)
HOST_BIN1 = host1 HOST_BIN1 = host1
HOST_BIN2 = host2 HOST_BIN2 = host2
CONFIG_EXAMPLES_BRIDGE_PROGNAME ?= bridge$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_BRIDGE_PROGNAME)
# Common build # Common build
$(HOST_OBJS): %.o: %.c $(HOST_OBJS): %.o: %.c
@ -84,6 +82,4 @@ clean::
distclean:: distclean::
$(call DELFILE, bridge_config.h) $(call DELFILE, bridge_config.h)
MODULE = CONFIG_EXAMPLES_BRIDGE
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -681,11 +681,7 @@ errout_with_recvsd:
* bridge_main * bridge_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int bridge_main(int argc, char *argv[])
#endif
{ {
pid_t net1_worker; pid_t net1_worker;
pid_t net2_worker; pid_t net2_worker;

View File

@ -15,7 +15,6 @@ if EXAMPLES_BUTTONS
config EXAMPLES_BUTTONS_PROGNAME config EXAMPLES_BUTTONS_PROGNAME
string "Program name" string "Program name"
default "buttons" default "buttons"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,20 +37,13 @@ include $(TOPDIR)/Make.defs
# LED driver test built-in application info # LED driver test built-in application info
CONFIG_EXAMPLES_BUTTONS_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_BUTTONS_PROGNAME)
CONFIG_EXAMPLES_BUTTONS_STACKSIZE ?= 2048
APPNAME = buttons
PRIORITY = $(CONFIG_EXAMPLES_BUTTONS_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_BUTTONS_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_BUTTONS_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_BUTTONS_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_BUTTONS)
# LED driver test # LED driver test
MAINSRC = buttons_main.c MAINSRC = buttons_main.c
CONFIG_EXAMPLES_BUTTONS_PROGNAME ?= buttons$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_BUTTONS_PROGNAME)
MODULE = CONFIG_EXAMPLES_BUTTONS
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -383,11 +383,7 @@ errout:
* buttons_main * buttons_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int buttons_main(int argc, FAR char *argv[])
#endif
{ {
int ret; int ret;

View File

@ -37,20 +37,13 @@ include $(TOPDIR)/Make.defs
# built-in application info # built-in application info
CONFIG_EXAMPLES_CALIB_UDELAY_APPNAME ?= "calib_udelay" PROGNAME = calib_udelay
CONFIG_EXAMPLES_CALIB_UDELAY_STACKSIZE ?= 2048 PRIORITY = 100
CONFIG_EXAMPLES_CALIB_UDELAY_PRIORITY ?= 100 STACKSIZE = 2048
CONFIG_EXAMPLES_CALIB_UDELAY_PROGNAME ?= "calib_udelay" MODULE = $(CONFIG_EXAMPLES_CALIB_UDELAY)
APPNAME = $(CONFIG_EXAMPLES_CALIB_UDELAY_APPNAME)
PRIORITY = $(CONFIG_EXAMPLES_CALIB_UDELAY_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_CALIB_UDELAY_STACKSIZE)
PROGNAME = $(CONFIG_EXAMPLES_CALIB_UDELAY_PROGNAME)
# Udelay calibration tool # Udelay calibration tool
MAINSRC = calib_udelay_main.c MAINSRC = calib_udelay_main.c
MODULE = CONFIG_EXAMPLES_CALIB_UDELAY
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -219,11 +219,7 @@ static int linreg(FAR struct measurement_s *point, int num_points,
* calib_udelay_main * calib_udelay_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int calib_udelay_main(int argc, char *argv[])
#endif
{ {
const int num_measurements = CONFIG_EXAMPLES_CALIB_UDELAY_NUM_MEASUREMENTS; const int num_measurements = CONFIG_EXAMPLES_CALIB_UDELAY_NUM_MEASUREMENTS;
const int num_results = CONFIG_EXAMPLES_CALIB_UDELAY_NUM_RESULTS; const int num_results = CONFIG_EXAMPLES_CALIB_UDELAY_NUM_RESULTS;

View File

@ -39,15 +39,11 @@ include $(TOPDIR)/Make.defs
MAINSRC = can_main.c MAINSRC = can_main.c
CONFIG_XYZ_PROGNAME ?= can$(EXEEXT)
PROGNAME = $(CONFIG_XYZ_PROGNAME)
# Touchscreen built-in application info # Touchscreen built-in application info
APPNAME = can PROGNAME = can
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_CAN)
MODULE = CONFIG_EXAMPLES_CAN
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -156,11 +156,7 @@ static void show_usage(FAR const char *progname)
* Name: can_main * Name: can_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int can_main(int argc, FAR char *argv[])
#endif
{ {
struct canioc_bittiming_s bt; struct canioc_bittiming_s bt;

View File

@ -35,18 +35,12 @@
include $(TOPDIR)/Make.defs include $(TOPDIR)/Make.defs
CONFIG_EXAMPLES_LIBCANARD_STACKSIZE ?= 2048 PROGNAME = canard
CONFIG_XYZ_PROGNAME ?= canard$(EXEEXT)
PROGNAME = $(CONFIG_XYZ_PROGNAME)
APPNAME = canard
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = $(CONFIG_EXAMPLES_LIBCANARD_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_LIBCANARD_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_LIBCANARD)
CFLAGS += -I$(APPDIR)/include/canutils CFLAGS += -I$(APPDIR)/include/canutils
MAINSRC = canard_main.c MAINSRC = canard_main.c
MODULE = CONFIG_EXAMPLES_LIBCANARD
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -508,11 +508,7 @@ errout_with_dev:
* *
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int canard_main(int argc, FAR char *argv[])
#endif
{ {
int ret; int ret;

View File

@ -39,15 +39,11 @@ include $(TOPDIR)/Make.defs
MAINSRC = cctype_main.cxx MAINSRC = cctype_main.cxx
CONFIG_EXAMPLES_CCTYPE_PROGNAME ?= cctype$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_CCTYPE_PROGNAME)
# cctype built-in application info # cctype built-in application info
APPNAME = cctype PROGNAME = cctype
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_CCTYP)
MODULE = CONFIG_EXAMPLES_CCTYPE
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -52,7 +52,7 @@
extern "C" extern "C"
{ {
int cctype_main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
std::printf("\n A B C D E F G H I J K L M N O\n"); std::printf("\n A B C D E F G H I J K L M N O\n");
for (int i = 0; i < 256; i++) for (int i = 0; i < 256; i++)

View File

@ -37,13 +37,9 @@ include $(TOPDIR)/Make.defs
MAINSRC = chat_main.c MAINSRC = chat_main.c
CONFIG_XYZ_PROGNAME ?= chat$(EXEEXT) PROGNAME = chat
PROGNAME = $(CONFIG_XYZ_PROGNAME)
APPNAME = chat
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_CHAT)
MODULE = CONFIG_EXAMPLES_CHAT
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -320,11 +320,7 @@ static int chat_parse_args(FAR struct chat_app* priv)
* *
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char** argv) int main(int argc, FAR char** argv)
#else
int chat_main(int argc, FAR char** argv)
#endif
{ {
struct chat_app priv; struct chat_app priv;
int ret; int ret;

View File

@ -14,7 +14,6 @@ if EXAMPLES_CHRONO
config EXAMPLES_CHRONO_PROGNAME config EXAMPLES_CHRONO_PROGNAME
string "Program name" string "Program name"
default "chrono" default "chrono"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,21 +37,13 @@ include $(TOPDIR)/Make.defs
# Chronometer built-in application info # Chronometer built-in application info
CONFIG_EXAMPLES_CHRONO_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_CHRONO_PROGNAME)
CONFIG_EXAMPLES_CHRONO_STACKSIZE ?= 2048
APPNAME = chrono
PRIORITY = $(CONFIG_EXAMPLES_CHRONO_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_CHRONO_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_CHRONO_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_CHRONO_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_CHRONO)
# Chronometer Example # Chronometer Example
MAINSRC = chrono_main.c MAINSRC = chrono_main.c
CONFIG_EXAMPLES_CHRONO_PROGNAME ?= chrono$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_CHRONO_PROGNAME)
MODULE = CONFIG_EXAMPLES_CHRONO
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -305,11 +305,7 @@ static void slcd_puts(FAR struct lib_outstream_s *outstream,
* chrono_main * chrono_main
****************************************************************************/ ****************************************************************************/
#if defined(BUILD_MODULE)
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int chrono_main(int argc, char *argv[])
#endif
{ {
FAR struct slcd_chrono_s *priv = &g_slcd; FAR struct slcd_chrono_s *priv = &g_slcd;
FAR char str[8] = "00:00.0"; FAR char str[8] = "00:00.0";

View File

@ -37,15 +37,11 @@ include $(TOPDIR)/Make.defs
# CONFIGDATA Unit Test # CONFIGDATA Unit Test
APPNAME = configdata PROGNAME = configdata
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_CONFIGDATA)
MAINSRC = configdata_main.c MAINSRC = configdata_main.c
CONFIG_XYZ_PROGNAME ?= configdata$(EXEEXT)
PROGNAME = $(CONFIG_XYZ_PROGNAME)
MODULE = CONFIG_EXAMPLES_CONFIGDATA
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -622,11 +622,7 @@ static void configdata_cleardeleted(void)
* Name: configdata_main * Name: configdata_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int configdata_main(int argc, char *argv[])
#endif
{ {
unsigned int i; unsigned int i;
int ret; int ret;

View File

@ -39,18 +39,11 @@ include $(TOPDIR)/Make.defs
MAINSRC = cpuhog_main.c MAINSRC = cpuhog_main.c
CONFIG_XYZ_PROGNAME ?= cpuhog$(EXEEXT)
PROGNAME = $(CONFIG_XYZ_PROGNAME)
# Built-in application info # Built-in application info
CONFIG_EXAMPLES_CPUHOG_PRIORITY ?= 50 PROGNAME = cpuhog
CONFIG_EXAMPLES_CPUHOG_STACKSIZE ?= 2048
APPNAME = cpuhog
PRIORITY = $(CONFIG_EXAMPLES_CPUHOG_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_CPUHOG_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_CPUHOG_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_CPUHOG_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_CPUHOG)
MODULE = CONFIG_EXAMPLES_CPUHOG
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -96,11 +96,7 @@ static struct state_s
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int cpuhog_main(int argc, char *argv[])
#endif
{ {
int id = -1; int id = -1;
char buf[256]; char buf[256];

View File

@ -39,15 +39,11 @@ include $(TOPDIR)/Make.defs
MAINSRC = dac_main.c MAINSRC = dac_main.c
CONFIG_XYZ_PROGNAME ?= dac$(EXEEXT)
PROGNAME = $(CONFIG_XYZ_PROGNAME)
# application info # application info
APPNAME = dac PROGNAME = dac
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_DAC)
MODULE = CONFIG_EXAMPLES_DAC
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -409,7 +409,7 @@ static int parse_args(FAR struct dac_state_s *dac,
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
int dac_main(int argc, FAR const char *argv[]) int main(int argc, FAR const char *argv[])
{ {
int ret; int ret;
int nargs = 1; int nargs = 1;

View File

@ -39,15 +39,11 @@ include $(TOPDIR)/Make.defs
MAINSRC = target.c MAINSRC = target.c
CONFIG_XYZ_PROGNAME ?= dhcpd$(EXEEXT)
PROGNAME = $(CONFIG_XYZ_PROGNAME)
# DHCPD built-in application info # DHCPD built-in application info
APPNAME = dhcpd PROGNAME = dhcpd
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_DHCPD)
MODULE = CONFIG_EXAMPLES_DHCPD
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -89,11 +89,7 @@
* Name: dhcpd_main * Name: dhcpd_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int dhcpd_main(int argc, char *argv[])
#endif
{ {
struct in_addr addr; struct in_addr addr;
#if defined(CONFIG_EXAMPLES_DHCPD_NOMAC) #if defined(CONFIG_EXAMPLES_DHCPD_NOMAC)

View File

@ -4,7 +4,7 @@
# #
config EXAMPLES_DHTXX config EXAMPLES_DHTXX
bool "Dhtxx sensor example" tristate "Dhtxx sensor example"
default n default n
---help--- ---help---
Enable the dhtxx sensor example Enable the dhtxx sensor example
@ -14,7 +14,6 @@ if EXAMPLES_DHTXX
config EXAMPLES_DHTXX_PROGNAME config EXAMPLES_DHTXX_PROGNAME
string "Program name" string "Program name"
default "dhtxx" default "dhtxx"
depends on BUILD_KERNEL
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,21 +37,13 @@ include $(TOPDIR)/Make.defs
# Dhtxx, World! built-in application info # Dhtxx, World! built-in application info
CONFIG_EXAMPLES_DHTXX_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_DHTXX_PROGNAME)
CONFIG_EXAMPLES_DHTXX_STACKSIZE ?= 2048
APPNAME = dhtxx
PRIORITY = $(CONFIG_EXAMPLES_DHTXX_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_DHTXX_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_DHTXX_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_DHTXX_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_DHTXX)
# Dhtxx Example # Dhtxx Example
MAINSRC = dhtxx_main.c MAINSRC = dhtxx_main.c
CONFIG_EXAMPLES_DHTXX_PROGNAME ?= dhtxx$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_DHTXX_PROGNAME)
MODULE = CONFIG_EXAMPLES_DHTXX
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -52,11 +52,7 @@
* dhtxx_main * dhtxx_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int dhtxx_main(int argc, char *argv[])
#endif
{ {
struct dhtxx_sensor_data_s data; struct dhtxx_sensor_data_s data;
int fd; int fd;

View File

@ -40,15 +40,11 @@ include $(TOPDIR)/Make.defs
# Discover built-in application info # Discover built-in application info
APPNAME = discover PROGNAME = discover
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_DISCOVER)
MAINSRC = discover_main.c MAINSRC = discover_main.c
CONFIG_XYZ_PROGNAME ?= discover$(EXEEXT)
PROGNAME = $(CONFIG_XYZ_PROGNAME)
MODULE = CONFIG_EXAMPLES_DISCOVER
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -84,11 +84,7 @@
* discover_main * discover_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int discover_main(int argc, char *argv[])
#endif
{ {
/* If this task is excecutated as an NSH built-in function, then the /* If this task is excecutated as an NSH built-in function, then the
* network has already been configured by NSH's start-up logic. * network has already been configured by NSH's start-up logic.

View File

@ -39,15 +39,11 @@ include $(TOPDIR)/Make.defs
MAINSRC = djoy_main.c MAINSRC = djoy_main.c
CONFIG_DJOY_PROGNAME ?= djoy$(EXEEXT)
PROGNAME = $(CONFIG_DJOY_PROGNAME)
# Buttons built-in application info # Buttons built-in application info
APPNAME = djoy PROGNAME = djoy
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_DJOYSTICK)
MODULE = CONFIG_EXAMPLES_DJOYSTICK
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -140,11 +140,7 @@ static void show_joystick(djoy_buttonset_t oldset, djoy_buttonset_t newset)
* djoy_main * djoy_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int djoy_main(int argc, char *argv[])
#endif
{ {
struct djoy_notify_s notify; struct djoy_notify_s notify;
int fd; int fd;

View File

@ -14,7 +14,6 @@ if EXAMPLES_DSPTEST
config EXAMPLES_DSPTEST_PROGNAME config EXAMPLES_DSPTEST_PROGNAME
string "Program name" string "Program name"
default "dsptest" default "dsptest"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,12 +37,10 @@ include $(TOPDIR)/Make.defs
# dsptest built-in application info # dsptest built-in application info
CONFIG_EXAMPLES_DSPTEST_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_DSPTEST_PROGNAME)
CONFIG_EXAMPLES_DSPTEST_STACKSIZE ?= 2048
APPNAME = dsptest
PRIORITY = $(CONFIG_EXAMPLES_DSPTEST_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_DSPTEST_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_DSPTEST_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_DSPTEST_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_DSPTEST)
# dsptest example # dsptest example
@ -51,9 +49,4 @@ MAINSRC = dsptest_main.c
CSRCS += test_foc.c test_pid.c test_svm.c test_misc.c test_motor.c CSRCS += test_foc.c test_pid.c test_svm.c test_misc.c test_motor.c
CSRCS += test_observer.c test_transform.c CSRCS += test_observer.c test_transform.c
CONFIG_EXAMPLES_DSPTEST_PROGNAME ?= dsptest$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_DSPTEST_PROGNAME)
MODULE = CONFIG_EXAMPLES_DSPTEST
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -79,11 +79,7 @@
* dsptest_main * dsptest_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int dsptest_main(int argc, char *argv[])
#endif
{ {
/* Test misc module */ /* Test misc module */

View File

@ -4,7 +4,7 @@
# #
config EXAMPLES_ELF config EXAMPLES_ELF
bool "ELF Loader Example" tristate "ELF Loader Example"
default n default n
select LIBC_EXECFUNCS select LIBC_EXECFUNCS
depends on ELF depends on ELF

View File

@ -40,8 +40,10 @@ include $(TOPDIR)/Make.defs
CSRCS = symtab.c CSRCS = symtab.c
MAINSRC = elf_main.c MAINSRC = elf_main.c
CONFIG_XYZ_PROGNAME ?= elf$(EXEEXT) PROGNAME = elf
PROGNAME = $(CONFIG_XYZ_PROGNAME) PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_ELF)
ROOTDEPPATH := --dep-path tests ROOTDEPPATH := --dep-path tests

View File

@ -233,11 +233,7 @@ static inline void testheader(FAR const char *progname)
* Name: elf_main * Name: elf_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int elf_main(int argc, char *argv[])
#endif
{ {
#ifdef CONFIG_EXAMPLES_ELF_FSREMOVEABLE #ifdef CONFIG_EXAMPLES_ELF_FSREMOVEABLE
struct stat buf; struct stat buf;

View File

@ -6,7 +6,7 @@
if SYSTEM_EMBEDLOG if SYSTEM_EMBEDLOG
config EXAMPLES_EMBEDLOG config EXAMPLES_EMBEDLOG
bool "embedlog example" tristate "embedlog example"
default n default n
select EMBEDLOG_ENABLE_OUT_FILE select EMBEDLOG_ENABLE_OUT_FILE
select EMBEDLOG_ENABLE_OUT_STDERR select EMBEDLOG_ENABLE_OUT_STDERR
@ -26,7 +26,6 @@ if EXAMPLES_EMBEDLOG
config EXAMPLES_EMBEDLOG_PROGNAME config EXAMPLES_EMBEDLOG_PROGNAME
string "Program name" string "Program name"
default "embedlog" default "embedlog"
depends on BUILD_KERNEL
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,19 +37,14 @@ include $(TOPDIR)/Make.defs
# embedlog example built-in application info # embedlog example built-in application info
CONFIG_EXAMPLES_EMBEDLOG_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_EMBEDLOG_PROGNAME)
CONFIG_EXAMPLES_EMBEDLOG_STACKSIZE ?= 2048
APPNAME = $(CONFIG_EXAMPLES_EMBEDLOG_PROGNAME)
PRIORITY = $(CONFIG_EXAMPLES_EMBEDLOG_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_EMBEDLOG_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_EMBEDLOG_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_EMBEDLOG_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_EMBEDLOG)
# embedlog Example # embedlog Example
MAINSRC = embedlog_main.c MAINSRC = embedlog_main.c
CFLAGS += -I$(APPDIR)/include/system CFLAGS += -I$(APPDIR)/include/system
CONFIG_EXAMPLES_EMBEDLOG_PROGNAME ?= embedlog$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_EMBEDLOG_PROGNAME)
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -317,11 +317,7 @@ static void el_print_file(const char *workdir)
* embedlog_main * embedlog_main
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_BUILD_KERNEL
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int embedlog_main(int argc, FAR char *argv[])
#endif
{ {
if (argc > 2 || (argc == 2 && strcmp(argv[1], "-h") == 0)) if (argc > 2 || (argc == 2 && strcmp(argv[1], "-h") == 0))
{ {

View File

@ -28,7 +28,6 @@ config EXAMPLES_FB_DEFAULTFB
config EXAMPLES_FB_PROGNAME config EXAMPLES_FB_PROGNAME
string "Program name" string "Program name"
default "fb" default "fb"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,20 +37,13 @@ include $(TOPDIR)/Make.defs
# FB, World! built-in application info # FB, World! built-in application info
CONFIG_EXAMPLES_FB_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_FB_PROGNAME)
CONFIG_EXAMPLES_FB_STACKSIZE ?= 2048
APPNAME = fb
PRIORITY = $(CONFIG_EXAMPLES_FB_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_FB_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_FB_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_FB_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_FB)
# FB, World! Example # FB, World! Example
MAINSRC = fb_main.c MAINSRC = fb_main.c
CONFIG_EXAMPLES_FB_PROGNAME ?= fb$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_FB_PROGNAME)
MODULE = CONFIG_EXAMPLES_FB
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -287,11 +287,7 @@ static void draw_rect(FAR struct fb_state_s *state,
* fb_main * fb_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int fb_main(int argc, char *argv[])
#endif
{ {
FAR const char *fbdev = g_default_fbdev; FAR const char *fbdev = g_default_fbdev;
struct fb_state_s state; struct fb_state_s state;

View File

@ -15,7 +15,6 @@ if EXAMPLES_FBOVERLAY
config EXAMPLES_FBOVERLAY_PROGNAME config EXAMPLES_FBOVERLAY_PROGNAME
string "Program name" string "Program name"
default "fboverlay" default "fboverlay"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,17 +37,13 @@ include $(TOPDIR)/Make.defs
# fboverlay built-in application info # fboverlay built-in application info
APPNAME = fboverlay PROGNAME = $(CONFIG_EXAMPLES_FBOVERLAY_PROGNAME)
PRIORITY = $(CONFIG_EXAMPLES_FBOVERLAY_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_FBOVERLAY_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_FBOVERLAY_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_FBOVERLAY_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_FBOVERLAY)
# fboverlay files # fboverlay files
MAINSRC = fboverlay_main.c MAINSRC = fboverlay_main.c
CONFIG_EXAMPLES_FBOVERLAY_PROGNAME ?= fboverlay$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_FBOVERLAY_PROGNAME)
MODULE = CONFIG_EXAMPLES_FBOVERLAY
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -1010,11 +1010,7 @@ static void usage(const char * progname)
* *
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int fboverlay_main(int argc, char *argv[])
#endif
{ {
char *fbdevice; char *fbdevice;

View File

@ -6,12 +6,11 @@
config EXAMPLES_FLASH_TEST config EXAMPLES_FLASH_TEST
tristate "SMART FLASH block device test" tristate "SMART FLASH block device test"
default n default n
depends on (!BUILD_PROTECTED && !BUILD_KERNEL) && MTD_SMART && NSH_BUILTIN_APPS depends on (!BUILD_PROTECTED && !BUILD_KERNEL) && MTD_SMART
---help--- ---help---
This logic performs a SMART flash block device test. This test This logic performs a SMART flash block device test. This test
performs a sector allocate, read, write, free and garbage collection performs a sector allocate, read, write, free and garbage collection
test on a SMART MTD block device. This test can be built only as an test on a SMART MTD block device.
NSH command
NOTE: This test uses internal OS interfaces and so is not available NOTE: This test uses internal OS interfaces and so is not available
in the NUTTX kernel build in the NUTTX kernel build

View File

@ -42,15 +42,11 @@ endif
# SMART FLASH block device test # SMART FLASH block device test
APPNAME = flash_test PROGNAME = flash_test
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 2048 STACKSIZE = 2048
MODULE = $(CONFIG_EXAMPLES_FLASH_TEST)
MAINSRC = flash_test.c MAINSRC = flash_test.c
CONFIG_XYZ_PROGNAME ?= flash_test$(EXEEXT)
PROGNAME = $(CONFIG_XYZ_PROGNAME)
MODULE = CONFIG_EXAMPLES_FLASH_TEST
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -61,11 +61,7 @@
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int flash_test_main(int argc, char *argv[])
#endif
{ {
struct inode* inode; struct inode* inode;
int ret; int ret;

View File

@ -52,9 +52,8 @@ config EXAMPLES_FLOWC_SENDER1
config EXAMPLES_FLOWC_PROGNAME1 config EXAMPLES_FLOWC_PROGNAME1
string "Target1 program name" string "Target1 program name"
default "receiver" if !EXAMPLES_FLOWC_SENDER1 default "flowc" if !EXAMPLES_FLOWC_TARGET2
default "sender" if EXAMPLES_FLOWC_SENDER1 default "flowc1" if EXAMPLES_FLOWC_TARGET2
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the Target1 program that will be used when the This is the name of the Target1 program that will be used when the
NSH ELF program is installed. NSH ELF program is installed.
@ -81,9 +80,7 @@ if EXAMPLES_FLOWC_TARGET2
config EXAMPLES_FLOWC_PROGNAME2 config EXAMPLES_FLOWC_PROGNAME2
string "Target2 program name" string "Target2 program name"
default "receiver" if !EXAMPLES_FLOWC_RECEIVER2 default "flowc2"
default "sender" if EXAMPLES_FLOWC_RECEIVER2
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the Target2 program that will be used when the This is the name of the Target2 program that will be used when the
NSH ELF program is installed. NSH ELF program is installed.

View File

@ -46,14 +46,6 @@ CSRCS += flowc_receiver.c
endif endif
MAINSRC += flowc_target1.c MAINSRC += flowc_target1.c
ifeq ($(CONFIG_EXAMPLES_FLOWC_SENDER1),y)
CONFIG_EXAMPLES_FLOWC_PROGNAME1 ?= sender
else
CONFIG_EXAMPLES_FLOWC_PROGNAME1 ?= receiver
endif
CONFIG_EXAMPLES_FLOWC_PRIORITY1 ?= 100
CONFIG_EXAMPLES_FLOWC_STACKSIZE1 ?= 2048
PROGNAME = $(CONFIG_EXAMPLES_FLOWC_PROGNAME1) PROGNAME = $(CONFIG_EXAMPLES_FLOWC_PROGNAME1)
PRIORITY = $(CONFIG_EXAMPLES_FLOWC_PRIORITY1) PRIORITY = $(CONFIG_EXAMPLES_FLOWC_PRIORITY1)
STACKSIZE = $(CONFIG_EXAMPLES_FLOWC_STACKSIZE1) STACKSIZE = $(CONFIG_EXAMPLES_FLOWC_STACKSIZE1)
@ -69,14 +61,6 @@ CSRCS += flowc_sender.c
endif endif
MAINSRC += flowc_target2.c MAINSRC += flowc_target2.c
ifeq ($(CONFIG_EXAMPLES_FLOWC_SENDER1),y)
CONFIG_EXAMPLES_FLOWC_PROGNAME2 ?= receiver
else
CONFIG_EXAMPLES_FLOWC_PROGNAME2 ?= sender
endif
CONFIG_EXAMPLES_FLOWC_PRIORITY2 ?= 100
CONFIG_EXAMPLES_FLOWC_STACKSIZE2 ?= 2048
PROGNAME += $(CONFIG_EXAMPLES_FLOWC_PROGNAME2) PROGNAME += $(CONFIG_EXAMPLES_FLOWC_PROGNAME2)
PRIORITY += $(CONFIG_EXAMPLES_FLOWC_PRIORITY2) PRIORITY += $(CONFIG_EXAMPLES_FLOWC_PRIORITY2)
STACKSIZE += $(CONFIG_EXAMPLES_FLOWC_STACKSIZE2) STACKSIZE += $(CONFIG_EXAMPLES_FLOWC_STACKSIZE2)
@ -100,39 +84,27 @@ HOST_BIN = sender$(EXEEXT)
endif endif
HOST_OBJS = $(HOST_SRCS:.c=.$(HOSTOBJSEXT)) HOST_OBJS = $(HOST_SRCS:.c=.$(HOSTOBJSEXT))
endif
ifeq ($(CONFIG_EXAMPLES_FLOWC_TARGET2),y)
APPNAME = flowc1 flowc2
else
APPNAME = flowc
endif
ifneq ($(CONFIG_EXAMPLES_FLOWC_TARGET2),y)
$(HOST_OBJS): %.$(HOSTOBJSEXT): %.c $(HOST_OBJS): %.$(HOSTOBJSEXT): %.c
@echo "CC: $<" @echo "CC: $<"
$(Q) $(HOSTCC) -c $(HOSTCFLAGS) $< -o $@ $(Q) $(HOSTCC) -c $(HOSTCFLAGS) $< -o $@
endif
config.h: $(TOPDIR)/include/nuttx/config.h config.h: $(TOPDIR)/include/nuttx/config.h
@echo "CP: $<" @echo "CP: $<"
$(Q) cp $< $@ $(Q) cp $< $@
ifneq ($(CONFIG_EXAMPLES_FLOWC_TARGET2),y)
$(HOST_BIN): config.h $(HOST_OBJS) $(HOST_BIN): config.h $(HOST_OBJS)
$(Q) $(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS) -o $@ $(Q) $(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS) -o $@
endif
context:: config.h $(HOST_BIN) context:: config.h $(HOST_BIN)
clean:: clean::
ifneq ($(CONFIG_EXAMPLES_FLOWC_TARGET2),y)
$(call DELFILE, $(HOST_BIN)) $(call DELFILE, $(HOST_BIN))
$(call DELFILE, *.$(HOSTOBJSEXT)) $(call DELFILE, *.$(HOSTOBJSEXT))
endif
$(call DELFILE, *.dSYM) $(call DELFILE, *.dSYM)
$(call DELFILE, config.h) $(call DELFILE, config.h)
MODULE = CONFIG_EXAMPLES_FLOWC endif
MODULE = $(CONFIG_EXAMPLES_FLOWC)
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -48,13 +48,7 @@
* flowc1_main * flowc1_main
****************************************************************************/ ****************************************************************************/
#if defined(BUILD_MODULE)
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#elif defined(CONFIG_EXAMPLES_FLOWC_TARGET2)
int flowc1_main(int argc, char *argv[])
#else
int flowc_main(int argc, char *argv[])
#endif
{ {
/* Run the receiver or sender, depending upon how we are configured */ /* Run the receiver or sender, depending upon how we are configured */

View File

@ -48,11 +48,7 @@
* flowc2_main * flowc2_main
****************************************************************************/ ****************************************************************************/
#if defined(BUILD_MODULE)
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int flowc2_main(int argc, char *argv[])
#endif
{ {
/* Run the receiver or sender, depending upon how target1 was configured */ /* Run the receiver or sender, depending upon how target1 was configured */

View File

@ -36,7 +36,6 @@ config EXAMPLES_FT80X_EXCLUDE_BITMAPS
config EXAMPLES_FT80X_PROGNAME config EXAMPLES_FT80X_PROGNAME
string "FT80x program name" string "FT80x program name"
default "ft80x" default "ft80x"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,12 +37,10 @@ include $(TOPDIR)/Make.defs
# FT80X example built-in application info # FT80X example built-in application info
CONFIG_EXAMPLES_FT80X_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_FT80X_PROGNAME)
CONFIG_EXAMPLES_FT80X_STACKSIZE ?= 2048
APPNAME = ft80x
PRIORITY = $(CONFIG_EXAMPLES_FT80X_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_FT80X_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_FT80X_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_FT80X_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_FT80X)
# FT80X example # FT80X example
@ -58,9 +56,4 @@ endif
MAINSRC = ft80x_main.c MAINSRC = ft80x_main.c
CONFIG_EXAMPLES_FT80X_PROGNAME ?= ft80x$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_FT80X_PROGNAME)
MODULE = CONFIG_EXAMPLES_FT80X
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -288,11 +288,7 @@ static int ft80x_example(int fd, FAR struct ft80x_dlbuffer_s *buffer,
* ft80x_main * ft80x_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int ft80x_main(int argc, char *argv[])
#endif
{ {
FAR struct ft80x_dlbuffer_s *buffer; FAR struct ft80x_dlbuffer_s *buffer;
int fd; int fd;

View File

@ -37,18 +37,12 @@ include $(TOPDIR)/Make.defs
# FTPC Client Application # FTPC Client Application
CONFIG_EXAMPLES_FTPC_STACKSIZE ?= 4096 PROGNAME = ftpc
APPNAME = ftpc
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = CONFIG_EXAMPLES_FTPC_STACKSIZE STACKSIZE = $(CONFIG_EXAMPLES_FTPC_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_FTPC)
CSRCS = ftpc_cmds.c CSRCS = ftpc_cmds.c
MAINSRC = ftpc_main.c MAINSRC = ftpc_main.c
CONFIG_XYZ_PROGNAME ?= ftpc$(EXEEXT)
PROGNAME = $(CONFIG_XYZ_PROGNAME)
MODULE = CONFIG_EXAMPLES_FTPC
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -365,11 +365,7 @@ int ftpc_parse(SESSION handle, char *cmdline)
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int ftpc_main(int argc, char **argv, char **envp)
#endif
{ {
union ftpc_sockaddr_u server; union ftpc_sockaddr_u server;
SESSION handle; SESSION handle;

View File

@ -37,15 +37,9 @@ include $(TOPDIR)/Make.defs
MAINSRC = ftpd_main.c MAINSRC = ftpd_main.c
CONFIG_EXAMPLES_FTPD_STACKSIZE ?= 2048 PROGNAME = ftpd_start ftpd_stop
STACKSIZE = $(CONFIG_EXAMPLES_FTPD_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_FTPD_STACKSIZE)
PRIORITY = SCHED_PRIORITY_DEFAULT PRIORITY = SCHED_PRIORITY_DEFAULT
MODULE = $(CONFIG_EXAMPLES_FTPD)
CONFIG_XYZ_PROGNAME ?= ftpd$(EXEEXT)
PROGNAME = $(CONFIG_XYZ_PROGNAME)
APPNAME = ftpd_start ftpd_stop
MODULE = CONFIG_EXAMPLES_FTPD
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -247,11 +247,7 @@ int ftpd_daemon(int s_argc, char **s_argv)
* Name: ftpd_main * Name: ftpd_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int ftpd_start_main(int s_argc, char **s_argv)
#endif
{ {
/* Check if we have already initialized the network */ /* Check if we have already initialized the network */
@ -307,7 +303,6 @@ int ftpd_start_main(int s_argc, char **s_argv)
* Name: ftpd_stop * Name: ftpd_stop
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_NSH_BUILTIN_APPS
int ftpd_stop_main(int s_argc, char **s_argv) int ftpd_stop_main(int s_argc, char **s_argv)
{ {
if (!g_ftpdglob.initialized || !g_ftpdglob.running) if (!g_ftpdglob.initialized || !g_ftpdglob.running)
@ -320,4 +315,3 @@ int ftpd_stop_main(int s_argc, char **s_argv)
g_ftpdglob.stop = true; g_ftpdglob.stop = true;
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
#endif

View File

@ -15,7 +15,6 @@ if EXAMPLES_GPIO
config EXAMPLES_GPIO_PROGNAME config EXAMPLES_GPIO_PROGNAME
string "Program name" string "Program name"
default "gpio" default "gpio"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,20 +37,13 @@ include $(TOPDIR)/Make.defs
# GPIO, World! built-in application info # GPIO, World! built-in application info
CONFIG_EXAMPLES_GPIO_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_GPIO_PROGNAME)
CONFIG_EXAMPLES_GPIO_STACKSIZE ?= 2048
APPNAME = gpio
PRIORITY = $(CONFIG_EXAMPLES_GPIO_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_GPIO_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_GPIO_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_GPIO_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_GPIO)
# GPIO, World! Example # GPIO, World! Example
MAINSRC = gpio_main.c MAINSRC = gpio_main.c
CONFIG_EXAMPLES_GPIO_PROGNAME ?= gpio$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_GPIO_PROGNAME)
MODULE = CONFIG_EXAMPLES_GPIO
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -73,11 +73,7 @@ static void show_usage(FAR const char *progname)
* gpio_main * gpio_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int gpio_main(int argc, char *argv[])
#endif
{ {
FAR char *devpath = NULL; FAR char *devpath = NULL;
enum gpio_pintype_e pintype; enum gpio_pintype_e pintype;

View File

@ -15,7 +15,6 @@ if EXAMPLES_GPS
config EXAMPLES_GPS_PROGNAME config EXAMPLES_GPS_PROGNAME
string "Program name" string "Program name"
default "gps" default "gps"
depends on BUILD_LOADABLE
---help--- ---help---
This is the name of the program that will be used when the NSH ELF This is the name of the program that will be used when the NSH ELF
program is installed. program is installed.

View File

@ -37,21 +37,14 @@ include $(TOPDIR)/Make.defs
# GPS built-in application info # GPS built-in application info
CONFIG_EXAMPLES_GPS_PRIORITY ?= SCHED_PRIORITY_DEFAULT PROGNAME = $(CONFIG_EXAMPLES_GPS_PROGNAME)
CONFIG_EXAMPLES_GPS_STACKSIZE ?= 2048
APPNAME = gps
PRIORITY = $(CONFIG_EXAMPLES_GPS_PRIORITY) PRIORITY = $(CONFIG_EXAMPLES_GPS_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_GPS_STACKSIZE) STACKSIZE = $(CONFIG_EXAMPLES_GPS_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_GPS)
# GPS Example # GPS Example
MAINSRC = gps_main.c MAINSRC = gps_main.c
CONFIG_EXAMPLES_GPS_PROGNAME ?= gps$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_GPS_PROGNAME)
MODULE = CONFIG_EXAMPLES_GPS
include $(APPDIR)/Application.mk include $(APPDIR)/Application.mk

View File

@ -54,11 +54,7 @@
* gps_main * gps_main
****************************************************************************/ ****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[]) int main(int argc, FAR char *argv[])
#else
int gps_main(int argc, char *argv[])
#endif
{ {
int fd; int fd;
int cnt; int cnt;

Some files were not shown because too many files have changed in this diff Show More