diff --git a/Application.mk b/Application.mk index 63d292f73..6312533d8 100644 --- a/Application.mk +++ b/Application.mk @@ -42,13 +42,15 @@ include $(APPDIR)/Make.defs # has the value "m" ifneq ($(MAINSRC),) - ifneq ($(MODULE),) - ifeq ($(CONFIG_$(MODULE)),m) - BUILD_MODULE = y - endif + ifeq ($($(MODULE)),m) + BUILD_MODULE = y endif endif +ifeq ($(CONFIG_BUILD_KERNEL),y) + BUILD_MODULE = y +endif + # Pass the definition to the C/C++ code via the CFLAGS/CXXFLAGS ifeq ($(BUILD_MODULE),y) @@ -89,16 +91,18 @@ else INSTALL_DIR = $(BIN_DIR) endif -ROOTDEPPATH = --dep-path . +ROOTDEPPATH += --dep-path . -VPATH = +VPATH += :. # Targets follow -all: .built +all:: .built .PHONY: clean preconfig depend distclean .PRECIOUS: $(APPDIR)/libapps$(LIBEXT) +ifneq ($(CONFIG_BUILD_LOADABLE),y) + $(AOBJS): %$(OBJEXT): %.S $(call ASSEMBLE, $<, $@) @@ -116,42 +120,103 @@ $(MAINOBJ): %$(OBJEXT): %.c $(call COMPILE, $<, $@) endif +else + +define ELFASSEMBLE + @echo "AS: $1" + $(Q) $(CC) -c $(AELFFLAGS) $1 -o $2 +endef + +define ELFCOMPILE + @echo "CC: $1" + $(Q) $(CC) -c $(CELFFLAGS) $1 -o $2 +endef + +define ELFCOMPILEXX + @echo "CXX: $1" + $(Q) $(CXX) -c $(CXXELFFLAGS) $1 -o $2 +endef + +$(AOBJS): %$(OBJEXT): %.S + $(if $(AELFFLAGS), \ + $(call ELFASSEMBLE, $<, $@), \ + $(call ASSEMBLE, $<, $@), \ + ) + +$(COBJS): %$(OBJEXT): %.c + $(if $(CELFFLAGS), \ + $(call ELFCOMPILE, $<, $@), \ + $(call COMPILE, $<, $@), \ + ) + +$(CXXOBJS): %$(OBJEXT): %$(CXXEXT) + $(if $(CXXELFFLAGS), \ + $(call ELFCOMPILEXX, $<, $@), \ + $(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) $(call ARCHIVE, $(BIN), $(OBJS)) $(Q) touch $@ ifeq ($(BUILD_MODULE), y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) +PROGLIST := $(addprefix $(INSTALL_DIR)$(DELIM),$(PROGNAME)) +PROGOBJ := $(MAINOBJ) -install: $(BIN_DIR)$(DELIM)$(PROGNAME) +$(PROGLIST): $(MAINOBJ) $(OBJS) + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(firstword $(PROGLIST)) $(ARCHCRT0OBJ) $(firstword $(PROGOBJ)) $(LDLIBS) + $(Q) $(NM) -u $(firstword $(PROGLIST)) + $(eval PROGLIST=$(filter-out $(firstword $(PROGLIST)),$(PROGLIST))) + $(eval PROGOBJ=$(filter-out $(firstword $(PROGOBJ)),$(PROGOBJ))) + +install:: $(PROGLIST) else -install: +install:: endif -preconfig: +preconfig:: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +REGLIST := $(addprefix $(BUILTIN_REGISTRY)$(DELIM),$(APPNAME)_main.bdat) +APPLIST := $(APPNAME) + ifneq ($(APPNAME),) ifneq ($(PRIORITY),) ifneq ($(STACKSIZE),) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(BUILD_MODULE),,$(APPNAME)_main)) +$(REGLIST): $(DEPCONFIG) Makefile + $(call REGISTER,$(firstword $(APPLIST)),$(firstword $(PRIORITY)),$(firstword $(STACKSIZE)),$(if $(BUILD_MODULE),,$(firstword $(APPLIST))_main)) + $(eval APPLIST=$(filter-out $(firstword $(APPLIST)),$(APPLIST))) + $(if $(filter-out $(firstword $(PRIORITY)),$(PRIORITY)),$(eval PRIORITY=$(filter-out $(firstword $(PRIORITY)),$(PRIORITY)))) + $(if $(filter-out $(firstword $(STACKSIZE)),$(STACKSIZE)),$(eval STACKSIZE=$(filter-out $(firstword $(STACKSIZE)),$(STACKSIZE)))) -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +context:: $(REGLIST) else -context: +context:: endif else -context: +context:: endif else -context: +context:: endif else -context: +context:: endif .depend: Makefile $(SRCS) @@ -162,13 +227,13 @@ else endif $(Q) touch $@ -depend: .depend +depend:: .depend -clean: +clean:: $(call DELFILE, .built) $(call CLEAN) -distclean: clean +distclean:: clean $(call DELFILE, Make.dep) $(call DELFILE, .depend) diff --git a/Make.defs b/Make.defs index 889fcca16..c3eb1e6ba 100644 --- a/Make.defs +++ b/Make.defs @@ -123,4 +123,6 @@ endif CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"} CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"} -LDLIBS = $(APPDIR)/libapps.a +ifneq ($(CONFIG_BUILD_KERNEL),y) + LDLIBS = $(APPDIR)/libapps.a +endif diff --git a/Makefile b/Makefile index 867639a49..1a68a3ac8 100644 --- a/Makefile +++ b/Makefile @@ -161,6 +161,7 @@ clean: $(foreach SDIR, $(CLEANDIRS), $(SDIR)_clean) $(call DELFILE, $(BIN)) $(call DELFILE, Kconfig) $(call DELDIR, $(BIN_DIR)) + $(call DELDIR, $(EXE_DIR)) $(call CLEAN) distclean: $(foreach SDIR, $(CLEANDIRS), $(SDIR)_distclean) diff --git a/builtin/Makefile b/builtin/Makefile index 492e91118..57dbc2e02 100644 --- a/builtin/Makefile +++ b/builtin/Makefile @@ -34,49 +34,16 @@ ############################################################################ -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Source and object files -ASRCS = CSRCS = builtin_forindex.c builtin_list.c exec_builtin.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\libapps$(LIBEXT) -else - BIN = ../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . -VPATH = - # Registry entry lists PDATLIST = $(strip $(call RWILDCARD, registry, *.pdat)) BDATLIST = $(strip $(call RWILDCARD, registry, *.bdat)) -# Build Targets - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - registry$(DELIM).updated: $(Q) $(MAKE) -C registry .updated TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" @@ -98,35 +65,19 @@ ifneq ($(PDATLIST),) endif $(Q) mv .xx_builtin_proto.h builtin_proto.h -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: +context:: $(Q) $(MAKE) -C registry context TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" -.depend: Makefile $(SRCS) builtin_list.h builtin_proto.h - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ +depend:: builtin_list.h builtin_proto.h -depend: .depend - -clean: +clean:: $(Q) $(MAKE) -C registry clean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" - $(call DELFILE, .built) $(call DELFILE, .xx_builtin_list.h) $(call DELFILE, .xx_builtin_proto.h) - $(call CLEAN) -distclean: clean +distclean:: $(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) -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/canutils/libcanard/Makefile b/canutils/libcanard/Makefile index 8315f3087..1b1579ed2 100644 --- a/canutils/libcanard/Makefile +++ b/canutils/libcanard/Makefile @@ -34,7 +34,6 @@ ############################################################################ -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs WGET = wget UNPACK = unzip @@ -52,25 +51,6 @@ APPS_INCDIR = $(APPDIR)$(DELIM)include$(DELIM)canutils CFLAGS += -std=c99 -I$(APPS_INCDIR) -DCANARD_ASSERT=DEBUGASSERT CSRCS = $(LIBCANARD_SRCDIR)$(DELIM)canard.c $(LIBCANARD_DRVDIR)$(DELIM)canard_nuttx.c -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(CSRCS) -OBJS = $(COBJS) - -ifeq ($(WINTOOL),y) - BIN = "${shell cygpath -w $(APPDIR)$(DELIM)libapps$(LIBEXT)}" -else - BIN = $(APPDIR)$(DELIM)libapps$(LIBEXT) -endif -DEPBIN = $(APPDIR)/libapps$(LIBEXT) - -ROOTDEPPATH = --dep-path . - -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) $(LIBCANARD_PACKNAME): @echo "Downloading: $@" @@ -92,36 +72,15 @@ $(APPS_INCDIR)$(DELIM)canard.h: $(LIBCANARD_SRCDIR)$(DELIM)canard.h $(APPS_INCDIR)$(DELIM)canard_nuttx.h: $(LIBCANARD_DRVDIR)$(DELIM)canard_nuttx.h $(Q) cp $< $@ -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) +context:: $(APPS_INCDIR)$(DELIM)canard.h $(APPS_INCDIR)$(DELIM)canard_nuttx.h -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch $@ - -install: - -context: $(APPS_INCDIR)$(DELIM)canard.h $(APPS_INCDIR)$(DELIM)canard_nuttx.h - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) +clean:: $(foreach OBJ, $(OBJS), $(call DELFILE, $(OBJ))) -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +distclean:: $(call DELFILE, $(APPS_INCDIR)$(DELIM)canard.h) $(call DELFILE, $(APPS_INCDIR)$(DELIM)canard_nuttx.h) $(call DELDIR, $(LIBCANARD_UNPACKNAME)) $(call DELFILE, $(LIBCANARD_PACKNAME)) -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/adc/Kconfig b/examples/adc/Kconfig index 64e30a85d..d6b093728 100644 --- a/examples/adc/Kconfig +++ b/examples/adc/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_ADC - bool "ADC example" + tristate "ADC example" default n depends on ADC && LIB_BOARDCTL select BOARDCTL_ADCTEST diff --git a/examples/adc/Make.defs b/examples/adc/Make.defs index 084e6968e..a6ba7a26c 100644 --- a/examples/adc/Make.defs +++ b/examples/adc/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_ADC),y) +ifneq ($(CONFIG_EXAMPLES_ADC),) CONFIGURED_APPS += examples/adc endif diff --git a/examples/adc/Makefile b/examples/adc/Makefile index 2225c7972..564859391 100644 --- a/examples/adc/Makefile +++ b/examples/adc/Makefile @@ -50,4 +50,6 @@ APPNAME = adc PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_ADC + include $(APPDIR)/Application.mk diff --git a/examples/adxl372_test/Kconfig b/examples/adxl372_test/Kconfig index 8cc935914..55d1467e7 100644 --- a/examples/adxl372_test/Kconfig +++ b/examples/adxl372_test/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_ADXL372_TEST - bool "ADXL372 test program" + tristate "ADXL372 test program" default n ---help--- Enable the ADXL372 sensor SPI test program. diff --git a/examples/adxl372_test/Make.defs b/examples/adxl372_test/Make.defs index 3e43eb187..37a528859 100644 --- a/examples/adxl372_test/Make.defs +++ b/examples/adxl372_test/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_ADXL372_TEST),y) +ifneq ($(CONFIG_EXAMPLES_ADXL372_TEST),) CONFIGURED_APPS += examples/adxl372_test endif diff --git a/examples/adxl372_test/Makefile b/examples/adxl372_test/Makefile index f3e141dde..591019df2 100644 --- a/examples/adxl372_test/Makefile +++ b/examples/adxl372_test/Makefile @@ -51,4 +51,6 @@ 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 diff --git a/examples/ajoystick/Kconfig b/examples/ajoystick/Kconfig index e5aea1aa1..ae4bb1aea 100644 --- a/examples/ajoystick/Kconfig +++ b/examples/ajoystick/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_AJOYSTICK - bool "Analog joystick example" + tristate "Analog joystick example" default n depends on AJOYSTICK && !DISABLE_SIGNALS ---help--- diff --git a/examples/ajoystick/Make.defs b/examples/ajoystick/Make.defs index e62bbbf23..b4ac677f5 100644 --- a/examples/ajoystick/Make.defs +++ b/examples/ajoystick/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_AJOYSTICK),y) +ifneq ($(CONFIG_EXAMPLES_AJOYSTICK),) CONFIGURED_APPS += examples/ajoystick endif diff --git a/examples/ajoystick/Makefile b/examples/ajoystick/Makefile index 9e736c859..ee8ad0c9d 100644 --- a/examples/ajoystick/Makefile +++ b/examples/ajoystick/Makefile @@ -50,5 +50,7 @@ APPNAME = ajoy PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_AJOYSTICK + include $(APPDIR)/Application.mk diff --git a/examples/alarm/Kconfig b/examples/alarm/Kconfig index ceb4af2cc..02e0c3d78 100644 --- a/examples/alarm/Kconfig +++ b/examples/alarm/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_ALARM - bool "RTC alarm driver example" + tristate "RTC alarm driver example" default n depends on RTC_DRIVER && RTC_ALARM ---help--- diff --git a/examples/alarm/Make.defs b/examples/alarm/Make.defs index c5c323515..2bf6b7100 100644 --- a/examples/alarm/Make.defs +++ b/examples/alarm/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_ALARM),y) +ifneq ($(CONFIG_EXAMPLES_ALARM),) CONFIGURED_APPS += examples/alarm endif diff --git a/examples/alarm/Makefile b/examples/alarm/Makefile index f07c43161..a5907a5e4 100644 --- a/examples/alarm/Makefile +++ b/examples/alarm/Makefile @@ -53,4 +53,6 @@ MAINSRC = alarm_main.c CONFIG_EXAMPLES_ALARM_PROGNAME ?= alarm$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_ALARM_PROGNAME) +MODULE = CONFIG_EXAMPLES_ALARM + include $(APPDIR)/Application.mk diff --git a/examples/apa102/Kconfig b/examples/apa102/Kconfig index 862af1231..6f94b9501 100644 --- a/examples/apa102/Kconfig +++ b/examples/apa102/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_APA102 - bool "APA102 LED Strip example" + tristate "APA102 LED Strip example" default n ---help--- Enable the APA102 example diff --git a/examples/apa102/Make.defs b/examples/apa102/Make.defs index 06d2c3905..d10d4219d 100644 --- a/examples/apa102/Make.defs +++ b/examples/apa102/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_APA102),y) +ifneq ($(CONFIG_EXAMPLES_APA102),) CONFIGURED_APPS += examples/apa102 endif diff --git a/examples/apa102/Makefile b/examples/apa102/Makefile index 895c9cf23..7f883a29c 100644 --- a/examples/apa102/Makefile +++ b/examples/apa102/Makefile @@ -50,4 +50,6 @@ MAINSRC = apa102_main.c CONFIG_EXAMPLES_APA102_PROGNAME ?= apa102$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_APA102_PROGNAME) +MODULE = CONFIG_EXAMPLES_APA102 + include $(APPDIR)/Application.mk diff --git a/examples/apds9960/Kconfig b/examples/apds9960/Kconfig index 0ca2d14e3..a162bb170 100644 --- a/examples/apds9960/Kconfig +++ b/examples/apds9960/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_APDS9960 - bool "APDS-9960 Test Application" + tristate "APDS-9960 Test Application" default n depends on SENSORS_APDS9960 ---help--- diff --git a/examples/apds9960/Make.defs b/examples/apds9960/Make.defs index 4f99aa118..10dbf64cb 100644 --- a/examples/apds9960/Make.defs +++ b/examples/apds9960/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_APDS9960),y) +ifneq ($(CONFIG_EXAMPLES_APDS9960),) CONFIGURED_APPS += examples/apds9960 endif diff --git a/examples/apds9960/Makefile b/examples/apds9960/Makefile index e2a535fea..283b7404a 100644 --- a/examples/apds9960/Makefile +++ b/examples/apds9960/Makefile @@ -53,4 +53,6 @@ MAINSRC = apds9960_main.c CONFIG_EXAMPLES_APDS9960_PROGNAME ?= apds9960$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_APDS9960_PROGNAME) +MODULE = CONFIG_EXAMPLES_APDS9960 + include $(APPDIR)/Application.mk diff --git a/examples/bastest/Kconfig b/examples/bastest/Kconfig index 37359020c..ab78a02ee 100644 --- a/examples/bastest/Kconfig +++ b/examples/bastest/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_BASTEST - bool "Setup Test Files for BAS" + tristate "Setup Test Files for BAS" default n depends on FS_ROMFS && INTERPRETERS_BAS ---help--- diff --git a/examples/bastest/Make.defs b/examples/bastest/Make.defs index 1c260c1c6..cbe694af4 100644 --- a/examples/bastest/Make.defs +++ b/examples/bastest/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_BASTEST),y) +ifneq ($(CONFIG_EXAMPLES_BASTEST),) CONFIGURED_APPS += examples/bastest endif diff --git a/examples/bastest/Makefile b/examples/bastest/Makefile index 89022a3e9..7611e6bb2 100644 --- a/examples/bastest/Makefile +++ b/examples/bastest/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # BAS test volume mounter @@ -45,37 +43,8 @@ STACKSIZE = 2048 # Hello, World! Example -ASRCS = -CSRCS = MAINSRC = bastest_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - BASTEST_DIR = $(APPDIR)$(DELIM)examples$(DELIM)bastest TESTS_DIR = $(BASTEST_DIR)$(DELIM)tests ROMFS_IMG = romfs.img @@ -83,22 +52,8 @@ ROMFS_HDR = romfs.h PROGNAME = bastest$(EXEEXT) -ROOTDEPPATH = --dep-path . - # Common build -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - # Create the romfs.h header file from the tests/ directory $(ROMFS_IMG) : @@ -109,54 +64,12 @@ $(ROMFS_HDR) : $(ROMFS_IMG) # Add the BASTEST object to the archive -.built: $(ROMFS_HDR) $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built +context:: $(ROMFS_HDR) -# Link and install the program binary - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register the NSH builtin application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Housekeeping stuff - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean +distclean:: $(call DELFILE, $(ROMFS_HDR)) $(call DELFILE, $(ROMFS_IMG)) - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) -preconfig: +MODULE = CONFIG_EXAMPLES_BASTEST --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/bmp180/Kconfig b/examples/bmp180/Kconfig index b45163fc8..4bf1e61da 100644 --- a/examples/bmp180/Kconfig +++ b/examples/bmp180/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_BMP180 - bool "BMP180 Barometer sensor example" + tristate "BMP180 Barometer sensor example" default n depends on SENSORS_BMP180 ---help--- diff --git a/examples/bmp180/Make.defs b/examples/bmp180/Make.defs index b5033c981..9656e34ca 100644 --- a/examples/bmp180/Make.defs +++ b/examples/bmp180/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_BMP180),y) +ifneq ($(CONFIG_EXAMPLES_BMP180),) CONFIGURED_APPS += examples/bmp180 endif diff --git a/examples/bmp180/Makefile b/examples/bmp180/Makefile index 78f05d72b..67ea6f357 100644 --- a/examples/bmp180/Makefile +++ b/examples/bmp180/Makefile @@ -55,4 +55,6 @@ MAINSRC = bmp180_main.c CONFIG_EXAMPLES_BMP180_PROGNAME ?= bmp180$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_BMP180_PROGNAME) +MODULE = CONFIG_EXAMPLES_BMP180 + include $(APPDIR)/Application.mk diff --git a/examples/bridge/Kconfig b/examples/bridge/Kconfig index 5bb0f68cb..96586e4e5 100644 --- a/examples/bridge/Kconfig +++ b/examples/bridge/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_BRIDGE - bool "UDP bridge example" + tristate "UDP bridge example" default n depends on NET_UDP && !NET_IPv6 ---help--- diff --git a/examples/bridge/Make.defs b/examples/bridge/Make.defs index 849f90950..0ab86dd6f 100644 --- a/examples/bridge/Make.defs +++ b/examples/bridge/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_BRIDGE),y) +ifneq ($(CONFIG_EXAMPLES_BRIDGE),) CONFIGURED_APPS += examples/bridge endif diff --git a/examples/bridge/Makefile b/examples/bridge/Makefile index dfbe43e33..33cafe769 100644 --- a/examples/bridge/Makefile +++ b/examples/bridge/Makefile @@ -34,34 +34,18 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Discover built-in application info -TARG_APPNAME = bridge -TARG_PRIORITY = SCHED_PRIORITY_DEFAULT -TARG_STACKSIZE = 2048 +APPNAME = bridge +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 -TARG_ASRCS = -TARG_CSRCS = MAINSRC = bridge_main.c -TARG_AOBJS = $(TARG_ASRCS:.S=$(OBJEXT)) -TARG_COBJS = $(TARG_CSRCS:.c=$(OBJEXT)) -TARG_MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -TARG_SRCS = $(TARG_ASRCS) $(TARG_CSRCS) $(MAINSRC) -TARG_OBJS = $(TARG_AOBJS) $(TARG_COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - TARG_OBJS += $(TARG_MAINOBJ) -endif - HOST_SRCS1 = host_net1.c HOST_SRCS2 = host_net2.c -HOST_SRCS = $(HOST_SRCS1) $(HOST_SRCS2) HOST_OBJS1 = $(HOST_SRCS1:.c=.o) HOST_OBJS2 = $(HOST_SRCS2:.c=.o) @@ -70,48 +54,15 @@ HOST_OBJS = $(HOST_OBJS1) $(HOST_OBJS2) HOST_BIN1 = host1 HOST_BIN2 = host2 -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - TARG_BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - TARG_BIN = ..\\..\\libapps$(LIBEXT) -else - TARG_BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - TARG_INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - TARG_INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_EXAMPLES_BRIDGE_PROGNAME ?= bridge$(EXEEXT) -TARG_PROGNAME = $(CONFIG_EXAMPLES_BRIDGE_PROGNAME) - -ROOTDEPPATH = --dep-path . +PROGNAME = $(CONFIG_EXAMPLES_BRIDGE_PROGNAME) # Common build -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(TARG_AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(TARG_COBJS) $(TARG_MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - $(HOST_OBJS): %.o: %.c @echo "CC: $<" $(Q) $(HOSTCC) -c $(HOSTCFLAGS) $< -o $@ -$(TARG_BIN): $(TARG_OBJS) - $(call ARCHIVE, $(TARG_BIN), $(TARG_OBJS)) - bridge_config.h: $(TOPDIR)/include/nuttx/config.h @echo "CP: brigetconfig.h" $(Q) cp $(TOPDIR)/include/nuttx/config.h bridge_config.h @@ -124,48 +75,15 @@ $(HOST_BIN2): bridge_config.h $(HOST_OBJS2) @echo "LD: $@" $(Q) $(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS2) -o $@ -.built: $(TARG_BIN) $(HOST_BIN1) $(HOST_BIN2) - @touch .built +context:: $(HOST_BIN1) $(HOST_BIN2) -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(TARG_PROGNAME): $(TARG_OBJS) $(TARG_MAINOBJ) - @echo "LD: $(TARG_PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(TARG_INSTALL_DIR)$(DELIM)$(TARG_PROGNAME) $(ARCHCRT0OBJ) $(TARG_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(TARG_INSTALL_DIR)$(DELIM)$(TARG_PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(TARG_PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(TARG_APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(TARG_APPNAME),$(TARG_PRIORITY),$(TARG_STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(TARG_APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(TARG_APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(TARG_SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(TARG_SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) +clean:: $(call DELFILE, $(HOST_BIN1)) $(call DELFILE, $(HOST_BIN2)) - $(call CLEAN) -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +distclean:: $(call DELFILE, bridge_config.h) -preconfig: +MODULE = CONFIG_EXAMPLES_BRIDGE --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/buttons/Kconfig b/examples/buttons/Kconfig index 467f6c573..ef4bda57e 100644 --- a/examples/buttons/Kconfig +++ b/examples/buttons/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_BUTTONS - bool "Buttons driver example" + tristate "Buttons driver example" default n depends on ARCH_HAVE_BUTTONS ---help--- diff --git a/examples/buttons/Make.defs b/examples/buttons/Make.defs index 6266506b0..9ae75f222 100644 --- a/examples/buttons/Make.defs +++ b/examples/buttons/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_BUTTONS),y) +ifneq ($(CONFIG_EXAMPLES_BUTTONS),) CONFIGURED_APPS += examples/buttons endif diff --git a/examples/buttons/Makefile b/examples/buttons/Makefile index 69c12278f..07e4fab5b 100644 --- a/examples/buttons/Makefile +++ b/examples/buttons/Makefile @@ -53,4 +53,6 @@ MAINSRC = buttons_main.c CONFIG_EXAMPLES_BUTTONS_PROGNAME ?= buttons$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_BUTTONS_PROGNAME) +MODULE = CONFIG_EXAMPLES_BUTTONS + include $(APPDIR)/Application.mk diff --git a/examples/calib_udelay/Kconfig b/examples/calib_udelay/Kconfig index c68f060a8..2d809f978 100644 --- a/examples/calib_udelay/Kconfig +++ b/examples/calib_udelay/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_CALIB_UDELAY - bool "Calibration tool for udelay" + tristate "Calibration tool for udelay" default n select CLOCK_MONOTONIC select LIBC_FLOATINGPOINT diff --git a/examples/calib_udelay/Make.defs b/examples/calib_udelay/Make.defs index 1fc121ba5..b2539d6a2 100644 --- a/examples/calib_udelay/Make.defs +++ b/examples/calib_udelay/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_CALIB_UDELAY),y) +ifneq ($(CONFIG_EXAMPLES_CALIB_UDELAY),) CONFIGURED_APPS += examples/calib_udelay endif diff --git a/examples/calib_udelay/Makefile b/examples/calib_udelay/Makefile index 09d43b0d0..1359c04ff 100644 --- a/examples/calib_udelay/Makefile +++ b/examples/calib_udelay/Makefile @@ -53,4 +53,6 @@ ASRCS = CSRCS = MAINSRC = calib_udelay_main.c +MODULE = CONFIG_EXAMPLES_CALIB_UDELAY + include $(APPDIR)/Application.mk diff --git a/examples/can/Kconfig b/examples/can/Kconfig index ffcba90fa..8c01b3d3a 100644 --- a/examples/can/Kconfig +++ b/examples/can/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_CAN - bool "CAN example" + tristate "CAN example" default n depends on CAN ---help--- diff --git a/examples/can/Make.defs b/examples/can/Make.defs index 094765ab9..fd3492c4c 100644 --- a/examples/can/Make.defs +++ b/examples/can/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_CAN),y) +ifneq ($(CONFIG_EXAMPLES_CAN),) CONFIGURED_APPS += examples/can endif diff --git a/examples/can/Makefile b/examples/can/Makefile index fa024eaa9..9cc48dfae 100644 --- a/examples/can/Makefile +++ b/examples/can/Makefile @@ -50,4 +50,6 @@ APPNAME = can PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_CAN + include $(APPDIR)/Application.mk diff --git a/examples/canard/Kconfig b/examples/canard/Kconfig index d7bc8f65a..b52a2a058 100644 --- a/examples/canard/Kconfig +++ b/examples/canard/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_LIBCANARD - bool "libcandard example" + tristate "libcandard example" default n depends on CANUTILS_LIBCANARD && CLOCK_MONOTONIC && SYSTEM_TIME64 ---help--- diff --git a/examples/canard/Make.defs b/examples/canard/Make.defs index c14b9ec52..5c83cdc03 100644 --- a/examples/canard/Make.defs +++ b/examples/canard/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_LIBCANARD),y) +ifneq ($(CONFIG_EXAMPLES_LIBCANARD),) CONFIGURED_APPS += examples/canard endif diff --git a/examples/canard/Makefile b/examples/canard/Makefile index 5010c6c2e..6296bf7d9 100644 --- a/examples/canard/Makefile +++ b/examples/canard/Makefile @@ -49,4 +49,6 @@ CSRCS = CFLAGS += -I$(APPDIR)/include/canutils MAINSRC = canard_main.c +MODULE = CONFIG_EXAMPLES_LIBCANARD + include $(APPDIR)/Application.mk diff --git a/examples/cctype/Kconfig b/examples/cctype/Kconfig index c827a7bd9..4b3b2bd9d 100644 --- a/examples/cctype/Kconfig +++ b/examples/cctype/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_CCTYPE - bool "Verify C++ cctype operations" + tristate "Verify C++ cctype operations" default n ---help--- Enable the a simple test to verify C++ cctype operations. diff --git a/examples/cctype/Make.defs b/examples/cctype/Make.defs index f9a9977b7..342d2bed8 100644 --- a/examples/cctype/Make.defs +++ b/examples/cctype/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_CCTYPE),y) +ifneq ($(CONFIG_EXAMPLES_CCTYPE),) CONFIGURED_APPS += examples/cctype endif diff --git a/examples/cctype/Makefile b/examples/cctype/Makefile index 746b0a5a1..da103cfd0 100644 --- a/examples/cctype/Makefile +++ b/examples/cctype/Makefile @@ -51,4 +51,6 @@ APPNAME = cctype PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_CCTYPE + include $(APPDIR)/Application.mk diff --git a/examples/chat/Kconfig b/examples/chat/Kconfig index bc5c6cad6..c1c46cdbb 100644 --- a/examples/chat/Kconfig +++ b/examples/chat/Kconfig @@ -4,7 +4,7 @@ # menuconfig EXAMPLES_CHAT - bool "AT modem chat utility" + tristate "AT modem chat utility" default n select NETUTILS_CHAT ---help--- diff --git a/examples/chat/Make.defs b/examples/chat/Make.defs index 1115efbd7..2d6b551f2 100644 --- a/examples/chat/Make.defs +++ b/examples/chat/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_CHAT),y) +ifneq ($(CONFIG_EXAMPLES_CHAT),) CONFIGURED_APPS += examples/chat endif diff --git a/examples/chat/Makefile b/examples/chat/Makefile index 323fe3ace..342aa6937 100644 --- a/examples/chat/Makefile +++ b/examples/chat/Makefile @@ -33,103 +33,17 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs -ASRCS = -CSRCS = MAINSRC = chat_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= chat$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . -VPATH = - APPNAME = chat PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Build targets +MODULE = CONFIG_EXAMPLES_CHAT -all: .built -.PHONY: context .depend depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/configdata/Kconfig b/examples/configdata/Kconfig index ff16a4f89..d9ad53420 100644 --- a/examples/configdata/Kconfig +++ b/examples/configdata/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_CONFIGDATA - bool "Config Data example / unit test" + tristate "Config Data example / unit test" default n ---help--- Enable the Config Data example diff --git a/examples/configdata/Make.defs b/examples/configdata/Make.defs index 40db2d0fc..f7f7b0dff 100644 --- a/examples/configdata/Make.defs +++ b/examples/configdata/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_CONFIGDATA),y) +ifneq ($(CONFIG_EXAMPLES_CONFIGDATA),) CONFIGURED_APPS += examples/configdata endif diff --git a/examples/configdata/Makefile b/examples/configdata/Makefile index a13ae7a6d..a0b85db36 100644 --- a/examples/configdata/Makefile +++ b/examples/configdata/Makefile @@ -48,4 +48,6 @@ MAINSRC = configdata_main.c CONFIG_XYZ_PROGNAME ?= configdata$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_CONFIGDATA + include $(APPDIR)/Application.mk diff --git a/examples/cpuhog/Kconfig b/examples/cpuhog/Kconfig index 47a5b3702..12285c89a 100644 --- a/examples/cpuhog/Kconfig +++ b/examples/cpuhog/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_CPUHOG - bool "CPU hog" + tristate "CPU hog" default n depends on PIPES ---help--- diff --git a/examples/cpuhog/Make.defs b/examples/cpuhog/Make.defs index 6c109cdfe..4a1ecd9c0 100644 --- a/examples/cpuhog/Make.defs +++ b/examples/cpuhog/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_CPUHOG),y) +ifneq ($(CONFIG_EXAMPLES_CPUHOG),) CONFIGURED_APPS += examples/cpuhog endif diff --git a/examples/cpuhog/Makefile b/examples/cpuhog/Makefile index 29f46d3c9..551a91e2b 100644 --- a/examples/cpuhog/Makefile +++ b/examples/cpuhog/Makefile @@ -53,4 +53,6 @@ APPNAME = cpuhog PRIORITY = $(CONFIG_EXAMPLES_CPUHOG_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_CPUHOG_STACKSIZE) +MODULE = CONFIG_EXAMPLES_CPUHOG + include $(APPDIR)/Application.mk diff --git a/examples/cromfs/Make.defs b/examples/cromfs/Make.defs index 6b7e82bd2..1e7fec385 100644 --- a/examples/cromfs/Make.defs +++ b/examples/cromfs/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_CROMFS),y) +ifneq ($(CONFIG_EXAMPLES_CROMFS),) CONFIGURED_APPS += examples/cromfs endif diff --git a/examples/cromfs/Makefile b/examples/cromfs/Makefile index 8b976669e..e4db1c26e 100644 --- a/examples/cromfs/Makefile +++ b/examples/cromfs/Makefile @@ -33,72 +33,27 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # CROMFS Example CSRCS = cromfs.c -COBJS = $(CSRCS:.c=$(OBJEXT)) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif NXTOOLDIR = $(TOPDIR)/tools GENCROMFSSRC = gencromfs.c GENCROMFSEXE = gencromfs$(EXEEXT) -ROOTDEPPATH = --dep-path . # Build targets -VPATH = . - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(COBJS) : %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - $(NXTOOLDIR)$(DELIM)$(GENCROMFSEXE): $(NXTOOLDIR)$(DELIM)$(GENCROMFSSRC) $(Q) $(MAKE) -C $(NXTOOLDIR) -f Makefile.host $(GENCROMFSEXE) cromfs.c: $(NXTOOLDIR)$(DELIM)$(GENCROMFSEXE) $(Q) $(NXTOOLDIR)$(DELIM)$(GENCROMFSEXE) cromfs cromfs.c -.built: cromfs.c $(COBJS) - $(call ARCHIVE, $(BIN), $(COBJS)) - @touch .built +context:: cromfs.c -install: - -context: - -# We can't make dependencies in this directory because the required -# header files may not yet exist. - -.depend: - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +distclean:: $(call DELFILE, cromfs.c) -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/cxxtest/Kconfig b/examples/cxxtest/Kconfig index 6c9c4c51a..51b6b3c54 100644 --- a/examples/cxxtest/Kconfig +++ b/examples/cxxtest/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_CXXTEST - bool "C++ test program" + tristate "C++ test program" default n depends on HAVE_CXX ---help--- diff --git a/examples/cxxtest/Make.defs b/examples/cxxtest/Make.defs index 0058a6cde..bf462df4c 100644 --- a/examples/cxxtest/Make.defs +++ b/examples/cxxtest/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_CXXTEST),y) +ifneq ($(CONFIG_EXAMPLES_CXXTEST),) CONFIGURED_APPS += examples/cxxtest endif diff --git a/examples/cxxtest/Makefile b/examples/cxxtest/Makefile index 0f5638ef0..403d5a434 100644 --- a/examples/cxxtest/Makefile +++ b/examples/cxxtest/Makefile @@ -51,4 +51,6 @@ APPNAME = cxxtest PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 4096 +MODULE = CONFIG_EXAMPLES_CXXTEST + include $(APPDIR)/Application.mk diff --git a/examples/dac/Kconfig b/examples/dac/Kconfig index 02f4ca70a..d4245f568 100644 --- a/examples/dac/Kconfig +++ b/examples/dac/Kconfig @@ -1,5 +1,5 @@ config EXAMPLES_DAC - bool "DAC tool" + tristate "DAC tool" default n depends on DAC ---help--- diff --git a/examples/dac/Make.defs b/examples/dac/Make.defs index 03c506994..006acada3 100644 --- a/examples/dac/Make.defs +++ b/examples/dac/Make.defs @@ -1,3 +1,3 @@ -ifeq ($(CONFIG_EXAMPLES_DAC),y) +ifneq ($(CONFIG_EXAMPLES_DAC),) CONFIGURED_APPS += examples/dac endif diff --git a/examples/dac/Makefile b/examples/dac/Makefile index 90974663c..8553fdb72 100644 --- a/examples/dac/Makefile +++ b/examples/dac/Makefile @@ -50,4 +50,6 @@ APPNAME = dac PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_DAC + include $(APPDIR)/Application.mk diff --git a/examples/dhcpd/Kconfig b/examples/dhcpd/Kconfig index 44dbb30bb..edb98900a 100644 --- a/examples/dhcpd/Kconfig +++ b/examples/dhcpd/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_DHCPD - bool "DHCP server example" + tristate "DHCP server example" default n ---help--- Enable the DHCP server example diff --git a/examples/dhcpd/Make.defs b/examples/dhcpd/Make.defs index 68099f978..1defb5f98 100644 --- a/examples/dhcpd/Make.defs +++ b/examples/dhcpd/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_DHCPD),y) +ifneq ($(CONFIG_EXAMPLES_DHCPD),) CONFIGURED_APPS += examples/dhcpd endif diff --git a/examples/dhcpd/Makefile b/examples/dhcpd/Makefile index f8de0d6bd..377395e7b 100644 --- a/examples/dhcpd/Makefile +++ b/examples/dhcpd/Makefile @@ -50,4 +50,6 @@ APPNAME = dhcpd PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_DHCPD + include $(APPDIR)/Application.mk diff --git a/examples/dhtxx/Makefile b/examples/dhtxx/Makefile index 23df08bd1..ff9d42b45 100644 --- a/examples/dhtxx/Makefile +++ b/examples/dhtxx/Makefile @@ -42,12 +42,8 @@ CONFIG_EXAMPLES_DHTXX_STACKSIZE ?= 2048 APPNAME = dhtxx -ifeq ($(CONFIG_EXAMPLES_DHTXX),m) -LOADABLE = y -else PRIORITY = $(CONFIG_EXAMPLES_DHTXX_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_DHTXX_STACKSIZE) -endif # Dhtxx Example @@ -58,4 +54,6 @@ MAINSRC = dhtxx_main.c CONFIG_EXAMPLES_DHTXX_PROGNAME ?= dhtxx$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_DHTXX_PROGNAME) +MODULE = CONFIG_EXAMPLES_DHTXX + include $(APPDIR)/Application.mk diff --git a/examples/discover/Kconfig b/examples/discover/Kconfig index 3f847d044..a6f44a55a 100644 --- a/examples/discover/Kconfig +++ b/examples/discover/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_DISCOVER - bool "UDP Discovery Example" + tristate "UDP Discovery Example" default n depends on NET_UDP select NETUTILS_DISCOVER diff --git a/examples/discover/Make.defs b/examples/discover/Make.defs index 2e44aa3ad..8cc389207 100644 --- a/examples/discover/Make.defs +++ b/examples/discover/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_DISCOVER),y) +ifneq ($(CONFIG_EXAMPLES_DISCOVER),) CONFIGURED_APPS += examples/discover endif diff --git a/examples/discover/Makefile b/examples/discover/Makefile index 214f03d9f..edd76f55e 100644 --- a/examples/discover/Makefile +++ b/examples/discover/Makefile @@ -51,4 +51,6 @@ MAINSRC = discover_main.c CONFIG_XYZ_PROGNAME ?= discover$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_DISCOVER + include $(APPDIR)/Application.mk diff --git a/examples/djoystick/Kconfig b/examples/djoystick/Kconfig index 0d48230a4..86581a864 100644 --- a/examples/djoystick/Kconfig +++ b/examples/djoystick/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_DJOYSTICK - bool "Discrete joystick example" + tristate "Discrete joystick example" default n depends on DJOYSTICK && !DISABLE_SIGNALS ---help--- diff --git a/examples/djoystick/Make.defs b/examples/djoystick/Make.defs index 77541a183..aa278ab8e 100644 --- a/examples/djoystick/Make.defs +++ b/examples/djoystick/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_DJOYSTICK),y) +ifneq ($(CONFIG_EXAMPLES_DJOYSTICK),) CONFIGURED_APPS += examples/djoystick endif diff --git a/examples/djoystick/Makefile b/examples/djoystick/Makefile index dccb826a7..8fbedaf95 100644 --- a/examples/djoystick/Makefile +++ b/examples/djoystick/Makefile @@ -50,4 +50,6 @@ APPNAME = djoy PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_DJOYSTICK + include $(APPDIR)/Application.mk diff --git a/examples/dsptest/Kconfig b/examples/dsptest/Kconfig index 80698d009..754085bae 100644 --- a/examples/dsptest/Kconfig +++ b/examples/dsptest/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_DSPTEST - bool "LIBDSP library testing" + tristate "LIBDSP library testing" default n ---help--- Enable the LIBDSP library testing diff --git a/examples/dsptest/Make.defs b/examples/dsptest/Make.defs index cc9f862d8..47349d893 100644 --- a/examples/dsptest/Make.defs +++ b/examples/dsptest/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_DSPTEST),y) +ifneq ($(CONFIG_EXAMPLES_DSPTEST),) CONFIGURED_APPS += examples/dsptest endif diff --git a/examples/dsptest/Makefile b/examples/dsptest/Makefile index 557b97427..478f54574 100644 --- a/examples/dsptest/Makefile +++ b/examples/dsptest/Makefile @@ -56,4 +56,6 @@ 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 diff --git a/examples/elf/Make.defs b/examples/elf/Make.defs index ee861812c..3f0027d1b 100644 --- a/examples/elf/Make.defs +++ b/examples/elf/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_ELF),y) +ifneq ($(CONFIG_EXAMPLES_ELF),) CONFIGURED_APPS += examples/elf endif diff --git a/examples/elf/Makefile b/examples/elf/Makefile index 1188219f2..3ae3d4e08 100644 --- a/examples/elf/Makefile +++ b/examples/elf/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # ELF Example @@ -43,99 +41,19 @@ ASRCS = CSRCS = symtab.c MAINSRC = elf_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -CONFIG_XYZ_PROGNAME ?= discover$(EXEEXT) +CONFIG_XYZ_PROGNAME ?= elf$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . --dep-path tests +ROOTDEPPATH := --dep-path tests # Build targets -VPATH = tests +VPATH += :tests -all: .built -.PHONY: really_build clean_tests clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -# This is a little messy. The build is broken into two pieces: (1) the -# tests/ subdir build that auto-generates several files, and (2) the real -# build. This is done because we need a fresh build context after auto- -# generating the source files. - -really_build: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -.built: +context:: @$(MAKE) -C tests TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) - @$(MAKE) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" really_build -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -context: - -# We can't make dependencies in this directory because the required -# header files may not yet exist. - -.depend: - @touch $@ - -depend: .depend - -clean_tests: +clean:: @$(MAKE) -C tests TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) clean -clean: clean_tests - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/fb/Kconfig b/examples/fb/Kconfig index d18f746f2..e73d2ae7e 100644 --- a/examples/fb/Kconfig +++ b/examples/fb/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_FB - bool "Framebuffer driver example" + tristate "Framebuffer driver example" default n select LCD_PACKEDMSFIRST if LCD depends on VIDEO_FB diff --git a/examples/fb/Make.defs b/examples/fb/Make.defs index e6414539c..47add5ae4 100644 --- a/examples/fb/Make.defs +++ b/examples/fb/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_FB),y) +ifneq ($(CONFIG_EXAMPLES_FB),) CONFIGURED_APPS += examples/fb endif diff --git a/examples/fb/Makefile b/examples/fb/Makefile index 5e087c96f..50f870528 100644 --- a/examples/fb/Makefile +++ b/examples/fb/Makefile @@ -53,4 +53,6 @@ MAINSRC = fb_main.c CONFIG_EXAMPLES_FB_PROGNAME ?= fb$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_FB_PROGNAME) +MODULE = CONFIG_EXAMPLES_FB + include $(APPDIR)/Application.mk diff --git a/examples/fboverlay/Kconfig b/examples/fboverlay/Kconfig index f2e94909a..10e6a1293 100644 --- a/examples/fboverlay/Kconfig +++ b/examples/fboverlay/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_FBOVERLAY - bool "Framebuffer overlay test tool" + tristate "Framebuffer overlay test tool" depends on FB_OVERLAY default n ---help--- diff --git a/examples/fboverlay/Make.defs b/examples/fboverlay/Make.defs index 6a765405e..27d55d44b 100644 --- a/examples/fboverlay/Make.defs +++ b/examples/fboverlay/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_FBOVERLAY),y) +ifneq ($(CONFIG_EXAMPLES_FBOVERLAY),) CONFIGURED_APPS += examples/fboverlay endif diff --git a/examples/fboverlay/Makefile b/examples/fboverlay/Makefile index 6ecc1dc12..6bf6bf159 100644 --- a/examples/fboverlay/Makefile +++ b/examples/fboverlay/Makefile @@ -50,4 +50,6 @@ MAINSRC = fboverlay_main.c CONFIG_EXAMPLES_FBOVERLAY_PROGNAME ?= fboverlay$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_FBOVERLAY_PROGNAME) +MODULE = CONFIG_EXAMPLES_FBOVERLAY + include $(APPDIR)/Application.mk diff --git a/examples/flash_test/Kconfig b/examples/flash_test/Kconfig index dcfc6e55d..4dd0a3794 100644 --- a/examples/flash_test/Kconfig +++ b/examples/flash_test/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_FLASH_TEST - bool "SMART FLASH block device test" + tristate "SMART FLASH block device test" default n depends on (!BUILD_PROTECTED && !BUILD_LOADABLE) && MTD_SMART && NSH_BUILTIN_APPS ---help--- diff --git a/examples/flash_test/Make.defs b/examples/flash_test/Make.defs index edc4732d9..ee8348c57 100644 --- a/examples/flash_test/Make.defs +++ b/examples/flash_test/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_FLASH_TEST),y) +ifneq ($(CONFIG_EXAMPLES_FLASH_TEST),) CONFIGURED_APPS += examples/flash_test endif diff --git a/examples/flash_test/Makefile b/examples/flash_test/Makefile index 08ad8dc05..f491afd89 100644 --- a/examples/flash_test/Makefile +++ b/examples/flash_test/Makefile @@ -53,4 +53,6 @@ MAINSRC = flash_test.c CONFIG_XYZ_PROGNAME ?= flash_test$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_FLASH_TEST + include $(APPDIR)/Application.mk diff --git a/examples/flowc/Kconfig b/examples/flowc/Kconfig index a3cbba3be..76200c539 100644 --- a/examples/flowc/Kconfig +++ b/examples/flowc/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_FLOWC - bool "Serial flow control example" + tristate "Serial flow control example" default n depends on SERIAL_TERMIOS ---help--- diff --git a/examples/flowc/Make.defs b/examples/flowc/Make.defs index 51b626fd9..02240f757 100644 --- a/examples/flowc/Make.defs +++ b/examples/flowc/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_FLOWC),y) +ifneq ($(CONFIG_EXAMPLES_FLOWC),) CONFIGURED_APPS += examples/flowc endif diff --git a/examples/flowc/Makefile b/examples/flowc/Makefile index 769eda52f..328f64dd7 100644 --- a/examples/flowc/Makefile +++ b/examples/flowc/Makefile @@ -33,77 +33,58 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # FLOWC Test # Target 1 -TARG1_CRCS = -ifeq ($(CONFIG_!EXAMPLES_FLOWC_SENDER1),y) -TARG1_CRCS += flowc_sender.c +CSRCS = +MAINSRC = +ifeq ($(CONFIG_EXAMPLES_FLOWC_SENDER1),y) +CSRCS += flowc_sender.c else -TARG1_CRCS += flowc_receiver.c +CSRCS += flowc_receiver.c endif -TARG1_MAINSRC = flowc_target1.c +MAINSRC += flowc_target1.c -TARG1_COBJS = $(TARG1_CRCS:.c=$(OBJEXT)) -TARG1_MAINOBJ = $(TARG1_MAINSRC:.c=$(OBJEXT)) - -ifeq ($(CONFIG_!EXAMPLES_FLOWC_SENDER1),y) +ifeq ($(CONFIG_EXAMPLES_FLOWC_SENDER1),y) CONFIG_EXAMPLES_FLOWC_PROGNAME1 ?= sender -APPNAME1 = sender else CONFIG_EXAMPLES_FLOWC_PROGNAME1 ?= receiver -APPNAME1 = receiver endif CONFIG_EXAMPLES_FLOWC_PRIORITY1 ?= 100 CONFIG_EXAMPLES_FLOWC_STACKSIZE1 ?= 2048 -PROGNAME1 = $(CONFIG_EXAMPLES_FLOWC_PROGNAME1) -PRIORITY1 = $(CONFIG_EXAMPLES_FLOWC_PRIORITY1) -STACKSIZE1 = $(CONFIG_EXAMPLES_FLOWC_STACKSIZE1) +PROGNAME = $(CONFIG_EXAMPLES_FLOWC_PROGNAME1) +PRIORITY = $(CONFIG_EXAMPLES_FLOWC_PRIORITY1) +STACKSIZE = $(CONFIG_EXAMPLES_FLOWC_STACKSIZE1) # Target 2 ifeq ($(CONFIG_EXAMPLES_FLOWC_TARGET2),y) -TARG2_CSRCS = -ifeq ($(CONFIG_!EXAMPLES_FLOWC_SENDER1),y) -TARG2_CSRCS += flowc_receiver.c +ifeq ($(CONFIG_EXAMPLES_FLOWC_SENDER1),y) +CSRCS += flowc_receiver.c else -TARG2_CSRCS += flowc_sender.c +CSRCS += flowc_sender.c endif -TARG2_MAINSRC = flowc_target2.c +MAINSRC += flowc_target2.c -TARG2_COBJS = $(TARG2_CSRCS:.c=$(OBJEXT)) -TARG2_MAINOBJ = $(TARG2_MAINSRC:.c=$(OBJEXT)) - -ifeq ($(CONFIG_!EXAMPLES_FLOWC_SENDER1),y) +ifeq ($(CONFIG_EXAMPLES_FLOWC_SENDER1),y) CONFIG_EXAMPLES_FLOWC_PROGNAME2 ?= receiver -APPNAME2 = receiver else CONFIG_EXAMPLES_FLOWC_PROGNAME2 ?= sender -APPNAME2 = sender endif CONFIG_EXAMPLES_FLOWC_PRIORITY2 ?= 100 CONFIG_EXAMPLES_FLOWC_STACKSIZE2 ?= 2048 -PROGNAME2 = $(CONFIG_EXAMPLES_FLOWC_PROGNAME2) -PRIORITY2 = $(CONFIG_EXAMPLES_FLOWC_PRIORITY2) -STACKSIZE2 = $(CONFIG_EXAMPLES_FLOWC_STACKSIZE2) +PROGNAME += $(CONFIG_EXAMPLES_FLOWC_PROGNAME2) +PRIORITY += $(CONFIG_EXAMPLES_FLOWC_PRIORITY2) +STACKSIZE += $(CONFIG_EXAMPLES_FLOWC_STACKSIZE2) endif -TARG_SRCS = $(TARG1_CRCS) $(TARG1_MAINSRC) $(TARG2_CSRCS) $(TARG2_MAINSRC) -TARG_OBJS = $(TARG1_COBJS) $(TARG2_COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - TARG_OBJS += $(TARG1_MAINOBJ) $(TARG2_MAINOBJ) -endif - # Host ifneq ($(CONFIG_EXAMPLES_FLOWC_TARGET2),y) @@ -112,7 +93,7 @@ HOSTCFLAGS += -DEXAMPLES_FLOWC_HOST=1 HOSTOBJSEXT ?= hobj HOST_SRCS = flowc_host.c -ifeq ($(CONFIG_!EXAMPLES_FLOWC_SENDER1),y) +ifeq ($(CONFIG_EXAMPLES_FLOWC_SENDER1),y) HOST_SRCS += flowc_receiver.c HOST_BIN = receiver$(EXEEXT) else @@ -123,45 +104,12 @@ endif HOST_OBJS = $(HOST_SRCS:.c=.$(HOSTOBJSEXT)) endif -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - TARG_BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - TARG_BIN = ..\\..\\libapps$(LIBEXT) -else - TARG_BIN = ../../libapps$(LIBEXT) -endif -endif - ifeq ($(CONFIG_EXAMPLES_FLOWC_TARGET2),y) -MAINNAME1 = flowc1_main -MAINNAME2 = flowc2_main +APPNAME = flowc1 flowc2 else -MAINNAME1 = flowc_main +APPNAME = flowc endif -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(TARG1_COBJS) $(TARG1_MAINOBJ) $(TARG2_COBJS) $(TARG2_MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -$(TARG_BIN): $(TARG_OBJS) $(HOST_BIN) - $(call ARCHIVE, $@, $(TARG_OBJS)) - ifneq ($(CONFIG_EXAMPLES_FLOWC_TARGET2),y) $(HOST_OBJS): %.$(HOSTOBJSEXT): %.c @echo "CC: $<" @@ -177,59 +125,16 @@ $(HOST_BIN): config.h $(HOST_OBJS) $(Q) $(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS) -o $@ endif -.built: config.h $(TARG_BIN) $(HOST_BIN) - $(Q) touch .built +context:: config.h $(HOST_BIN) -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME1): $(OBJS) $(TARG1_MAINOBJ) - @echo "LD: $(PROGNAME1)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME1) $(ARCHCRT0OBJ) $(TARG1_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME1) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME1) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(if $(CONFIG_BUILD_LOADABLE),,$(MAINNAME1))) - -ifeq ($(CONFIG_EXAMPLES_FLOWC_TARGET2),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME2),$(PRIORITY2),$(STACKSIZE2),$(if $(CONFIG_BUILD_LOADABLE),,$(MAINNAME2))) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat \ - $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat -else -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat -endif -else -context: -endif - -.depend: Makefile config.h $(TARG_SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(TARG_SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) +clean:: ifneq ($(CONFIG_EXAMPLES_FLOWC_TARGET2),y) $(call DELFILE, $(HOST_BIN)) $(call DELFILE, *.$(HOSTOBJSEXT)) endif $(call DELFILE, *.dSYM) $(call DELFILE, config.h) - $(call CLEAN) -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +MODULE = CONFIG_EXAMPLES_FLOWC -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/flowc/flowc_target1.c b/examples/flowc/flowc_target1.c index f9b72b9a4..52f97f62d 100644 --- a/examples/flowc/flowc_target1.c +++ b/examples/flowc/flowc_target1.c @@ -48,7 +48,7 @@ * flowc1_main ****************************************************************************/ -#if defined(CONFIG_BUILD_LOADABLE) +#if defined(BUILD_MODULE) int main(int argc, FAR char *argv[]) #elif defined(CONFIG_EXAMPLES_FLOWC_TARGET2) int flowc1_main(int argc, char *argv[]) diff --git a/examples/flowc/flowc_target2.c b/examples/flowc/flowc_target2.c index 97ac8e492..17372c072 100644 --- a/examples/flowc/flowc_target2.c +++ b/examples/flowc/flowc_target2.c @@ -48,7 +48,7 @@ * flowc2_main ****************************************************************************/ -#if defined(CONFIG_BUILD_LOADABLE) +#if defined(BUILD_MODULE) int main(int argc, FAR char *argv[]) #else int flowc2_main(int argc, char *argv[]) diff --git a/examples/fstest/Kconfig b/examples/fstest/Kconfig index ee4708131..762434289 100644 --- a/examples/fstest/Kconfig +++ b/examples/fstest/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_FSTEST - bool "Generic file system test" + tristate "Generic file system test" default n depends on FS_READABLE && FS_WRITABLE ---help--- diff --git a/examples/fstest/Make.defs b/examples/fstest/Make.defs index e935a6b4a..7d3578557 100644 --- a/examples/fstest/Make.defs +++ b/examples/fstest/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_FSTEST),y) +ifneq ($(CONFIG_EXAMPLES_FSTEST),) CONFIGURED_APPS += examples/fstest endif diff --git a/examples/fstest/Makefile b/examples/fstest/Makefile index b95ec2e03..75e57221e 100644 --- a/examples/fstest/Makefile +++ b/examples/fstest/Makefile @@ -50,4 +50,6 @@ MAINSRC = fstest_main.c CONFIG_XYZ_PROGNAME ?= fstest$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_FSTEST + include $(APPDIR)/Application.mk diff --git a/examples/ft80x/Kconfig b/examples/ft80x/Kconfig index 6604dfd2f..641cc098e 100644 --- a/examples/ft80x/Kconfig +++ b/examples/ft80x/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_FT80X - bool "FT80x example" + tristate "FT80x example" default n depends on LCD_FT80X select GRAPHICS_FT80X diff --git a/examples/ft80x/Make.defs b/examples/ft80x/Make.defs index a353f9ccb..638ee3e18 100644 --- a/examples/ft80x/Make.defs +++ b/examples/ft80x/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_FT80X),y) +ifneq ($(CONFIG_EXAMPLES_FT80X),) CONFIGURED_APPS += examples/ft80x endif diff --git a/examples/ft80x/Makefile b/examples/ft80x/Makefile index f9a38f357..7a47057cf 100644 --- a/examples/ft80x/Makefile +++ b/examples/ft80x/Makefile @@ -62,4 +62,6 @@ MAINSRC = ft80x_main.c CONFIG_EXAMPLES_FT80X_PROGNAME ?= ft80x$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_FT80X_PROGNAME) +MODULE = CONFIG_EXAMPLES_FT80X + include $(APPDIR)/Application.mk diff --git a/examples/ftpc/Kconfig b/examples/ftpc/Kconfig index 2c3b53faa..788efadd2 100644 --- a/examples/ftpc/Kconfig +++ b/examples/ftpc/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_FTPC - bool "FTP client example" + tristate "FTP client example" default n ---help--- Enable the FTP client example diff --git a/examples/ftpc/Make.defs b/examples/ftpc/Make.defs index 874e3e05c..f0769e497 100644 --- a/examples/ftpc/Make.defs +++ b/examples/ftpc/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_FTPC),y) +ifneq ($(CONFIG_EXAMPLES_FTPC),) CONFIGURED_APPS += examples/ftpc endif diff --git a/examples/ftpc/Makefile b/examples/ftpc/Makefile index 683bcaf1f..824af66e0 100644 --- a/examples/ftpc/Makefile +++ b/examples/ftpc/Makefile @@ -50,4 +50,6 @@ MAINSRC = ftpc_main.c CONFIG_XYZ_PROGNAME ?= ftpc$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_FTPC + include $(APPDIR)/Application.mk diff --git a/examples/ftpd/Kconfig b/examples/ftpd/Kconfig index 77bfdd07a..b3637398c 100644 --- a/examples/ftpd/Kconfig +++ b/examples/ftpd/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_FTPD - bool "FTP server example" + tristate "FTP server example" default n ---help--- Enable the FTP server example diff --git a/examples/ftpd/Make.defs b/examples/ftpd/Make.defs index 02b4927dd..57a9367ee 100644 --- a/examples/ftpd/Make.defs +++ b/examples/ftpd/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_FTPD),y) +ifneq ($(CONFIG_EXAMPLES_FTPD),) CONFIGURED_APPS += examples/ftpd endif diff --git a/examples/ftpd/Makefile b/examples/ftpd/Makefile index c4605a380..d220a4a64 100644 --- a/examples/ftpd/Makefile +++ b/examples/ftpd/Makefile @@ -33,106 +33,19 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs -CONFIG_EXAMPLES_FTPD_STACKSIZE ?= 2048 - -ASRCS = -CSRCS = MAINSRC = ftpd_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif +CONFIG_EXAMPLES_FTPD_STACKSIZE ?= 2048 +STACKSIZE = $(CONFIG_EXAMPLES_FTPD_STACKSIZE) +PRIORITY = SCHED_PRIORITY_DEFAULT CONFIG_XYZ_PROGNAME ?= ftpd$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +APPNAME = ftpd_start ftpd_stop -# Common build +MODULE = CONFIG_EXAMPLES_FTPD -VPATH = - -all: .built - -.PHONY: context clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)ftpd_start.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,ftpd_start,SCHED_PRIORITY_DEFAULT,$(CONFIG_EXAMPLES_FTPD_STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,ftpd_main)) - -$(BUILTIN_REGISTRY)$(DELIM)ftpd_stop.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,ftpd_stop,SCHED_PRIORITY_DEFAULT,$(CONFIG_EXAMPLES_FTPD_STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,ftpd_stop)) - -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 - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/ftpd/ftpd_main.c b/examples/ftpd/ftpd_main.c index 59c953670..52c1d9b61 100644 --- a/examples/ftpd/ftpd_main.c +++ b/examples/ftpd/ftpd_main.c @@ -250,7 +250,7 @@ int ftpd_daemon(int s_argc, char **s_argv) #ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else -int ftpd_main(int s_argc, char **s_argv) +int ftpd_start_main(int s_argc, char **s_argv) #endif { /* Check if we have already initialized the network */ @@ -308,7 +308,7 @@ int ftpd_main(int s_argc, char **s_argv) ****************************************************************************/ #ifdef CONFIG_NSH_BUILTIN_APPS -int ftpd_stop(int s_argc, char **s_argv) +int ftpd_stop_main(int s_argc, char **s_argv) { if (!g_ftpdglob.initialized || !g_ftpdglob.running) { diff --git a/examples/gpio/Kconfig b/examples/gpio/Kconfig index d5fffdcad..c54eca853 100644 --- a/examples/gpio/Kconfig +++ b/examples/gpio/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_GPIO - bool "GPIO driver example" + tristate "GPIO driver example" default n depends on DEV_GPIO ---help--- diff --git a/examples/gpio/Make.defs b/examples/gpio/Make.defs index 78c636d9e..23a26417c 100644 --- a/examples/gpio/Make.defs +++ b/examples/gpio/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_GPIO),y) +ifneq ($(CONFIG_EXAMPLES_GPIO),) CONFIGURED_APPS += examples/gpio endif diff --git a/examples/gpio/Makefile b/examples/gpio/Makefile index ba5696100..1cc035ee8 100644 --- a/examples/gpio/Makefile +++ b/examples/gpio/Makefile @@ -53,4 +53,6 @@ MAINSRC = gpio_main.c CONFIG_EXAMPLES_GPIO_PROGNAME ?= gpio$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_GPIO_PROGNAME) +MODULE = CONFIG_EXAMPLES_GPIO + include $(APPDIR)/Application.mk diff --git a/examples/gps/Kconfig b/examples/gps/Kconfig index 5b2bd1ea6..04f95b153 100644 --- a/examples/gps/Kconfig +++ b/examples/gps/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_GPS - bool "GPS example" + tristate "GPS example" default n select GPSUTILS_MINMEA_LIB ---help--- diff --git a/examples/gps/Make.defs b/examples/gps/Make.defs index f78a1cc42..2053cb884 100644 --- a/examples/gps/Make.defs +++ b/examples/gps/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_GPS),y) +ifneq ($(CONFIG_EXAMPLES_GPS),) CONFIGURED_APPS += examples/gps endif diff --git a/examples/gps/Makefile b/examples/gps/Makefile index a405f1128..fdb4292c5 100644 --- a/examples/gps/Makefile +++ b/examples/gps/Makefile @@ -53,5 +53,7 @@ MAINSRC = gps_main.c CONFIG_EXAMPLES_GPS_PROGNAME ?= gps$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_GPS_PROGNAME) +MODULE = CONFIG_EXAMPLES_GPS + include $(APPDIR)/Application.mk diff --git a/examples/hello/Makefile b/examples/hello/Makefile index dfea65be2..14db580b5 100644 --- a/examples/hello/Makefile +++ b/examples/hello/Makefile @@ -54,6 +54,6 @@ MAINSRC = hello_main.c CONFIG_EXAMPLES_HELLO_PROGNAME ?= hello$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_HELLO_PROGNAME) -MODULE = EXAMPLES_HELLO +MODULE = CONFIG_EXAMPLES_HELLO include $(APPDIR)/Application.mk diff --git a/examples/hello/hello_main.c b/examples/hello/hello_main.c index a33d3bde7..ec61f848f 100644 --- a/examples/hello/hello_main.c +++ b/examples/hello/hello_main.c @@ -48,7 +48,7 @@ * hello_main ****************************************************************************/ -#if defined (CONFIG_BUILD_LOADABLE) +#if defined(BUILD_MODULE) int main(int argc, FAR char *argv[]) #else int hello_main(int argc, char *argv[]) diff --git a/examples/helloxx/Makefile b/examples/helloxx/Makefile index 3ed55754a..59205756b 100644 --- a/examples/helloxx/Makefile +++ b/examples/helloxx/Makefile @@ -52,6 +52,6 @@ APPNAME = helloxx PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -MODULE = EXAMPLES_HELLOXX +MODULE = CONFIG_EXAMPLES_HELLOXX include $(APPDIR)/Application.mk diff --git a/examples/helloxx/helloxx_main.cxx b/examples/helloxx/helloxx_main.cxx index e8754804e..4be4bf6b8 100644 --- a/examples/helloxx/helloxx_main.cxx +++ b/examples/helloxx/helloxx_main.cxx @@ -127,7 +127,7 @@ static CHelloWorld g_HelloWorld; extern "C" { -#if defined (CONFIG_BUILD_LOADABLE) +#if defined (BUILD_MODULE) int main(int argc, FAR char *argv[]) #else int helloxx_main(int argc, char *argv[]) diff --git a/examples/hidkbd/Kconfig b/examples/hidkbd/Kconfig index d8a267c41..f2d7b16d9 100644 --- a/examples/hidkbd/Kconfig +++ b/examples/hidkbd/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_HIDKBD - bool "USB HID keyboard example" + tristate "USB HID keyboard example" default n ---help--- Enable the USB HID keyboard example diff --git a/examples/hidkbd/Make.defs b/examples/hidkbd/Make.defs index 8ada839b6..4c87e4791 100644 --- a/examples/hidkbd/Make.defs +++ b/examples/hidkbd/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_HIDKBD),y) +ifneq ($(CONFIG_EXAMPLES_HIDKBD),) CONFIGURED_APPS += examples/hidkbd endif diff --git a/examples/hidkbd/Makefile b/examples/hidkbd/Makefile index d49ee2aff..c8fa11f07 100644 --- a/examples/hidkbd/Makefile +++ b/examples/hidkbd/Makefile @@ -53,4 +53,6 @@ MAINSRC = hidkbd_main.c CONFIG_EXAMPLES_HIDKBD_PROGNAME ?= hidkbd$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_HIDKBD_PROGNAME) +MODULE = CONFIG_EXAMPLES_HIDKBD + include $(APPDIR)/Application.mk diff --git a/examples/i2schar/Kconfig b/examples/i2schar/Kconfig index 157218708..f36a21c68 100644 --- a/examples/i2schar/Kconfig +++ b/examples/i2schar/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_I2SCHAR - bool "I2S character driver test" + tristate "I2S character driver test" default n depends on I2S && AUDIO && DRIVERS_AUDIO && AUDIO_I2SCHAR ---help--- diff --git a/examples/i2schar/Make.defs b/examples/i2schar/Make.defs index 050df59e0..503c1eeb5 100644 --- a/examples/i2schar/Make.defs +++ b/examples/i2schar/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_I2SCHAR),y) +ifneq ($(CONFIG_EXAMPLES_I2SCHAR),) CONFIGURED_APPS += examples/i2schar endif diff --git a/examples/i2schar/Makefile b/examples/i2schar/Makefile index 91230f749..3e3b81e26 100644 --- a/examples/i2schar/Makefile +++ b/examples/i2schar/Makefile @@ -56,4 +56,6 @@ APPNAME = i2schar PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_I2SCHAR + include $(APPDIR)/Application.mk diff --git a/examples/i2sloop/Kconfig b/examples/i2sloop/Kconfig index 63a504222..cea8333cd 100644 --- a/examples/i2sloop/Kconfig +++ b/examples/i2sloop/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_I2SLOOP - bool "I2S loopback test" + tristate "I2S loopback test" default n depends on I2S && AUDIO && DRIVERS_AUDIO && AUDIO_I2SCHAR ---help--- diff --git a/examples/i2sloop/Make.defs b/examples/i2sloop/Make.defs index d26f84da2..a76eba239 100644 --- a/examples/i2sloop/Make.defs +++ b/examples/i2sloop/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_I2SLOOP),y) +ifneq ($(CONFIG_EXAMPLES_I2SLOOP),) CONFIGURED_APPS += examples/i2sloop endif diff --git a/examples/i2sloop/Makefile b/examples/i2sloop/Makefile index e2085a6a6..0c68da170 100644 --- a/examples/i2sloop/Makefile +++ b/examples/i2sloop/Makefile @@ -50,4 +50,6 @@ APPNAME = i2sloop PRIORITY = 140 STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_I2SLOOP + include $(APPDIR)/Application.mk diff --git a/examples/igmp/Kconfig b/examples/igmp/Kconfig index f0c18ebf6..be8e95642 100644 --- a/examples/igmp/Kconfig +++ b/examples/igmp/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_IGMP - bool "IGMP example" + tristate "IGMP example" default n ---help--- Enable the IGMP example diff --git a/examples/igmp/Make.defs b/examples/igmp/Make.defs index f4d8a3533..2b4e45b14 100644 --- a/examples/igmp/Make.defs +++ b/examples/igmp/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_IGMP),y) +ifneq ($(CONFIG_EXAMPLES_IGMP),) CONFIGURED_APPS += examples/igmp endif diff --git a/examples/igmp/Makefile b/examples/igmp/Makefile index 9a94d11db..b7a10a7d5 100644 --- a/examples/igmp/Makefile +++ b/examples/igmp/Makefile @@ -48,4 +48,6 @@ MAINSRC = igmp.c CONFIG_XYZ_PROGNAME ?= igmp$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_IGMP + include $(APPDIR)/Application.mk diff --git a/examples/ina219/Kconfig b/examples/ina219/Kconfig index 17ac70361..69c9103f6 100644 --- a/examples/ina219/Kconfig +++ b/examples/ina219/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_INA219 - bool "INA219 example" + tristate "INA219 example" default n ---help--- Enable the INA219 example diff --git a/examples/ina219/Make.defs b/examples/ina219/Make.defs index b48e9af79..eab7ece81 100644 --- a/examples/ina219/Make.defs +++ b/examples/ina219/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_INA219),y) +ifneq ($(CONFIG_EXAMPLES_INA219),) CONFIGURED_APPS += examples/ina219 endif diff --git a/examples/ina219/Makefile b/examples/ina219/Makefile index 37c151a26..7b361d560 100644 --- a/examples/ina219/Makefile +++ b/examples/ina219/Makefile @@ -55,4 +55,6 @@ MAINSRC = ina219_main.c CONFIG_EXAMPLES_INA219_PROGNAME ?= ina219$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_INA219_PROGNAME) +MODULE = CONFIG_EXAMPLES_INA219 + include $(APPDIR)/Application.mk diff --git a/examples/ipforward/Kconfig b/examples/ipforward/Kconfig index aa9ec6ae0..cfb31bcc5 100644 --- a/examples/ipforward/Kconfig +++ b/examples/ipforward/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_IPFORWARD - bool "IP forwarding example" + tristate "IP forwarding example" default n depends on NET_TUN && (NET_TCP || NET_ICMPv6) ---help--- diff --git a/examples/ipforward/Make.defs b/examples/ipforward/Make.defs index 3cfe21de0..b522a2115 100644 --- a/examples/ipforward/Make.defs +++ b/examples/ipforward/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_IPFORWARD),y) +ifneq ($(CONFIG_EXAMPLES_IPFORWARD),) CONFIGURED_APPS += examples/ipforward endif diff --git a/examples/ipforward/Makefile b/examples/ipforward/Makefile index f2450ddba..920b0384d 100644 --- a/examples/ipforward/Makefile +++ b/examples/ipforward/Makefile @@ -53,4 +53,6 @@ MAINSRC = ipforward.c CONFIG_EXAMPLES_IPFORWARD_PROGNAME ?= ipfwd$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_IPFORWARD_PROGNAME) +MODULE = CONFIG_EXAMPLES_IPFORWARD + include $(APPDIR)/Application.mk diff --git a/examples/json/Kconfig b/examples/json/Kconfig index 7158ca1f7..bf90ec4c0 100644 --- a/examples/json/Kconfig +++ b/examples/json/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_JSON - bool "JSON example" + tristate "JSON example" default n select NETUTILS_JSON ---help--- diff --git a/examples/json/Make.defs b/examples/json/Make.defs index 8bed99a21..962f48b8c 100644 --- a/examples/json/Make.defs +++ b/examples/json/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_JSON),y) +ifneq ($(CONFIG_EXAMPLES_JSON),) CONFIGURED_APPS += examples/json endif diff --git a/examples/json/Makefile b/examples/json/Makefile index c89c7d5c3..b9812766d 100644 --- a/examples/json/Makefile +++ b/examples/json/Makefile @@ -48,4 +48,6 @@ MAINSRC = json_main.c CONFIG_XYZ_PROGNAME ?= json$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_JSON + include $(APPDIR)/Application.mk diff --git a/examples/leds/Kconfig b/examples/leds/Kconfig index 56627ab3d..eaab8981b 100644 --- a/examples/leds/Kconfig +++ b/examples/leds/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_LEDS - bool "LED driver example" + tristate "LED driver example" default n depends on ARCH_HAVE_LEDS && !ARCH_LEDS ---help--- diff --git a/examples/leds/Make.defs b/examples/leds/Make.defs index 0b212a762..f1f1e3025 100644 --- a/examples/leds/Make.defs +++ b/examples/leds/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_LEDS),y) +ifneq ($(CONFIG_EXAMPLES_LEDS),) CONFIGURED_APPS += examples/leds endif diff --git a/examples/leds/Makefile b/examples/leds/Makefile index dffa79c96..9cf458d46 100644 --- a/examples/leds/Makefile +++ b/examples/leds/Makefile @@ -53,4 +53,6 @@ MAINSRC = leds_main.c CONFIG_EXAMPLES_LEDS_PROGNAME ?= leds$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_LEDS_PROGNAME) +MODULE = CONFIG_EXAMPLES_LEDS + include $(APPDIR)/Application.mk diff --git a/examples/lis3dsh_reader/Kconfig b/examples/lis3dsh_reader/Kconfig index 8ebb11cc1..af1596366 100755 --- a/examples/lis3dsh_reader/Kconfig +++ b/examples/lis3dsh_reader/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_LIS3DSH_READER - bool "LIS3DSH acceleration reader example" + tristate "LIS3DSH acceleration reader example" default n depends on LIS3DSH depends on SPI_EXCHANGE diff --git a/examples/lis3dsh_reader/Make.defs b/examples/lis3dsh_reader/Make.defs index da3f3bd7a..cc2565bb2 100755 --- a/examples/lis3dsh_reader/Make.defs +++ b/examples/lis3dsh_reader/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_LIS3DSH_READER),y) +ifneq ($(CONFIG_EXAMPLES_LIS3DSH_READER),) CONFIGURED_APPS += examples/lis3dsh_reader endif diff --git a/examples/lis3dsh_reader/Makefile b/examples/lis3dsh_reader/Makefile index d227c97e8..4fd493434 100755 --- a/examples/lis3dsh_reader/Makefile +++ b/examples/lis3dsh_reader/Makefile @@ -48,4 +48,6 @@ MAINSRC = lis3dsh_reader_main.c CONFIG_FLOX_IMUTEST_PROGNAME ?= lis3dsh_reader$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_LIS3DSH_READER_PROGNAME) +MODULE = CONFIG_EXAMPLES_LIS3DSH_READER + include $(APPDIR)/Application.mk diff --git a/examples/lsm330spi_test/Kconfig b/examples/lsm330spi_test/Kconfig index 905f16753..8882104f4 100644 --- a/examples/lsm330spi_test/Kconfig +++ b/examples/lsm330spi_test/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_LSM330SPI_TEST - bool "LSM330 SPI test program" + tristate "LSM330 SPI test program" default n ---help--- Enable the LSM330 sensor SPI test program. diff --git a/examples/lsm330spi_test/Make.defs b/examples/lsm330spi_test/Make.defs index e80192972..65a8be7db 100644 --- a/examples/lsm330spi_test/Make.defs +++ b/examples/lsm330spi_test/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_LSM330SPI_TEST),y) +ifneq ($(CONFIG_EXAMPLES_LSM330SPI_TEST),) CONFIGURED_APPS += examples/lsm330spi_test endif diff --git a/examples/lsm330spi_test/Makefile b/examples/lsm330spi_test/Makefile index 78c0eda3f..f73e3ff98 100644 --- a/examples/lsm330spi_test/Makefile +++ b/examples/lsm330spi_test/Makefile @@ -51,4 +51,6 @@ MAINSRC = lsm330spi_test_main.c CONFIG_EXAMPLES_LSM330SPI_TEST_PROGNAME ?= lsm330spi_test$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_LSM330SPI_TEST_PROGNAME) +MODULE = CONFIG_EXAMPLES_LSM330SPI_TEST + include $(APPDIR)/Application.mk diff --git a/examples/lvgldemo/Kconfig b/examples/lvgldemo/Kconfig index 94c63299a..27f97791b 100644 --- a/examples/lvgldemo/Kconfig +++ b/examples/lvgldemo/Kconfig @@ -4,7 +4,7 @@ # menuconfig EXAMPLES_LVGLDEMO - bool "Littlev Graphics Library Demo" + tristate "Littlev Graphics Library Demo" default n ---help--- Enable build the Littlev Graphics Library Demo programs diff --git a/examples/lvgldemo/Make.defs b/examples/lvgldemo/Make.defs index 6d51a63d0..cb520d63f 100644 --- a/examples/lvgldemo/Make.defs +++ b/examples/lvgldemo/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_LVGLDEMO),y) +ifneq ($(CONFIG_EXAMPLES_LVGLDEMO),) CONFIGURED_APPS += examples/lvgldemo endif diff --git a/examples/lvgldemo/Makefile b/examples/lvgldemo/Makefile index d3b2efe3e..c72c60fc2 100644 --- a/examples/lvgldemo/Makefile +++ b/examples/lvgldemo/Makefile @@ -57,4 +57,6 @@ LVGLDIR=$(APPDIR)/graphics/littlevgl/lvgl CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(LVGLDIR)"} CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(LVGLDIR)"} +MODULE = CONFIG_EXAMPLES_LVGLDEMO + include $(APPDIR)/Application.mk diff --git a/examples/max31855/Kconfig b/examples/max31855/Kconfig index da2c7e327..cd062efd2 100644 --- a/examples/max31855/Kconfig +++ b/examples/max31855/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_MAX31855 - bool "\"max31855\" example" + tristate "\"max31855\" example" default n ---help--- Enable the \"max31855, World!\" example diff --git a/examples/max31855/Make.defs b/examples/max31855/Make.defs index ac3039b16..cb6eb1ad7 100644 --- a/examples/max31855/Make.defs +++ b/examples/max31855/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_MAX31855),y) +ifneq ($(CONFIG_EXAMPLES_MAX31855),) CONFIGURED_APPS += examples/max31855 endif diff --git a/examples/max31855/Makefile b/examples/max31855/Makefile index 16b86f4ce..f216db3e2 100644 --- a/examples/max31855/Makefile +++ b/examples/max31855/Makefile @@ -53,4 +53,6 @@ MAINSRC = max31855_main.c CONFIG_EXAMPLES_MAX31855_PROGNAME ?= max31855$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_MAX31855_PROGNAME) +MODULE = CONFIG_EXAMPLES_MAX31855 + include $(APPDIR)/Application.mk diff --git a/examples/media/Kconfig b/examples/media/Kconfig index ef0ded5d7..c453f5267 100644 --- a/examples/media/Kconfig +++ b/examples/media/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_MEDIA - bool "Media test" + tristate "Media test" default n ---help--- Enable the media test. This test simply writes values onto the diff --git a/examples/media/Make.defs b/examples/media/Make.defs index 53111aed5..596367862 100644 --- a/examples/media/Make.defs +++ b/examples/media/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_MEDIA),y) +ifneq ($(CONFIG_EXAMPLES_MEDIA),) CONFIGURED_APPS += examples/media endif diff --git a/examples/media/Makefile b/examples/media/Makefile index 098494629..c6339ee53 100644 --- a/examples/media/Makefile +++ b/examples/media/Makefile @@ -50,4 +50,6 @@ MAINSRC = media_main.c CONFIG_EXAMPLES_MEDIA_PROGNAME ?= media$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_MEDIA_PROGNAME) +MODULE = CONFIG_EXAMPLES_MEDIA + include $(APPDIR)/Application.mk diff --git a/examples/mm/Kconfig b/examples/mm/Kconfig index 4ed2d9005..6dfe87cb7 100644 --- a/examples/mm/Kconfig +++ b/examples/mm/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_MM - bool "Memory management example" + tristate "Memory management example" default n ---help--- Enable the memory management example diff --git a/examples/mm/Make.defs b/examples/mm/Make.defs index f2cbe1e4d..806e2bf4b 100644 --- a/examples/mm/Make.defs +++ b/examples/mm/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_MM),y) +ifneq ($(CONFIG_EXAMPLES_MM),) CONFIGURED_APPS += examples/mm endif diff --git a/examples/mm/Makefile b/examples/mm/Makefile index a74edc7a2..aade9977c 100644 --- a/examples/mm/Makefile +++ b/examples/mm/Makefile @@ -51,4 +51,6 @@ MAINSRC = mm_main.c CONFIG_EXAMPLES_MM_PROGNAME ?= mm$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_MM_PROGNAME) +MODULE = CONFIG_EXAMPLES_MM + include $(APPDIR)/Application.mk diff --git a/examples/modbus/Make.defs b/examples/modbus/Make.defs index 4adfbf7e6..9ac536e1f 100644 --- a/examples/modbus/Make.defs +++ b/examples/modbus/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_MODBUS),y) +ifneq ($(CONFIG_EXAMPLES_MODBUS),) CONFIGURED_APPS += examples/modbus endif diff --git a/examples/module/Kconfig b/examples/module/Kconfig index 3dc7e272d..59c01a2de 100644 --- a/examples/module/Kconfig +++ b/examples/module/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_MODULE - bool "Module Example" + tristate "Module Example" default n depends on MODULE && LIB_BOARDCTL select BOARDCTL_OS_SYMTAB diff --git a/examples/module/Make.defs b/examples/module/Make.defs index 0a012432d..20b6c820c 100644 --- a/examples/module/Make.defs +++ b/examples/module/Make.defs @@ -33,6 +33,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_MODULE),y) +ifneq ($(CONFIG_EXAMPLES_MODULE),) CONFIGURED_APPS += examples/module endif diff --git a/examples/module/Makefile b/examples/module/Makefile index 944a14dde..ba6af9157 100644 --- a/examples/module/Makefile +++ b/examples/module/Makefile @@ -33,14 +33,8 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -OBJEXT ?= .o -DELIM ?= / - -include $(APPDIR)/Make.defs - # Module example built-in application info APPNAME = module @@ -49,114 +43,26 @@ STACKSIZE = 2048 # Module Example -ASRCS = -CSRCS = MAINSRC = module_main.c ifeq ($(CONFIG_BUILD_FLAT),y) CSRCS += mod_symtab.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -CONFIG_XYZ_PROGNAME ?= discover$(EXEEXT) +CONFIG_XYZ_PROGNAME ?= module$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . --dep-path drivers +VPATH += drivers +ROOTDEPPATH += --dep-path drivers # Build targets -VPATH = drivers - -all: .built -.PHONY: really_build clean_drivers clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -# This is a little messy. The build is broken into two pieces: (1) the -# drivers/ subdir build that auto-generates several files, and (2) the real -# build. This is done because we need a fresh build context after auto- -# generating the source files. - -really_build: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -.built: +context:: @$(MAKE) -C drivers TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) - @$(MAKE) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" really_build -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# We can't make dependencies in this directory because the required -# header files may not yet exist. - -.depend: - @touch $@ - -depend: .depend - -clean_drivers: +clean:: @$(MAKE) -C drivers TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) clean -clean: clean_drivers - $(call DELFILE, .built) - $(call CLEAN) +MODULE = CONFIG_EXAMPLES_MODULE -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/mount/Kconfig b/examples/mount/Kconfig index b24195434..97406b843 100644 --- a/examples/mount/Kconfig +++ b/examples/mount/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_MOUNT - bool "File system mount example" + tristate "File system mount example" default n ---help--- Enable the file system mount example diff --git a/examples/mount/Make.defs b/examples/mount/Make.defs index b012856ee..b270cbc2e 100644 --- a/examples/mount/Make.defs +++ b/examples/mount/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_MOUNT),y) +ifneq ($(CONFIG_EXAMPLES_MOUNT),) CONFIGURED_APPS += examples/mount endif diff --git a/examples/mount/Makefile b/examples/mount/Makefile index 900dae568..34db50a99 100644 --- a/examples/mount/Makefile +++ b/examples/mount/Makefile @@ -46,4 +46,6 @@ MAINSRC = mount_main.c CONFIG_XYZ_PROGNAME ?= mount$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_MOUNT + include $(APPDIR)/Application.mk diff --git a/examples/mtdpart/Kconfig b/examples/mtdpart/Kconfig index 893c53677..b996e14d9 100644 --- a/examples/mtdpart/Kconfig +++ b/examples/mtdpart/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_MTDPART - bool "MTD partition test" + tristate "MTD partition test" default n depends on MTD_PARTITION && !BUILD_PROTECTED && !BUILD_LOADABLE ---help--- diff --git a/examples/mtdpart/Make.defs b/examples/mtdpart/Make.defs index bb48bd44e..6b66fe69a 100644 --- a/examples/mtdpart/Make.defs +++ b/examples/mtdpart/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_MTDPART),y) +ifneq ($(CONFIG_EXAMPLES_MTDPART),) CONFIGURED_APPS += examples/mtdpart endif diff --git a/examples/mtdpart/Makefile b/examples/mtdpart/Makefile index eff6cdc29..5cb2b676c 100755 --- a/examples/mtdpart/Makefile +++ b/examples/mtdpart/Makefile @@ -46,4 +46,6 @@ MAINSRC = mtdpart_main.c CONFIG_XYZ_PROGNAME ?= mtdpart$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_MTDPART + include $(APPDIR)/Application.mk diff --git a/examples/mtdrwb/Kconfig b/examples/mtdrwb/Kconfig index d23d615ff..df36d22fe 100644 --- a/examples/mtdrwb/Kconfig +++ b/examples/mtdrwb/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_MTDRWB - bool "MTD R/W buffer test" + tristate "MTD R/W buffer test" default n depends on (MTD_WRBUFFER || MTD_READAHEAD) && !BUILD_PROTECTED && !BUILD_LOADABLE ---help--- diff --git a/examples/mtdrwb/Make.defs b/examples/mtdrwb/Make.defs index bff9b72e1..d5f08cda0 100644 --- a/examples/mtdrwb/Make.defs +++ b/examples/mtdrwb/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_MTDRWB),y) +ifneq ($(CONFIG_EXAMPLES_MTDRWB),) CONFIGURED_APPS += examples/mtdrwb endif diff --git a/examples/mtdrwb/Makefile b/examples/mtdrwb/Makefile index ad5767ddd..23549680f 100755 --- a/examples/mtdrwb/Makefile +++ b/examples/mtdrwb/Makefile @@ -46,4 +46,6 @@ MAINSRC = mtdrwb_main.c CONFIG_EXAMPLES_MTDRWB_PROGNAME ?= mtdrwb$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_MTDRWB + include $(APPDIR)/Application.mk diff --git a/examples/netloop/Kconfig b/examples/netloop/Kconfig index 8d90e750c..d310ac125 100644 --- a/examples/netloop/Kconfig +++ b/examples/netloop/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_NETLOOP - bool "Local loopback example" + tristate "Local loopback example" default n depends on NET_LOOPBACK && NET_TCP && NET_TCPBACKLOG && NET_TCP_READAHEAD && NET_TCP_WRITE_BUFFERS && NET_IPv4 ---help--- diff --git a/examples/netloop/Make.defs b/examples/netloop/Make.defs index 14b6c56e1..eb298adba 100644 --- a/examples/netloop/Make.defs +++ b/examples/netloop/Make.defs @@ -33,6 +33,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NETLOOP),y) +ifneq ($(CONFIG_EXAMPLES_NETLOOP),) CONFIGURED_APPS += examples/netloop endif diff --git a/examples/netloop/Makefile b/examples/netloop/Makefile index 3f11f0fe8..38267ce31 100644 --- a/examples/netloop/Makefile +++ b/examples/netloop/Makefile @@ -51,4 +51,6 @@ STACKSIZE = $(CONFIG_EXAMPLES_NETLOOP_STACKSIZE) CONFIG_XYZ_PROGNAME ?= netloop$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_NETLOOP + include $(APPDIR)/Application.mk diff --git a/examples/netpkt/Kconfig b/examples/netpkt/Kconfig index b6d8999dc..2994abcfb 100644 --- a/examples/netpkt/Kconfig +++ b/examples/netpkt/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_NETPKT - bool "Network packet socket example" + tristate "Network packet socket example" default n depends on NET_PKT ---help--- diff --git a/examples/netpkt/Make.defs b/examples/netpkt/Make.defs index 1d615bcf3..3da9006ac 100644 --- a/examples/netpkt/Make.defs +++ b/examples/netpkt/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NETPKT),y) +ifneq ($(CONFIG_EXAMPLES_NETPKT),) CONFIGURED_APPS += examples/netpkt endif diff --git a/examples/netpkt/Makefile b/examples/netpkt/Makefile index b492d98ea..920b51b0f 100644 --- a/examples/netpkt/Makefile +++ b/examples/netpkt/Makefile @@ -50,4 +50,6 @@ MAINSRC = netpkt_main.c CONFIG_XYZ_PROGNAME ?= netpkt$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_NETPKT + include $(APPDIR)/Application.mk diff --git a/examples/nettest/Kconfig b/examples/nettest/Kconfig index 6cd6da965..94fc0cf55 100644 --- a/examples/nettest/Kconfig +++ b/examples/nettest/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_NETTEST - bool "Network test example" + tristate "Network test example" default n depends on NET_TCP depends on NET_SOCKOPTS diff --git a/examples/nettest/Make.defs b/examples/nettest/Make.defs index 3fba6642d..93cd7719c 100644 --- a/examples/nettest/Make.defs +++ b/examples/nettest/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NETTEST),y) +ifneq ($(CONFIG_EXAMPLES_NETTEST),) CONFIGURED_APPS += examples/nettest endif diff --git a/examples/nettest/Makefile b/examples/nettest/Makefile index fabd7c5ce..6d0d4a3a7 100644 --- a/examples/nettest/Makefile +++ b/examples/nettest/Makefile @@ -33,110 +33,71 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Basic TCP networking test -TARGCMN_CSRCS = nettest_cmdline.c +CSRCS = nettest_cmdline.c ifeq ($(CONFIG_EXAMPLES_NETTEST_INIT),y) -TARGCMN_CSRCS += nettest_netinit.c +CSRCS += nettest_netinit.c endif -TARGCMN_COBJS = $(TARGCMN_CSRCS:.c=$(OBJEXT)) - # Target 1 Files -TARG1_CSRCS = ifeq ($(CONFIG_EXAMPLES_NETTEST_LOOPBACK),y) -TARG1_CSRCS += nettest_server.c nettest_client.c +CSRCS += nettest_server.c nettest_client.c else ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y) -TARG1_CSRCS += nettest_server.c +CSRCS += nettest_server.c else -TARG1_CSRCS += nettest_client.c +CSRCS += nettest_client.c endif -TARG1_MAINSRC = nettest_target1.c - -TARG1_COBJS = $(TARG1_CSRCS:.c=$(OBJEXT)) -TARG1_MAINOBJ = $(TARG1_MAINSRC:.c=$(OBJEXT)) - -TARG_CSRCS = $(TARG1_CSRCS) $(TARG1_CSRCS) $(TARGCMN_CSRCS) -TARG_OBJS = $(TARG1_COBJS) $(TARGCMN_COBJS) +MAINSRC = nettest_target1.c # Target 1 Application Info ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER1),y) CONFIG_EXAMPLES_NETTEST_PROGNAME1 ?= tcpserver -APPNAME1 = tcpserver else CONFIG_EXAMPLES_NETTEST_PROGNAME1 ?= tcpclient -APPNAME1 = tcpclient endif CONFIG_EXAMPLES_NETTEST_PRIORITY1 ?= 100 CONFIG_EXAMPLES_NETTEST_STACKSIZE1 ?= 2048 -PROGNAME1 = $(CONFIG_EXAMPLES_NETTEST_PROGNAME1) -PRIORITY1 = $(CONFIG_EXAMPLES_NETTEST_PRIORITY1) -STACKSIZE1 = $(CONFIG_EXAMPLES_NETTEST_STACKSIZE1) +PROGNAME = $(CONFIG_EXAMPLES_NETTEST_PROGNAME1) +PRIORITY = $(CONFIG_EXAMPLES_NETTEST_PRIORITY1) +STACKSIZE = $(CONFIG_EXAMPLES_NETTEST_STACKSIZE1) # Target 2 ifeq ($(CONFIG_EXAMPLES_NETTEST_TARGET2),y) -TARG2_CSRCS = ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER1),y) -TARG2_CSRCS += nettest_client.c +CSRCS += nettest_client.c else -TARG2_CSRCS += nettest_server.c +CSRCS += nettest_server.c endif -TARG2_MAINSRC = nettest_target2.c - -TARG2_COBJS = $(TARG2_CSRCS:.c=$(OBJEXT)) -TARG2_MAINOBJ = $(TARG2_MAINSRC:.c=$(OBJEXT)) +MAINSRC += nettest_target2.c # Target 2 Application Info ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER1),y) CONFIG_EXAMPLES_NETTEST_PROGNAME2 ?= tcpclient -APPNAME2 = tcpclient else CONFIG_EXAMPLES_NETTEST_PROGNAME2 ?= tcpserver -APPNAME2 = tcpserver endif CONFIG_EXAMPLES_NETTEST_PRIORITY2 ?= 100 CONFIG_EXAMPLES_NETTEST_STACKSIZE2 ?= 2048 -PROGNAME2 = $(CONFIG_EXAMPLES_NETTEST_PROGNAME2) -PRIORITY2 = $(CONFIG_EXAMPLES_NETTEST_PRIORITY2) -STACKSIZE2 = $(CONFIG_EXAMPLES_NETTEST_STACKSIZE2) +PROGNAME += $(CONFIG_EXAMPLES_NETTEST_PROGNAME2) +PRIORITY += $(CONFIG_EXAMPLES_NETTEST_PRIORITY2) +STACKSIZE += $(CONFIG_EXAMPLES_NETTEST_STACKSIZE2) endif -# All targets - -TARG_SRCS = $(TARG1_CRCS) $(TARG1_MAINSRC) $(TARG2_CSRCS) $(TARG2_MAINSRC) $(TARGCMN_CSRCS) -TARG_OBJS = $(TARG1_COBJS) $(TARG2_COBJS) $(TARGCMN_COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - TARG_OBJS += $(TARG1_MAINOBJ) $(TARG2_MAINOBJ) -endif - ifeq ($(CONFIG_EXAMPLES_NETTEST_TARGET2),y) -MAINNAME1 = nettest1_main -MAINNAME2 = nettest2_main +APPNAME = nettest1 nettest2 else -MAINNAME1 = nettest_main -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - TARG_BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - TARG_BIN = ..\\..\\libapps$(LIBEXT) -else - TARG_BIN = ../../libapps$(LIBEXT) -endif +APPNAME = nettest endif # Host @@ -167,25 +128,8 @@ ifneq ($(CONFIG_EXAMPLES_NETTEST_LOOPBACK),y) endif endif -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - # Common build -VPATH = - -all: .built $(HOST_BIN) -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(TARG1_COBJS) $(TARG1_MAINOBJ) $(TARG2_COBJS) $(TARG2_MAINOBJ) $(TARGCMN_COBJS) : %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - ifneq ($(CONFIG_EXAMPLES_NETTEST_TARGET2),y) ifneq ($(CONFIG_EXAMPLES_NETTEST_LOOPBACK),y) @@ -210,62 +154,18 @@ $(HOST_BIN): config.h $(HOST_OBJS) endif endif -.built: config.h $(TARG_OBJS) - $(call ARCHIVE, $(TARG_BIN), $(TARG_OBJS)) - $(Q) touch .built +context:: config.h $(HOST_BIN) -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME1): $(OBJS) $(TARG1_MAINOBJ) - @echo "LD: $(PROGNAME1)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME1) $(ARCHCRT0OBJ) $(TARG1_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME1) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME1) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(if $(CONFIG_BUILD_LOADABLE),,$(MAINNAME1))) - -ifeq ($(CONFIG_EXAMPLES_NETTEST_TARGET2),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME2),$(PRIORITY2),$(STACKSIZE2),$(if $(CONFIG_BUILD_LOADABLE),,$(MAINNAME2))) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat \ - $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat -else -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat -endif -else -context: -endif - -.depend: Makefile config.h $(TARG_CSRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(TARG_CSRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: +clean:: ifneq ($(CONFIG_EXAMPLES_NETTEST_TARGET2),y) ifneq ($(CONFIG_EXAMPLES_NETTEST_LOOPBACK),y) $(call DELFILE, *.$(HOSTOBJEXT)) $(call DELFILE, $(HOST_BIN)) endif endif - $(call DELFILE, .built) $(call DELFILE, *.dSYM) $(call DELFILE, config.h) - $(call CLEAN) -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +MODULE = CONFIG_EXAMPLES_NETTEST -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/nettest/nettest_target1.c b/examples/nettest/nettest_target1.c index 2c74c44ae..9eaf3ea1a 100644 --- a/examples/nettest/nettest_target1.c +++ b/examples/nettest/nettest_target1.c @@ -69,7 +69,7 @@ static int server_child(int argc, char *argv[]) * nettest_main ****************************************************************************/ -#if defined(CONFIG_BUILD_LOADABLE) +#if defined(BUILD_MODULE) int main(int argc, FAR char *argv[]) #elif defined(CONFIG_EXAMPLES_NETTEST_TARGET2) int nettest1_main(int argc, char *argv[]) diff --git a/examples/nrf24l01_term/Kconfig b/examples/nrf24l01_term/Kconfig index ddb950669..d2f77128b 100644 --- a/examples/nrf24l01_term/Kconfig +++ b/examples/nrf24l01_term/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_NRF24L01TERM - bool "Basic nRF24L01 terminal" + tristate "Basic nRF24L01 terminal" default n depends on DRIVERS_WIRELESS diff --git a/examples/nrf24l01_term/Make.defs b/examples/nrf24l01_term/Make.defs index 691ec390c..e4f126e5b 100644 --- a/examples/nrf24l01_term/Make.defs +++ b/examples/nrf24l01_term/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NRF24L01TERM),y) +ifneq ($(CONFIG_EXAMPLES_NRF24L01TERM),) CONFIGURED_APPS += examples/nrf24l01_term endif diff --git a/examples/nrf24l01_term/Makefile b/examples/nrf24l01_term/Makefile index e080cba9f..71739fd19 100644 --- a/examples/nrf24l01_term/Makefile +++ b/examples/nrf24l01_term/Makefile @@ -50,4 +50,6 @@ APPNAME = nrf24l01_term PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_NRF24L01TERM + include $(APPDIR)/Application.mk diff --git a/examples/null/Kconfig b/examples/null/Kconfig index 43d8c2102..fb3fc17c1 100644 --- a/examples/null/Kconfig +++ b/examples/null/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_NULL - bool "NULL example" + tristate "NULL example" default n ---help--- Enable the NULL example diff --git a/examples/null/Make.defs b/examples/null/Make.defs index e5d78706e..937f8cb7c 100644 --- a/examples/null/Make.defs +++ b/examples/null/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NULL),y) +ifneq ($(CONFIG_EXAMPLES_NULL),) CONFIGURED_APPS += examples/null endif diff --git a/examples/null/Makefile b/examples/null/Makefile index 8bf87e70b..72ddef2f5 100644 --- a/examples/null/Makefile +++ b/examples/null/Makefile @@ -50,4 +50,6 @@ MAINSRC = null_main.c CONFIG_XYZ_PROGNAME ?= null$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_NULL + include $(APPDIR)/Application.mk diff --git a/examples/nunchuck/Kconfig b/examples/nunchuck/Kconfig index a9f967520..bf20d19ad 100644 --- a/examples/nunchuck/Kconfig +++ b/examples/nunchuck/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_NUNCHUCK - bool "Nunchuck joystick example" + tristate "Nunchuck joystick example" default n depends on INPUT_NUNCHUCK ---help--- diff --git a/examples/nunchuck/Make.defs b/examples/nunchuck/Make.defs index 07227e16c..183c3b80a 100644 --- a/examples/nunchuck/Make.defs +++ b/examples/nunchuck/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NUNCHUCK),y) +ifneq ($(CONFIG_EXAMPLES_NUNCHUCK),) CONFIGURED_APPS += examples/nunchuck endif diff --git a/examples/nunchuck/Makefile b/examples/nunchuck/Makefile index d8f2ab9bc..e70c34d94 100644 --- a/examples/nunchuck/Makefile +++ b/examples/nunchuck/Makefile @@ -50,5 +50,7 @@ APPNAME = nunchuck PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_NUNCHUCK + include $(APPDIR)/Application.mk diff --git a/examples/nx/Kconfig b/examples/nx/Kconfig index 19fd6c648..440864662 100644 --- a/examples/nx/Kconfig +++ b/examples/nx/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_NX - bool "NX graphics example" + tristate "NX graphics example" default n depends on NX select LIB_BOARDCTL diff --git a/examples/nx/Make.defs b/examples/nx/Make.defs index 6a5bb18a2..107f27ae9 100644 --- a/examples/nx/Make.defs +++ b/examples/nx/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NX),y) +ifneq ($(CONFIG_EXAMPLES_NX),) CONFIGURED_APPS += examples/nx endif diff --git a/examples/nx/Makefile b/examples/nx/Makefile index edc908904..5ab94ef49 100644 --- a/examples/nx/Makefile +++ b/examples/nx/Makefile @@ -50,4 +50,6 @@ APPNAME = nx PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_NX + include $(APPDIR)/Application.mk diff --git a/examples/nxdemo/Kconfig b/examples/nxdemo/Kconfig index 3a70714fd..1390e0182 100644 --- a/examples/nxdemo/Kconfig +++ b/examples/nxdemo/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_NXDEMO - bool "NX Demo \"Graphic test\" example" + tristate "NX Demo \"Graphic test\" example" default n ---help--- Enable the NX graphics \"Demo Test\" example diff --git a/examples/nxdemo/Make.defs b/examples/nxdemo/Make.defs index de35471a0..4584e63c2 100644 --- a/examples/nxdemo/Make.defs +++ b/examples/nxdemo/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NXDEMO),y) +ifneq ($(CONFIG_EXAMPLES_NXDEMO),) CONFIGURED_APPS += examples/nxdemo endif diff --git a/examples/nxdemo/Makefile b/examples/nxdemo/Makefile index 4172e7de0..a1761fb90 100644 --- a/examples/nxdemo/Makefile +++ b/examples/nxdemo/Makefile @@ -53,4 +53,6 @@ APPNAME = nxdemo PRIORITY = $(CONFIG_EXAMPLES_NXDEMO_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_NXDEMO_STACKSIZE) +MODULE = CONFIG_EXAMPLES_NXDEMO + include $(APPDIR)/Application.mk diff --git a/examples/nxffs/Kconfig b/examples/nxffs/Kconfig index 00ef8e1dc..3dd791ef5 100644 --- a/examples/nxffs/Kconfig +++ b/examples/nxffs/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_NXFFS - bool "NXFFS file system example" + tristate "NXFFS file system example" default n ---help--- Enable the NXFFS file system example diff --git a/examples/nxffs/Make.defs b/examples/nxffs/Make.defs index a90c3c945..68d30e6f0 100644 --- a/examples/nxffs/Make.defs +++ b/examples/nxffs/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NXFFS),y) +ifneq ($(CONFIG_EXAMPLES_NXFFS),) CONFIGURED_APPS += examples/nxffs endif diff --git a/examples/nxffs/Makefile b/examples/nxffs/Makefile index 1227d2714..3f54db825 100644 --- a/examples/nxffs/Makefile +++ b/examples/nxffs/Makefile @@ -46,4 +46,6 @@ MAINSRC = nxffs_main.c CONFIG_XYZ_PROGNAME ?= nxffs$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_NXFFS + include $(APPDIR)/Application.mk diff --git a/examples/nxflat/Make.defs b/examples/nxflat/Make.defs index 165f81423..30fade205 100644 --- a/examples/nxflat/Make.defs +++ b/examples/nxflat/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NXFLAT),y) +ifneq ($(CONFIG_EXAMPLES_NXFLAT),) CONFIGURED_APPS += examples/nxflat endif diff --git a/examples/nxflat/Makefile b/examples/nxflat/Makefile index 647a20d13..065a944bf 100644 --- a/examples/nxflat/Makefile +++ b/examples/nxflat/Makefile @@ -33,100 +33,16 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NXFLAT Example -ASRCS = -CSRCS = MAINSRC = nxflat_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= nxflat$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: headers clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -headers: +context:: @$(MAKE) -C tests TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) -.built: headers $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -context: - -# We can't make dependencies in this directory because the required -# header files may not yet exist. - -.depend: - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/nxhello/Kconfig b/examples/nxhello/Kconfig index 14e38aa3f..4cde8b8f2 100644 --- a/examples/nxhello/Kconfig +++ b/examples/nxhello/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_NXHELLO - bool "NX graphics \"Hello, World!\" example" + tristate "NX graphics \"Hello, World!\" example" default n depends on NX select LIB_BOARDCTL diff --git a/examples/nxhello/Make.defs b/examples/nxhello/Make.defs index d34158477..4c8147d05 100644 --- a/examples/nxhello/Make.defs +++ b/examples/nxhello/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NXHELLO),y) +ifneq ($(CONFIG_EXAMPLES_NXHELLO),) CONFIGURED_APPS += examples/nxhello endif diff --git a/examples/nxhello/Makefile b/examples/nxhello/Makefile index 6acda7e42..c9b5c68f7 100644 --- a/examples/nxhello/Makefile +++ b/examples/nxhello/Makefile @@ -53,4 +53,6 @@ APPNAME = nxhello PRIORITY = $(CONFIG_EXAMPLES_NXHELLO_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_NXHELLO_STACKSIZE) +MODULE = CONFIG_EXAMPLES_NXHELLO + include $(APPDIR)/Application.mk diff --git a/examples/nximage/Kconfig b/examples/nximage/Kconfig index fc6c47dc3..9a54fb287 100644 --- a/examples/nximage/Kconfig +++ b/examples/nximage/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_NXIMAGE - bool "NX graphics image example" + tristate "NX graphics image example" default n depends on NX select LIB_BOARDCTL diff --git a/examples/nximage/Make.defs b/examples/nximage/Make.defs index d77d385db..ca91afb00 100644 --- a/examples/nximage/Make.defs +++ b/examples/nximage/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NXIMAGE),y) +ifneq ($(CONFIG_EXAMPLES_NXIMAGE),) CONFIGURED_APPS += examples/nximage endif diff --git a/examples/nximage/Makefile b/examples/nximage/Makefile index bb35c2294..7e953d8c0 100644 --- a/examples/nximage/Makefile +++ b/examples/nximage/Makefile @@ -53,4 +53,6 @@ APPNAME = nximage PRIORITY = $(CONFIG_EXAMPLES_NXIMAGE_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_NXIMAGE_STACKSIZE) +MODULE = CONFIG_EXAMPLES_NXIMAGE + include $(APPDIR)/Application.mk diff --git a/examples/nxlines/Kconfig b/examples/nxlines/Kconfig index 25b3e030c..1f2424018 100644 --- a/examples/nxlines/Kconfig +++ b/examples/nxlines/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_NXLINES - bool "NX graphics lines example" + tristate "NX graphics lines example" default n depends on NX select LIB_BOARDCTL diff --git a/examples/nxlines/Make.defs b/examples/nxlines/Make.defs index 79813edb1..6c7f41a1f 100644 --- a/examples/nxlines/Make.defs +++ b/examples/nxlines/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NXLINES),y) +ifneq ($(CONFIG_EXAMPLES_NXLINES),) CONFIGURED_APPS += examples/nxlines endif diff --git a/examples/nxlines/Makefile b/examples/nxlines/Makefile index 3da200ee4..7f642f0e3 100644 --- a/examples/nxlines/Makefile +++ b/examples/nxlines/Makefile @@ -53,4 +53,6 @@ APPNAME = nxlines PRIORITY = $(CONFIG_EXAMPLES_NXLINES_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_NXLINES_STACKSIZE) +MODULE = CONFIG_EXAMPLES_NXLINES + include $(APPDIR)/Application.mk diff --git a/examples/nxterm/Kconfig b/examples/nxterm/Kconfig index 0df62040c..7e9e97474 100644 --- a/examples/nxterm/Kconfig +++ b/examples/nxterm/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_NXTERM - bool "NxTerm example" + tristate "NxTerm example" default n depends on NX select LIB_BOARDCTL diff --git a/examples/nxterm/Make.defs b/examples/nxterm/Make.defs index cfa82f1cc..1e7ad77ff 100644 --- a/examples/nxterm/Make.defs +++ b/examples/nxterm/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NXTERM),y) +ifneq ($(CONFIG_EXAMPLES_NXTERM),) CONFIGURED_APPS += examples/nxterm endif diff --git a/examples/nxterm/Makefile b/examples/nxterm/Makefile index 3f3a84e34..b971c0e10 100644 --- a/examples/nxterm/Makefile +++ b/examples/nxterm/Makefile @@ -50,4 +50,6 @@ APPNAME = nxterm PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_NXTERM + include $(APPDIR)/Application.mk diff --git a/examples/nxtext/Kconfig b/examples/nxtext/Kconfig index abc45da55..ed3f68c22 100644 --- a/examples/nxtext/Kconfig +++ b/examples/nxtext/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_NXTEXT - bool "NX graphics text example" + tristate "NX graphics text example" default n depends on NX ---help--- diff --git a/examples/nxtext/Make.defs b/examples/nxtext/Make.defs index 33f85fa3e..37aaa4ab5 100644 --- a/examples/nxtext/Make.defs +++ b/examples/nxtext/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_NXTEXT),y) +ifneq ($(CONFIG_EXAMPLES_NXTEXT),) CONFIGURED_APPS += examples/nxtext endif diff --git a/examples/nxtext/Makefile b/examples/nxtext/Makefile index 00d54ab68..74e6c030d 100644 --- a/examples/nxtext/Makefile +++ b/examples/nxtext/Makefile @@ -50,4 +50,6 @@ APPNAME = nxtext PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_NXTEXT + include $(APPDIR)/Application.mk diff --git a/examples/obd2/Kconfig b/examples/obd2/Kconfig index 41d9f0dd5..a818f2d07 100644 --- a/examples/obd2/Kconfig +++ b/examples/obd2/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_OBD2 - bool "OBD-II application example" + tristate "OBD-II application example" default n select CANUTILS_LIBOBD2 ---help--- diff --git a/examples/obd2/Make.defs b/examples/obd2/Make.defs index e3c9536bb..9d8620576 100644 --- a/examples/obd2/Make.defs +++ b/examples/obd2/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_OBD2),y) +ifneq ($(CONFIG_EXAMPLES_OBD2),) CONFIGURED_APPS += examples/obd2 endif diff --git a/examples/obd2/Makefile b/examples/obd2/Makefile index f16659425..df7fe361c 100644 --- a/examples/obd2/Makefile +++ b/examples/obd2/Makefile @@ -53,4 +53,6 @@ MAINSRC = obd2_main.c CONFIG_EXAMPLES_OBD2_PROGNAME ?= obd2$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_OBD2_PROGNAME) +MODULE = CONFIG_EXAMPLES_OBD2 + include $(APPDIR)/Application.mk diff --git a/examples/oneshot/Kconfig b/examples/oneshot/Kconfig index d18d16955..f97bc08c2 100644 --- a/examples/oneshot/Kconfig +++ b/examples/oneshot/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_ONESHOT - bool "Oneshot timer example" + tristate "Oneshot timer example" default n depends on ONESHOT ---help--- diff --git a/examples/oneshot/Make.defs b/examples/oneshot/Make.defs index 728d63a05..a4caf8f15 100644 --- a/examples/oneshot/Make.defs +++ b/examples/oneshot/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_ONESHOT),y) +ifneq ($(CONFIG_EXAMPLES_ONESHOT),) CONFIGURED_APPS += examples/oneshot endif diff --git a/examples/oneshot/Makefile b/examples/oneshot/Makefile index c99b34370..2cd0bd326 100644 --- a/examples/oneshot/Makefile +++ b/examples/oneshot/Makefile @@ -53,4 +53,6 @@ ASRCS = CSRCS = MAINSRC = oneshot_main.c +MODULE = CONFIG_EXAMPLES_ONESHOT + include $(APPDIR)/Application.mk diff --git a/examples/ostest/Kconfig b/examples/ostest/Kconfig index 7f16b013d..a9c9c79f3 100644 --- a/examples/ostest/Kconfig +++ b/examples/ostest/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_OSTEST - bool "OS test example" + tristate "OS test example" default n depends on !DISABLE_SIGNALS ---help--- diff --git a/examples/ostest/Make.defs b/examples/ostest/Make.defs index 6bb08cedd..a2b3c385e 100644 --- a/examples/ostest/Make.defs +++ b/examples/ostest/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_OSTEST),y) +ifneq ($(CONFIG_EXAMPLES_OSTEST),) CONFIGURED_APPS += examples/ostest endif diff --git a/examples/ostest/Makefile b/examples/ostest/Makefile index c918341e7..b18ca5e66 100644 --- a/examples/ostest/Makefile +++ b/examples/ostest/Makefile @@ -136,4 +136,6 @@ endif # CONFIG_DISABLE_PTHREAD CONFIG_XYZ_PROGNAME ?= ostest$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_OSTEST + include $(APPDIR)/Application.mk diff --git a/examples/pashello/Kconfig b/examples/pashello/Kconfig index e1a6c204c..15f74e395 100644 --- a/examples/pashello/Kconfig +++ b/examples/pashello/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_PASHELLO - bool "Pascal \"Hello, World!\" example" + tristate "Pascal \"Hello, World!\" example" default n depends on INTERPRETERS_PCODE select INTERPRETERS_PRUN diff --git a/examples/pashello/Make.defs b/examples/pashello/Make.defs index 8ea9bab1b..f8eeca885 100644 --- a/examples/pashello/Make.defs +++ b/examples/pashello/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_PASHELLO),y) +ifneq ($(CONFIG_EXAMPLES_PASHELLO),) CONFIGURED_APPS += examples/pashello endif diff --git a/examples/pashello/Makefile b/examples/pashello/Makefile index 95ad4754d..07c09c377 100644 --- a/examples/pashello/Makefile +++ b/examples/pashello/Makefile @@ -54,4 +54,6 @@ MAINSRC = pashello.c CONFIG_XYZ_PROGNAME ?= pashello$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_PASHELLO + include $(APPDIR)/Application.mk diff --git a/examples/pca9635/Kconfig b/examples/pca9635/Kconfig index db3f08226..304ac27a4 100644 --- a/examples/pca9635/Kconfig +++ b/examples/pca9635/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_PCA9635 - bool "PCA9635 PWM LED example" + tristate "PCA9635 PWM LED example" default n ---help--- Enable the PCA9635 example diff --git a/examples/pca9635/Make.defs b/examples/pca9635/Make.defs index 00f6d3c59..053a4fc77 100644 --- a/examples/pca9635/Make.defs +++ b/examples/pca9635/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_PCA9635),y) +ifneq ($(CONFIG_EXAMPLES_PCA9635),) CONFIGURED_APPS += examples/pca9635 endif diff --git a/examples/pca9635/Makefile b/examples/pca9635/Makefile index 372aa04ed..3bb9a9225 100644 --- a/examples/pca9635/Makefile +++ b/examples/pca9635/Makefile @@ -50,4 +50,6 @@ MAINSRC = pca9635_main.c CONFIG_EXAMPLES_PCA9635_PROGNAME ?= pca9635$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_PCA9635_PROGNAME) +MODULE = CONFIG_EXAMPLES_PCA9635 + include $(APPDIR)/Application.mk diff --git a/examples/pdcurses/Kconfig b/examples/pdcurses/Kconfig index b06fbbec9..5ab088fce 100644 --- a/examples/pdcurses/Kconfig +++ b/examples/pdcurses/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_PDCURSES - bool "pdcurses demos" + tristate "pdcurses demos" default n ---help--- Enable build the pdcurses demo programs diff --git a/examples/pdcurses/Make.defs b/examples/pdcurses/Make.defs index 762907db1..82cd7d4ea 100644 --- a/examples/pdcurses/Make.defs +++ b/examples/pdcurses/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_PDCURSES),y) +ifneq ($(CONFIG_EXAMPLES_PDCURSES),) CONFIGURED_APPS += examples/pdcurses endif diff --git a/examples/pdcurses/Makefile b/examples/pdcurses/Makefile index b874f3cc5..4db32d326 100644 --- a/examples/pdcurses/Makefile +++ b/examples/pdcurses/Makefile @@ -44,181 +44,17 @@ CONFIG_EXAMPLES_PDCURSES_STACKSIZE ?= 2048 PRIORITY = $(CONFIG_EXAMPLES_PDCURSES_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_PDCURSES_STACKSIZE) -CHARSETNAME = charset -FIREWORKNAME = firework -NEWDEMONAME = newdemo -PANELNAME = panel -RAINNAME = rain -TESTCURSNAME = testcurs -TUINAME = tui -WORMNAME = worm -XMASNAME = xmas - -ASRCS = CSRCS = tui.c -CHARSETMAINSRC = charset_main.c -FIREWORKMAINSRC = firework_main.c -NEWDEMOMAINSRC = newdemo_main.c -PANELMAINSRC = panel_main.c -RAINMAINSRC = rain_main.c -TESTCURSMAINSRC = testcurs_main.c -TUIMAINSRC = tui_main.c -WORMMAINSRC = worm_main.c -XMASMAINSRC = xmas_main.c -MAINSRCS = $(CHARSETMAINSRC) $(FIREWORKMAINSRC) $(NEWDEMOMAINSRC) $(PANELMAINSRC) $(RAINMAINSRC) $(TESTCURSMAINSRC) $(TUIMAINSRC) $(WORMMAINSRC) $(XMASMAINSRC) +MAINSRC = charset_main.c firework_main.c newdemo_main.c panel_main.c +MAINSRC += rain_main.c testcurs_main.c tui_main.c worm_main.c xmas_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) +APPNAME = charset firework newdemo panel +APPNAME += rain testcurs tui worm xmas -CHARSETMAINOBJ = $(CHARSETMAINSRC:.c=$(OBJEXT)) -FIREWORKMAINOBJ = $(FIREWORKMAINSRC:.c=$(OBJEXT)) -NEWDEMOMAINOBJ = $(NEWDEMOMAINSRC:.c=$(OBJEXT)) -PANELMAINOBJ = $(PANELMAINSRC:.c=$(OBJEXT)) -RAINMAINOBJ = $(RAINMAINSRC:.c=$(OBJEXT)) -TESTCURSMAINOBJ = $(TESTCURSMAINSRC:.c=$(OBJEXT)) -TUIMAINOBJ = $(TUIMAINSRC:.c=$(OBJEXT)) -WORMMAINOBJ = $(WORMMAINSRC:.c=$(OBJEXT)) -XMASMAINOBJ = $(XMASMAINSRC:.c=$(OBJEXT)) -MAINOBJS = $(CHARSETMAINOBJ) $(FIREWORKMAINOBJ) $(NEWDEMOMAINOBJ) $(PANELMAINOBJ) $(RAINMAINOBJ) $(TESTCURSMAINOBJ) $(TUIMAINOBJ) $(WORMMAINOBJ) $(XMASMAINOBJ) +PROGNAME = charset$(EXEEXT) firework$(EXEEXT) newdemo$(EXEEXT) panel$(EXEEXT) +PROGNAME += rain$(EXEEXT) testcurs$(EXEEXT) tui$(EXEEXT) worm$(EXEEXT) xmas$(EXEEXT) -SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) $(MAINSRCS) -OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) +MODULE = CONFIG_EXAMPLES_PDCURSES -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJS) -endif - -ifeq ($(WINTOOL),y) - BIN = "${shell cygpath -w $(APPDIR)$(DELIM)libapps$(LIBEXT)}" - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - BIN = $(APPDIR)$(DELIM)libapps$(LIBEXT) - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - -VPATH = - -all: .built -.PHONY: clean preconfig depend distclean -.PRECIOUS: $(APPDIR)/libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -$(CXXOBJS): %$(OBJEXT): %$(CXXEXT) - $(call COMPILEXX, $<, $@) - -$(MAINOBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch $@ - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(CHARSETNAME): $(OBJS) $(CHARSETMAINOBJ) - @echo "LD: $(CHARSETNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(CHARSETNAME) $(ARCHCRT0OBJ) $(CHARSETMAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(CHARSETNAME) - -$(BIN_DIR)$(DELIM)$(FIREWORKNAME): $(OBJS) $(FIREWORKMAINOBJ) - @echo "LD: $(FIREWORKNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(FIREWORKNAME) $(ARCHCRT0OBJ) $(FIREWORKMAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(FIREWORKNAME) - -$(BIN_DIR)$(DELIM)$(NEWDEMONAME): $(OBJS) $(NEWDEMOMAINOBJ) - @echo "LD: $(NEWDEMONAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(NEWDEMONAME) $(ARCHCRT0OBJ) $(NEWDEMOMAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(NEWDEMONAME) - -$(BIN_DIR)$(DELIM)$(PANELNAME): $(OBJS) $(PANELMAINOBJ) - @echo "LD: $(PANELNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PANELNAME) $(ARCHCRT0OBJ) $(PANELMAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PANELNAME) - -$(BIN_DIR)$(DELIM)$(RAINNAME): $(OBJS) $(RAINMAINOBJ) - @echo "LD: $(RAINNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(RAINNAME) $(ARCHCRT0OBJ) $(RAINMAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(RAINNAME) - -$(BIN_DIR)$(DELIM)$(TESTCURSNAME): $(OBJS) $(TESTCURSMAINOBJ) - @echo "LD: $(TESTCURSNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(TESTCURSNAME) $(ARCHCRT0OBJ) $(TESTCURSMAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(TESTCURSNAME) - -$(BIN_DIR)$(DELIM)$(TUINAME): $(OBJS) $(TUIMAINOBJ) - @echo "LD: $(TUINAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(TUINAME) $(ARCHCRT0OBJ) $(TUIMAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(TUINAME) - -$(BIN_DIR)$(DELIM)$(WORMNAME): $(OBJS) $(WORMMAINOBJ) - @echo "LD: $(WORMNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(WORMNAME) $(ARCHCRT0OBJ) $(WORMMAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(WORMNAME) - -$(BIN_DIR)$(DELIM)$(XMASNAME): $(OBJS) $(XMASMAINOBJ) - @echo "LD: $(XMASNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(XMASNAME) $(ARCHCRT0OBJ) $(XMASMAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(XMASNAME) - -install: $(BIN_DIR)$(DELIM)$(CHARSETNAME) $(BIN_DIR)$(DELIM)$(FIREWORKNAME) $(BIN_DIR)$(DELIM)$(NEWDEMONAME) $(BIN_DIR)$(DELIM)$(PANELNAME) $(BIN_DIR)$(DELIM)$(RAINNAME) $(BIN_DIR)$(DELIM)$(TESTCURSNAME) $(BIN_DIR)$(DELIM)$(TUINAME) $(BIN_DIR)$(DELIM)$(WORMNAME) $(BIN_DIR)$(DELIM)$(XMASNAME) -else -install: -endif - -preconfig: - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(CHARSETNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(CHARSETNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(CHARSETNAME)_main)) - -$(BUILTIN_REGISTRY)$(DELIM)$(FIREWORKNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(FIREWORKNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(FIREWORKNAME)_main)) - -$(BUILTIN_REGISTRY)$(DELIM)$(NEWDEMONAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(NEWDEMONAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(NEWDEMONAME)_main)) - -$(BUILTIN_REGISTRY)$(DELIM)$(PANELNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(PANELNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(PANELNAME)_main)) - -$(BUILTIN_REGISTRY)$(DELIM)$(RAINNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(RAINNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(RAINNAME)_main)) - -$(BUILTIN_REGISTRY)$(DELIM)$(TESTCURSNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(TESTCURSNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(TESTCURSNAME)_main)) - -$(BUILTIN_REGISTRY)$(DELIM)$(TUINAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(TUINAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(TUINAME)_main)) - -$(BUILTIN_REGISTRY)$(DELIM)$(WORMNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(WORMNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(WORMNAME)_main)) - -$(BUILTIN_REGISTRY)$(DELIM)$(XMASNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(XMASNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(XMASNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(CHARSETNAME)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(FIREWORKNAME)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(NEWDEMONAME)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(PANELNAME)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(RAINNAME)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(TESTCURSNAME)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(TUINAME)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(WORMNAME)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(XMASNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/pf_ieee802154/Kconfig b/examples/pf_ieee802154/Kconfig index 2a12b452c..cb6da2ac1 100644 --- a/examples/pf_ieee802154/Kconfig +++ b/examples/pf_ieee802154/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_PFIEEE802154 - bool "PF_IEEE802154 example" + tristate "PF_IEEE802154 example" default n depends on NET_IEEE802154 ---help--- diff --git a/examples/pf_ieee802154/Make.defs b/examples/pf_ieee802154/Make.defs index 9b1526226..738380d0b 100644 --- a/examples/pf_ieee802154/Make.defs +++ b/examples/pf_ieee802154/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_PFIEEE802154),y) +ifneq ($(CONFIG_EXAMPLES_PFIEEE802154),) CONFIGURED_APPS += examples/pf_ieee802154 endif diff --git a/examples/pf_ieee802154/Makefile b/examples/pf_ieee802154/Makefile index ab122dfa2..d791b77b1 100644 --- a/examples/pf_ieee802154/Makefile +++ b/examples/pf_ieee802154/Makefile @@ -33,140 +33,28 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # PF_IEEE802154 Socket Test -TARGCMN_CSRCS = pf_cmdline.c -TARGCMN_COBJS = $(TARGCMN_CSRCS:.c=$(OBJEXT)) +CSRCS = pf_cmdline.c -# Target 1 - -TARG1_CRCS = -TARG1_MAINSRC = pf_server.c - -TARG1_COBJS = $(TARG1_CRCS:.c=$(OBJEXT)) -TARG1_MAINOBJ = $(TARG1_MAINSRC:.c=$(OBJEXT)) - -CONFIG_EXAMPLES_PFIEEE802154_PROGNAME1 ?= pfserver -APPNAME1 = pfserver +MAINSRC = pf_server.c pf_client.c +APPNAME = pfserver pfclient +PROGNAME = pfserver$(EXEEXT) pfclient$(EXEEXT) CONFIG_EXAMPLES_PFIEEE802154_PRIORITY1 ?= 100 CONFIG_EXAMPLES_PFIEEE802154_STACKSIZE1 ?= 2048 -PROGNAME1 = $(CONFIG_EXAMPLES_PFIEEE802154_PROGNAME1) -PRIORITY1 = $(CONFIG_EXAMPLES_PFIEEE802154_PRIORITY1) -STACKSIZE1 = $(CONFIG_EXAMPLES_PFIEEE802154_STACKSIZE1) - -# Target 2 - -TARG2_CSRCS = -TARG2_MAINSRC = pf_client.c - -TARG2_COBJS = $(TARG2_CSRCS:.c=$(OBJEXT)) -TARG2_MAINOBJ = $(TARG2_MAINSRC:.c=$(OBJEXT)) - -CONFIG_EXAMPLES_PFIEEE802154_PROGNAME2 ?= pfclient -APPNAME2 = pfclient +PRIORITY = $(CONFIG_EXAMPLES_PFIEEE802154_PRIORITY1) +STACKSIZE = $(CONFIG_EXAMPLES_PFIEEE802154_STACKSIZE1) CONFIG_EXAMPLES_PFIEEE802154_PRIORITY2 ?= 100 CONFIG_EXAMPLES_PFIEEE802154_STACKSIZE2 ?= 2048 -PROGNAME2 = $(CONFIG_EXAMPLES_PFIEEE802154_PROGNAME2) -PRIORITY2 = $(CONFIG_EXAMPLES_PFIEEE802154_PRIORITY2) -STACKSIZE2 = $(CONFIG_EXAMPLES_PFIEEE802154_STACKSIZE2) +PRIORITY += $(CONFIG_EXAMPLES_PFIEEE802154_PRIORITY2) +STACKSIZE += $(CONFIG_EXAMPLES_PFIEEE802154_STACKSIZE2) -SRCS = $(TARG1_CRCS) $(TARG1_MAINSRC) $(TARG2_CSRCS) $(TARG2_MAINSRC) $(TARGCMN_CSRCS) -OBJS = $(TARG1_COBJS) $(TARG2_COBJS) $(TARGCMN_COBJS) -MAINOBJS = $(TARG1_MAINOBJ) $(TARG2_MAINOBJ) +MODULE = CONFIG_EXAMPLES_PFIEEE802154 -MAINNAME1 = pfserver_main -MAINNAME2 = pfclient_main - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(OBJS) $(MAINOBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -$(BIN): $(OBJS) $(MAINOBJS) - $(call ARCHIVE, $@, $(OBJS) $(MAINOBJS)) - -.built: $(BIN) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME1): $(OBJS) $(TARG1_MAINOBJ) - @echo "LD: $(PROGNAME1)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME1) $(ARCHCRT0OBJ) $(TARG1_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME1) - -$(BIN_DIR)$(DELIM)$(PROGNAME2): $(OBJS) $(TARG2_MAINOBJ) - @echo "LD: $(PROGNAME2)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME2) $(ARCHCRT0OBJ) $(TARG2_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME2) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME1) $(BIN_DIR)$(DELIM)$(PROGNAME2) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(if $(CONFIG_BUILD_LOADABLE),,$(MAINNAME1))) - -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME2),$(PRIORITY2),$(STACKSIZE2),$(if $(CONFIG_BUILD_LOADABLE),,$(MAINNAME2))) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat \ - $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat -else -context: -endif - -.depend: Makefile config.h $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call DELFILE, *.dSYM) - $(call DELFILE, config.h) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/pipe/Kconfig b/examples/pipe/Kconfig index d6ca33bc8..4d835ad43 100644 --- a/examples/pipe/Kconfig +++ b/examples/pipe/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_PIPE - bool "Pipe example" + tristate "Pipe example" default n depends on PIPES ---help--- diff --git a/examples/pipe/Make.defs b/examples/pipe/Make.defs index 4c5806d28..6d28e19e9 100644 --- a/examples/pipe/Make.defs +++ b/examples/pipe/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_PIPE),y) +ifneq ($(CONFIG_EXAMPLES_PIPE),) CONFIGURED_APPS += examples/pipe endif diff --git a/examples/pipe/Makefile b/examples/pipe/Makefile index 08d5216aa..c6b8a972a 100644 --- a/examples/pipe/Makefile +++ b/examples/pipe/Makefile @@ -46,4 +46,6 @@ MAINSRC = pipe_main.c CONFIG_XYZ_PROGNAME ?= pipe$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_PIPE + include $(APPDIR)/Application.mk diff --git a/examples/poll/Kconfig b/examples/poll/Kconfig index f07412fa3..30ffcc0c7 100644 --- a/examples/poll/Kconfig +++ b/examples/poll/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_POLL - bool "Poll example" + tristate "Poll example" default n depends on !NSH_BUILTIN_APPS && PIPES ---help--- diff --git a/examples/poll/Make.defs b/examples/poll/Make.defs index c03d13309..c92f8bc63 100644 --- a/examples/poll/Make.defs +++ b/examples/poll/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_POLL),y) +ifneq ($(CONFIG_EXAMPLES_POLL),) CONFIGURED_APPS += examples/poll endif diff --git a/examples/poll/Makefile b/examples/poll/Makefile index 368d3c46c..8a7a6960e 100644 --- a/examples/poll/Makefile +++ b/examples/poll/Makefile @@ -33,98 +33,14 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs -# Device Driver poll()/select() Example - -ASRCS = CSRCS = poll_listener.c select_listener.c net_listener.c net_reader.c MAINSRC = poll_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= poll$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +MODULE = CONFIG_EXAMPLES_POLL -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -context: - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -# Register application -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - $(call DELFILE, host$(HOSTEXEEXT)) - $(call DELFILE, *.dSYM) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/popen/Kconfig b/examples/popen/Kconfig index b43e1ee9f..f5a0de296 100644 --- a/examples/popen/Kconfig +++ b/examples/popen/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_POPEN - bool "popen() example" + tristate "popen() example" default n depends on SYSTEM_POPEN ---help--- diff --git a/examples/popen/Make.defs b/examples/popen/Make.defs index cdb6a0fc9..db46587e0 100644 --- a/examples/popen/Make.defs +++ b/examples/popen/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_POPEN),y) +ifneq ($(CONFIG_EXAMPLES_POPEN),) CONFIGURED_APPS += examples/popen endif diff --git a/examples/popen/Makefile b/examples/popen/Makefile index b8265ecd3..1b2f5455b 100644 --- a/examples/popen/Makefile +++ b/examples/popen/Makefile @@ -53,4 +53,6 @@ MAINSRC = popen_main.c CONFIG_EXAMPLES_POPEN_PROGNAME ?= popen$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_POPEN_PROGNAME) +MODULE = CONFIG_EXAMPLES_POPEN + include $(APPDIR)/Application.mk diff --git a/examples/posix_spawn/Make.defs b/examples/posix_spawn/Make.defs index 4af94624e..07e735752 100644 --- a/examples/posix_spawn/Make.defs +++ b/examples/posix_spawn/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_POSIXSPAWN),y) +ifneq ($(CONFIG_EXAMPLES_POSIXSPAWN),) CONFIGURED_APPS += examples/posix_spawn endif diff --git a/examples/posix_spawn/Makefile b/examples/posix_spawn/Makefile index c7c6b9ba6..d0e280cb8 100644 --- a/examples/posix_spawn/Makefile +++ b/examples/posix_spawn/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # ELF Example @@ -43,97 +41,22 @@ ASRCS = CSRCS = symtab.c MAINSRC = spawn_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= posix_spawn$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . --dep-path filesystem +ROOTDEPPATH += --dep-path filesystem # Build targets -VPATH = filesystem +VPATH += filesystem -all: build -.PHONY: build clean_filesystem clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -# This is a little messy. The build is broken into two pieces: (1) the -# filesystem/ subdir build that auto-generates several files, and (2) the library -# build. This is done because we need a fresh build context after auto- -# generating the source files. - -build_lib: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - -build: +context:: @$(MAKE) -C filesystem TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) - @$(MAKE) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" build_lib -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -context: - -# We can't make dependencies in this directory because the required -# header files may not yet exist. - -.depend: - @touch $@ - -depend: .depend - -clean_filesystem: +clean:: @$(MAKE) -C filesystem TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) clean - -clean: clean_filesystem $(call CLEAN) -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - # There are no dependencies in this directory. Some of more important # and more obvious dependencies are hard-coded here: @@ -158,4 +81,4 @@ symtab.o: filesystem/symtab.c \ $(TOPDIR)/include/nuttx/compiler.h \ $(TOPDIR)/include/nuttx/binfmt/symtab.h -preconfig: +include $(APPDIR)/Application.mk diff --git a/examples/powerled/Kconfig b/examples/powerled/Kconfig index 64769ba90..deb911da4 100644 --- a/examples/powerled/Kconfig +++ b/examples/powerled/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_POWERLED - bool "Powerled example" + tristate "Powerled example" default n ---help--- Enable the powerled driver example diff --git a/examples/powerled/Make.defs b/examples/powerled/Make.defs index a8694cdfc..2320acb61 100644 --- a/examples/powerled/Make.defs +++ b/examples/powerled/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_POWERLED),y) +ifneq ($(CONFIG_EXAMPLES_POWERLED),) CONFIGURED_APPS += examples/powerled endif diff --git a/examples/powerled/Makefile b/examples/powerled/Makefile index c114aba71..b6d6da013 100644 --- a/examples/powerled/Makefile +++ b/examples/powerled/Makefile @@ -49,4 +49,6 @@ PROGNAME = $(CONFIG_EXAMPLES_POWERLED_PROGNAME) PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 1024 +MODULE = CONFIG_EXAMPLES_POWERLED + include $(APPDIR)/Application.mk diff --git a/examples/powermonitor/Kconfig b/examples/powermonitor/Kconfig index 17840e758..e483247c0 100644 --- a/examples/powermonitor/Kconfig +++ b/examples/powermonitor/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_POWERMONITOR - bool "LTC4151 powermonitor example" + tristate "LTC4151 powermonitor example" default n if EXAMPLES_POWERMONITOR diff --git a/examples/powermonitor/Make.defs b/examples/powermonitor/Make.defs index 235f34df2..dcd73b249 100644 --- a/examples/powermonitor/Make.defs +++ b/examples/powermonitor/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_POWERMONITOR),y) +ifneq ($(CONFIG_EXAMPLES_POWERMONITOR),) CONFIGURED_APPS += examples/powermonitor endif diff --git a/examples/powermonitor/Makefile b/examples/powermonitor/Makefile index e0e024628..fb2333a26 100644 --- a/examples/powermonitor/Makefile +++ b/examples/powermonitor/Makefile @@ -1,5 +1,4 @@ -############################################################################ -# apps/examples/powermonitor/Makefile +############################################################################ # apps/examples/powermonitor/Makefile # # Copyright (C) 2017 Giorgio Groß. All rights reserved. # Author: Giorgio Groß @@ -48,4 +47,6 @@ CFLAGS += -I../../../nuttx/arch/arm/src -I../../../nuttx/arch/arm/src/common CONFIG_EXAMPLES_POWERMONITOR_PROGNAME ?= temperature$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_POWERMONITOR_PROGNAME) +MODULE = CONFIG_EXAMPLES_POWERMONITOR + include $(APPDIR)/Application.mk diff --git a/examples/pppd/Kconfig b/examples/pppd/Kconfig index 69b0e4eb4..a41625877 100644 --- a/examples/pppd/Kconfig +++ b/examples/pppd/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_PPPD - bool "pppd client example" + tristate "pppd client example" default n ---help--- Enable the pppd client example diff --git a/examples/pppd/Make.defs b/examples/pppd/Make.defs index 029f60984..c59808ea2 100644 --- a/examples/pppd/Make.defs +++ b/examples/pppd/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_PPPD),y) +ifneq ($(CONFIG_EXAMPLES_PPPD),) CONFIGURED_APPS += examples/pppd endif diff --git a/examples/pppd/Makefile b/examples/pppd/Makefile index 9f75a710e..96990751d 100644 --- a/examples/pppd/Makefile +++ b/examples/pppd/Makefile @@ -50,4 +50,6 @@ APPNAME = pppd PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_PPPD + include $(APPDIR)/Application.mk diff --git a/examples/pty_test/Kconfig b/examples/pty_test/Kconfig index f6b61f5fb..311f8c7cb 100644 --- a/examples/pty_test/Kconfig +++ b/examples/pty_test/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_PTYTEST - bool "Pseudo Terminal test example" + tristate "Pseudo Terminal test example" default n depends on PSEUDOTERM select PSEUDOTERM_SUSV1 diff --git a/examples/pty_test/Make.defs b/examples/pty_test/Make.defs index 2dedf7ceb..d61abf548 100644 --- a/examples/pty_test/Make.defs +++ b/examples/pty_test/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_PTYTEST),y) +ifneq ($(CONFIG_EXAMPLES_PTYTEST),) CONFIGURED_APPS += examples/pty_test endif diff --git a/examples/pty_test/Makefile b/examples/pty_test/Makefile index 799967077..df663630b 100644 --- a/examples/pty_test/Makefile +++ b/examples/pty_test/Makefile @@ -54,4 +54,6 @@ MAINSRC = pty_test.c CONFIG_EXAMPLES_PTYTEST_PROGNAME ?= pty_test$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_PTYTEST_PROGNAME) +MODULE = CONFIG_EXAMPLES_PTYTEST + include $(APPDIR)/Application.mk diff --git a/examples/pwm/Kconfig b/examples/pwm/Kconfig index 833efe06e..2c3b21427 100644 --- a/examples/pwm/Kconfig +++ b/examples/pwm/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_PWM - bool "Pulse width modulation (PWM) example" + tristate "Pulse width modulation (PWM) example" default n depends on PWM && NSH_BUILTIN_APPS ---help--- diff --git a/examples/pwm/Make.defs b/examples/pwm/Make.defs index 8d2e38b55..7f7ed6975 100644 --- a/examples/pwm/Make.defs +++ b/examples/pwm/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_PWM),y) +ifneq ($(CONFIG_EXAMPLES_PWM),) CONFIGURED_APPS += examples/pwm endif diff --git a/examples/pwm/Makefile b/examples/pwm/Makefile index 25ec0b9e7..e1dec4d71 100644 --- a/examples/pwm/Makefile +++ b/examples/pwm/Makefile @@ -50,4 +50,6 @@ APPNAME = pwm PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_PWM + include $(APPDIR)/Application.mk diff --git a/examples/qencoder/Kconfig b/examples/qencoder/Kconfig index 4baedb9bd..7addc91c3 100644 --- a/examples/qencoder/Kconfig +++ b/examples/qencoder/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_QENCODER - bool "Quadrature encoder example" + tristate "Quadrature encoder example" default n depends on SENSORS_QENCODER ---help--- diff --git a/examples/qencoder/Make.defs b/examples/qencoder/Make.defs index 856fc1852..28b54fcb6 100644 --- a/examples/qencoder/Make.defs +++ b/examples/qencoder/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_QENCODER),y) +ifneq ($(CONFIG_EXAMPLES_QENCODER),) CONFIGURED_APPS += examples/qencoder endif diff --git a/examples/qencoder/Makefile b/examples/qencoder/Makefile index 70c316272..231b8dd6c 100644 --- a/examples/qencoder/Makefile +++ b/examples/qencoder/Makefile @@ -50,4 +50,6 @@ APPNAME = qe PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_QENCODER + include $(APPDIR)/Application.mk diff --git a/examples/random/Kconfig b/examples/random/Kconfig index 7b1c11bb8..251b59619 100644 --- a/examples/random/Kconfig +++ b/examples/random/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_RANDOM - bool "/dev/random test" + tristate "/dev/random test" default n depends on DEV_RANDOM ---help--- diff --git a/examples/random/Make.defs b/examples/random/Make.defs index 6484fcc26..f3fd7c61d 100644 --- a/examples/random/Make.defs +++ b/examples/random/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_RANDOM),y) +ifneq ($(CONFIG_EXAMPLES_RANDOM),) CONFIGURED_APPS += examples/random endif diff --git a/examples/random/Makefile b/examples/random/Makefile index 78ca31d91..306866543 100644 --- a/examples/random/Makefile +++ b/examples/random/Makefile @@ -48,4 +48,6 @@ MAINSRC = random_main.c CONFIG_XYZ_PROGNAME ?= random$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_RANDOM + include $(APPDIR)/Application.mk diff --git a/examples/relays/Kconfig b/examples/relays/Kconfig index 23da8ce90..d6d1fd841 100644 --- a/examples/relays/Kconfig +++ b/examples/relays/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_RELAYS - bool "wget JSON Example" + tristate "wget JSON Example" default n depends on NETUTILS_JSON ---help--- diff --git a/examples/relays/Make.defs b/examples/relays/Make.defs index 39134d3c1..da0e79230 100644 --- a/examples/relays/Make.defs +++ b/examples/relays/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_RELAYS),y) +ifneq ($(CONFIG_EXAMPLES_RELAYS),) CONFIGURED_APPS += examples/relays endif diff --git a/examples/relays/Makefile b/examples/relays/Makefile index 691b0ed14..4a9cbb031 100644 --- a/examples/relays/Makefile +++ b/examples/relays/Makefile @@ -50,4 +50,6 @@ APPNAME = relays PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 512 +MODULE = CONFIG_EXAMPLES_RELAYS + include $(APPDIR)/Application.mk diff --git a/examples/rfid_readuid/Kconfig b/examples/rfid_readuid/Kconfig index 612d480a5..fe48604f7 100644 --- a/examples/rfid_readuid/Kconfig +++ b/examples/rfid_readuid/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_RFID_READUID - bool "RFID Read UID example" + tristate "RFID Read UID example" default n ---help--- Enable the RFID READUID example diff --git a/examples/rfid_readuid/Make.defs b/examples/rfid_readuid/Make.defs index e6822637e..2fa26608e 100644 --- a/examples/rfid_readuid/Make.defs +++ b/examples/rfid_readuid/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_RFID_READUID),y) +ifneq ($(CONFIG_EXAMPLES_RFID_READUID),) CONFIGURED_APPS += examples/rfid_readuid endif diff --git a/examples/rfid_readuid/Makefile b/examples/rfid_readuid/Makefile index 32801a04e..4067c8c43 100644 --- a/examples/rfid_readuid/Makefile +++ b/examples/rfid_readuid/Makefile @@ -53,4 +53,6 @@ MAINSRC = rfid_readuid.c CONFIG_EXAMPLES_RFID_READUID_PROGNAME ?= rfid_readuid$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_RFID_READUID_PROGNAME) +MODULE = CONFIG_EXAMPLES_RFID_READUID + include $(APPDIR)/Application.mk diff --git a/examples/rgbled/Kconfig b/examples/rgbled/Kconfig index fd38b7af0..9e552c769 100644 --- a/examples/rgbled/Kconfig +++ b/examples/rgbled/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_RGBLED - bool "RGB LED Test" + tristate "RGB LED Test" default n ---help--- Enable the RGB LED example diff --git a/examples/rgbled/Make.defs b/examples/rgbled/Make.defs index 013a6ea93..721f06b2a 100644 --- a/examples/rgbled/Make.defs +++ b/examples/rgbled/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_RGBLED),y) +ifneq ($(CONFIG_EXAMPLES_RGBLED),) CONFIGURED_APPS += examples/rgbled endif diff --git a/examples/rgbled/Makefile b/examples/rgbled/Makefile index 01db844c0..44da4c4a9 100644 --- a/examples/rgbled/Makefile +++ b/examples/rgbled/Makefile @@ -53,4 +53,6 @@ MAINSRC = rgbled.c CONFIG_EXAMPLES_RGBLED_PROGNAME ?= rgbled$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_RGBLED_PROGNAME) +MODULE = CONFIG_EXAMPLES_RGBLED + include $(APPDIR)/Application.mk diff --git a/examples/romfs/Kconfig b/examples/romfs/Kconfig index 44bd5d74d..e4a2308a4 100644 --- a/examples/romfs/Kconfig +++ b/examples/romfs/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_ROMFS - bool "ROMFS example" + tristate "ROMFS example" default n depends on FS_ROMFS && BUILD_FLAT ---help--- diff --git a/examples/romfs/Make.defs b/examples/romfs/Make.defs index f7b0e0541..aaedf76c8 100644 --- a/examples/romfs/Make.defs +++ b/examples/romfs/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_ROMFS),y) +ifneq ($(CONFIG_EXAMPLES_ROMFS),) CONFIGURED_APPS += examples/romfs endif diff --git a/examples/romfs/Makefile b/examples/romfs/Makefile index 4a595a4f1..3a77e55d4 100644 --- a/examples/romfs/Makefile +++ b/examples/romfs/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # ROMFS built-in application info @@ -45,56 +43,13 @@ STACKSIZE = 2048 # ROMFS File System Example -ASRCS = -CSRCS = MAINSRC = romfs_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= romfs$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Common build -VPATH = - -all: .built -.PHONY: checkgenromfs clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - checkgenromfs: @genromfs -h 1>/dev/null 2>&1 || { \ echo "Host executable genromfs not available in PATH"; \ @@ -111,47 +66,11 @@ testdir.img : checkgenromfs testdir romfs_testdir.h : testdir.img @xxd -i $< >$@ || { echo "xxd of $< failed" ; exit 1 ; } -.built: romfs_testdir.h $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built +context:: romfs_testdir.h -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +distclean:: $(call DELFILE, testdir.img) -preconfig: +MODULE = CONFIG_EXAMPLES_ROMFS --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/romfs/romfs_testdir.h b/examples/romfs/romfs_testdir.h index b0d10de66..4dc29b392 100644 --- a/examples/romfs/romfs_testdir.h +++ b/examples/romfs/romfs_testdir.h @@ -1,7 +1,6 @@ -unsigned char testdir_img[] = -{ +unsigned char testdir_img[] = { 0x2d, 0x72, 0x6f, 0x6d, 0x31, 0x66, 0x73, 0x2d, 0x00, 0x00, 0x02, 0x60, - 0x27, 0x43, 0x4a, 0x8a, 0x52, 0x4f, 0x4d, 0x46, 0x53, 0x5f, 0x54, 0x65, + 0x78, 0xe8, 0x12, 0x53, 0x52, 0x4f, 0x4d, 0x46, 0x53, 0x5f, 0x54, 0x65, 0x73, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0xd1, 0xff, 0xff, 0x97, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -12,45 +11,45 @@ unsigned char testdir_img[] = 0x93, 0x9b, 0x95, 0xf0, 0x6c, 0x64, 0x69, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x64, 0x69, 0x72, 0x2f, 0x73, 0x75, 0x62, 0x64, 0x69, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x19, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x00, - 0x9e, 0x9b, 0x93, 0xc5, 0x61, 0x64, 0x69, 0x72, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x58, 0x47, 0x43, 0xf1, + 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, + 0xc5, 0x6b, 0x21, 0x4b, 0x61, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x74, 0x78, + 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x68, 0x69, 0x73, + 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x0a, 0x00, + 0x00, 0x00, 0x02, 0x49, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, + 0x9e, 0x9b, 0x93, 0x65, 0x61, 0x64, 0x69, 0x72, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x22, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x58, 0x47, 0x43, 0xc1, 0x61, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x74, 0x78, 0x74, 0x00, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, - 0xa1, 0xc5, 0x69, 0xd8, 0x79, 0x61, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x74, + 0x00, 0x00, 0x01, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, + 0xa1, 0xc5, 0x69, 0xa8, 0x79, 0x61, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x74, 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x79, 0x65, 0x74, 0x20, 0x61, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x0a, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x50, 0x00, 0x00, 0x00, 0x90, - 0x00, 0x00, 0x00, 0x00, 0xd1, 0xff, 0xfe, 0x20, 0x2e, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x00, 0x00, 0xd1, 0xd1, 0xfe, 0x60, 0x2e, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x70, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, - 0xd1, 0xd1, 0xfe, 0x70, 0x2e, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0xa0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0xd1, 0xff, 0xfd, 0xa0, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, - 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x23, 0x18, 0x9c, 0x03, + 0x00, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x23, 0x18, 0x9b, 0xd3, 0x73, 0x75, 0x62, 0x64, 0x69, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xd2, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x15, 0x3e, 0x3f, 0x06, 0xd8, 0x73, 0x75, 0x62, 0x64, - 0x69, 0x72, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x74, 0x78, 0x74, 0x00, 0x00, - 0x46, 0x69, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x75, 0x62, 0x64, - 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x0a, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf0, - 0x00, 0x00, 0x01, 0x70, 0x00, 0x00, 0x00, 0x00, 0xd1, 0xff, 0xfc, 0xa0, - 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, - 0x00, 0x00, 0x00, 0x00, 0xd1, 0xd1, 0xff, 0x70, 0x2e, 0x2e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0xd1, 0xd1, 0xfd, 0x60, 0x2e, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x02, 0x30, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, - 0x32, 0x99, 0x92, 0xd4, 0x68, 0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, + 0xd1, 0xff, 0xfc, 0x60, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc5, 0x6b, 0x22, 0x0b, - 0x61, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x74, 0x78, 0x74, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, - 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x3e, 0x3f, 0x08, 0xa8, + 0x73, 0x75, 0x62, 0x64, 0x69, 0x72, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x74, + 0x78, 0x74, 0x00, 0x00, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, + 0x73, 0x75, 0x62, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, + 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x32, 0x99, 0x94, 0x94, 0x68, 0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -87,5 +86,4 @@ unsigned char testdir_img[] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - unsigned int testdir_img_len = 1024; diff --git a/examples/sendmail/Kconfig b/examples/sendmail/Kconfig index 4f9a9ebb8..12b399dcf 100644 --- a/examples/sendmail/Kconfig +++ b/examples/sendmail/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_SENDMAIL - bool "Sendmail example" + tristate "Sendmail example" default n ---help--- Enable the sendmail example diff --git a/examples/sendmail/Make.defs b/examples/sendmail/Make.defs index 1452d93b5..efba4410e 100644 --- a/examples/sendmail/Make.defs +++ b/examples/sendmail/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_SENDMAIL),y) +ifneq ($(CONFIG_EXAMPLES_SENDMAIL),) CONFIGURED_APPS += examples/sendmail endif diff --git a/examples/sendmail/Makefile b/examples/sendmail/Makefile index 87d66431a..fa9487420 100644 --- a/examples/sendmail/Makefile +++ b/examples/sendmail/Makefile @@ -46,4 +46,6 @@ MAINSRC = sendmail_main.c CONFIG_XYZ_PROGNAME ?= sendmail$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_SENDMAIL + include $(APPDIR)/Application.mk diff --git a/examples/serialblaster/Kconfig b/examples/serialblaster/Kconfig index 1fb5f66f7..e3c280869 100644 --- a/examples/serialblaster/Kconfig +++ b/examples/serialblaster/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_SERIALBLASTER - bool "Serial Blaster example" + tristate "Serial Blaster example" default n ---help--- Enable the serial blaster example diff --git a/examples/serialblaster/Make.defs b/examples/serialblaster/Make.defs index 4c20520b7..3dc7e59fa 100644 --- a/examples/serialblaster/Make.defs +++ b/examples/serialblaster/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_SERIALBLASTER),y) +ifneq ($(CONFIG_EXAMPLES_SERIALBLASTER),) CONFIGURED_APPS += examples/serialblaster endif diff --git a/examples/serialblaster/Makefile b/examples/serialblaster/Makefile index 8d35eeef0..5eda0d4be 100644 --- a/examples/serialblaster/Makefile +++ b/examples/serialblaster/Makefile @@ -53,4 +53,6 @@ APPNAME = serialblaster PRIORITY = $(CONFIG_EXAMPLES_SERIALBLASTER_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_SERIALBLASTER_STACKSIZE) +MODULE = CONFIG_EXAMPLES_SERIALBLASTER + include $(APPDIR)/Application.mk diff --git a/examples/serialrx/Kconfig b/examples/serialrx/Kconfig index 9a98688a0..2193e22d5 100644 --- a/examples/serialrx/Kconfig +++ b/examples/serialrx/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_SERIALRX - bool "Serial RX example" + tristate "Serial RX example" default n ---help--- Enable the serial RX example diff --git a/examples/serialrx/Make.defs b/examples/serialrx/Make.defs index 3b018bb08..629cc8eb6 100644 --- a/examples/serialrx/Make.defs +++ b/examples/serialrx/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_SERIALRX),y) +ifneq ($(CONFIG_EXAMPLES_SERIALRX),) CONFIGURED_APPS += examples/serialrx endif diff --git a/examples/serialrx/Makefile b/examples/serialrx/Makefile index b95087bee..d2fd40de6 100644 --- a/examples/serialrx/Makefile +++ b/examples/serialrx/Makefile @@ -53,4 +53,6 @@ APPNAME = serialrx PRIORITY = $(CONFIG_EXAMPLES_SERIALRX_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_SERIALRX_STACKSIZE) +MODULE = CONFIG_EXAMPLES_SERIALRX + include $(APPDIR)/Application.mk diff --git a/examples/serloop/Kconfig b/examples/serloop/Kconfig index ff8e0e82c..c4b0dea74 100644 --- a/examples/serloop/Kconfig +++ b/examples/serloop/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_SERLOOP - bool "Serial loopback example" + tristate "Serial loopback example" default n ---help--- Enable the serial loopback example diff --git a/examples/serloop/Make.defs b/examples/serloop/Make.defs index 703dd605b..d055d0848 100644 --- a/examples/serloop/Make.defs +++ b/examples/serloop/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_SERLOOP),y) +ifneq ($(CONFIG_EXAMPLES_SERLOOP),) CONFIGURED_APPS += examples/serloop endif diff --git a/examples/serloop/Makefile b/examples/serloop/Makefile index 102a2474e..06b826632 100644 --- a/examples/serloop/Makefile +++ b/examples/serloop/Makefile @@ -46,4 +46,6 @@ MAINSRC = serloop_main.c CONFIG_XYZ_PROGNAME ?= serloop$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_SERLOOP + include $(APPDIR)/Application.mk diff --git a/examples/slcd/Kconfig b/examples/slcd/Kconfig index 2aa189349..6d4e9cb3e 100644 --- a/examples/slcd/Kconfig +++ b/examples/slcd/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_SLCD - bool "Segment LCD test" + tristate "Segment LCD test" default n ---help--- Enables a simple test of an alphanumer, segment LCD diff --git a/examples/slcd/Make.defs b/examples/slcd/Make.defs index 8f51d2d77..e88e9459c 100644 --- a/examples/slcd/Make.defs +++ b/examples/slcd/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_SLCD),y) +ifneq ($(CONFIG_EXAMPLES_SLCD),) CONFIGURED_APPS += examples/slcd endif diff --git a/examples/slcd/Makefile b/examples/slcd/Makefile index d22a55517..b86944dcf 100644 --- a/examples/slcd/Makefile +++ b/examples/slcd/Makefile @@ -50,4 +50,6 @@ MAINSRC = slcd_main.c CONFIG_XYZ_PROGNAME ?= slcd$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_SLCD + include $(APPDIR)/Application.mk diff --git a/examples/smart/Kconfig b/examples/smart/Kconfig index f75561888..7b3b4968b 100644 --- a/examples/smart/Kconfig +++ b/examples/smart/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_SMART - bool "SMART file system example" + tristate "SMART file system example" default n ---help--- Enable the SMART file system example diff --git a/examples/smart/Make.defs b/examples/smart/Make.defs index 3f60f6f37..d62a0f021 100644 --- a/examples/smart/Make.defs +++ b/examples/smart/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_SMART),y) +ifneq ($(CONFIG_EXAMPLES_SMART),) CONFIGURED_APPS += examples/smart endif diff --git a/examples/smart/Makefile b/examples/smart/Makefile index 0f30aca86..859add7fe 100644 --- a/examples/smart/Makefile +++ b/examples/smart/Makefile @@ -46,4 +46,6 @@ MAINSRC = smart_main.c CONFIG_XYZ_PROGNAME ?= smart$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_SMART + include $(APPDIR)/Application.mk diff --git a/examples/smart_test/Kconfig b/examples/smart_test/Kconfig index 478d00728..8a591ee5f 100644 --- a/examples/smart_test/Kconfig +++ b/examples/smart_test/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_SMART_TEST - bool "SMART filesystem test tool" + tristate "SMART filesystem test tool" default n depends on NSH_BUILTIN_APPS ---help--- diff --git a/examples/smart_test/Make.defs b/examples/smart_test/Make.defs index 7b478d2e2..c1c82da9f 100644 --- a/examples/smart_test/Make.defs +++ b/examples/smart_test/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_SMART_TEST),y) +ifneq ($(CONFIG_EXAMPLES_SMART_TEST),) CONFIGURED_APPS += examples/smart_test endif diff --git a/examples/smart_test/Makefile b/examples/smart_test/Makefile index a7449252d..0d27f6789 100644 --- a/examples/smart_test/Makefile +++ b/examples/smart_test/Makefile @@ -53,4 +53,6 @@ MAINSRC = smart_test.c CONFIG_XYZ_PROGNAME ?= smart_test$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_SMART_TEST + include $(APPDIR)/Application.mk diff --git a/examples/smp/Kconfig b/examples/smp/Kconfig index a3eb0ff4b..cbcf987ed 100644 --- a/examples/smp/Kconfig +++ b/examples/smp/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_SMP - bool "SMP example" + tristate "SMP example" default n ---help--- Enable the SMP example. This example basically extracts the pthread diff --git a/examples/smp/Make.defs b/examples/smp/Make.defs index b1c8fe6b5..3ad522e77 100644 --- a/examples/smp/Make.defs +++ b/examples/smp/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_SMP),y) +ifneq ($(CONFIG_EXAMPLES_SMP),) CONFIGURED_APPS += examples/smp endif diff --git a/examples/smp/Makefile b/examples/smp/Makefile index 7e2ff28dd..cddd844fe 100644 --- a/examples/smp/Makefile +++ b/examples/smp/Makefile @@ -53,4 +53,6 @@ MAINSRC = smp_main.c CONFIG_EXAMPLES_SMP_PROGNAME ?= smp$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_SMP_PROGNAME) +MODULE = CONFIG_EXAMPLES_SMP + include $(APPDIR)/Application.mk diff --git a/examples/smps/Kconfig b/examples/smps/Kconfig index 40db2fdf0..2d45b0ebd 100644 --- a/examples/smps/Kconfig +++ b/examples/smps/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_SMPS - bool "Smps example" + tristate "Smps example" if EXAMPLES_SMPS diff --git a/examples/smps/Make.defs b/examples/smps/Make.defs index bae9a58d8..7f3a0d36c 100644 --- a/examples/smps/Make.defs +++ b/examples/smps/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_SMPS),y) +ifneq ($(CONFIG_EXAMPLES_SMPS),) CONFIGURED_APPS += examples/smps endif diff --git a/examples/smps/Makefile b/examples/smps/Makefile index 710d316cb..9e888651c 100644 --- a/examples/smps/Makefile +++ b/examples/smps/Makefile @@ -49,4 +49,6 @@ PROGNAME = $(CONFIG_EXAMPLES_SMPS_PROGNAME) PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 1024 +MODULE = CONFIG_EXAMPLES_SMPS + include $(APPDIR)/Application.mk diff --git a/examples/sotest/Kconfig b/examples/sotest/Kconfig index c2a2958cb..69c475d22 100644 --- a/examples/sotest/Kconfig +++ b/examples/sotest/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_SOTEST - bool "Shared Library Example" + tristate "Shared Library Example" default n depends on LIBC_DLLFCN ---help--- diff --git a/examples/sotest/Make.defs b/examples/sotest/Make.defs index 960b3ef55..f503e2efc 100644 --- a/examples/sotest/Make.defs +++ b/examples/sotest/Make.defs @@ -33,6 +33,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_SOTEST),y) +ifneq ($(CONFIG_EXAMPLES_SOTEST),) CONFIGURED_APPS += examples/sotest endif diff --git a/examples/sotest/Makefile b/examples/sotest/Makefile index 0575016f3..309345630 100644 --- a/examples/sotest/Makefile +++ b/examples/sotest/Makefile @@ -33,14 +33,11 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs OBJEXT ?= .o DELIM ?= / -include $(APPDIR)/Make.defs - # Shared library example built-in application info APPNAME = sotest @@ -49,110 +46,24 @@ STACKSIZE = 2048 # Shared Library Example -ASRCS = CSRCS = sot_symtab.c MAINSRC = sotest_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -CONFIG_XYZ_PROGNAME ?= discover$(EXEEXT) +CONFIG_XYZ_PROGNAME ?= sotest$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . --dep-path lib +ROOTDEPPATH += --dep-path lib # Build targets VPATH = lib -all: .built -.PHONY: really_build clean_lib clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -# This is a little messy. The build is broken into two pieces: (1) the -# lib/ subdir build that auto-generates several files, and (2) the real -# build. This is done because we need a fresh build context after auto- -# generating the source files. - -really_build: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -.built: +context:: @$(MAKE) -C lib TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) - @$(MAKE) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" really_build -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# We can't make dependencies in this directory because the required -# header files may not yet exist. - -.depend: - @touch $@ - -depend: .depend - -clean_lib: +clean:: @$(MAKE) -C lib TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) clean -clean: clean_lib - $(call DELFILE, .built) - $(call CLEAN) +MODULE = CONFIG_EXAMPLES_SOTEST -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/stat/Kconfig b/examples/stat/Kconfig index b5a101d08..fea6f4819 100644 --- a/examples/stat/Kconfig +++ b/examples/stat/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_STAT - bool "Test of stat(), fstat(), and statfs()" + tristate "Test of stat(), fstat(), and statfs()" default n ---help--- Enable the test of stat(), fstat(), and statfs(). diff --git a/examples/stat/Make.defs b/examples/stat/Make.defs index 8deb74e67..f9de4b3c0 100644 --- a/examples/stat/Make.defs +++ b/examples/stat/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_STAT),y) +ifneq ($(CONFIG_EXAMPLES_STAT),) CONFIGURED_APPS += examples/stat endif diff --git a/examples/stat/Makefile b/examples/stat/Makefile index 34a6f4465..4ec2e05bd 100644 --- a/examples/stat/Makefile +++ b/examples/stat/Makefile @@ -53,4 +53,6 @@ MAINSRC = stat_main.c CONFIG_EXAMPLES_STAT_PROGNAME ?= stat$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_STAT_PROGNAME) +MODULE = CONFIG_EXAMPLES_STAT + include $(APPDIR)/Application.mk diff --git a/examples/system/Kconfig b/examples/system/Kconfig index ad5f1d207..4f5be20fd 100644 --- a/examples/system/Kconfig +++ b/examples/system/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_SYSTEM - bool "System() example" + tristate "System() example" default n depends on SYSTEM_SYSTEM ---help--- diff --git a/examples/system/Make.defs b/examples/system/Make.defs index 6a23001cf..26543fe72 100644 --- a/examples/system/Make.defs +++ b/examples/system/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_SYSTEM),y) +ifneq ($(CONFIG_EXAMPLES_SYSTEM),) CONFIGURED_APPS += examples/system endif diff --git a/examples/system/Makefile b/examples/system/Makefile index 7d447218c..180e12824 100644 --- a/examples/system/Makefile +++ b/examples/system/Makefile @@ -53,4 +53,6 @@ MAINSRC = system_main.c CONFIG_EXAMPLES_SYSTEM_PROGNAME ?= system$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_SYSTEM_PROGNAME) +MODULE = CONFIG_EXAMPLES_SYSTEM + include $(APPDIR)/Application.mk diff --git a/examples/tcpblaster/Kconfig b/examples/tcpblaster/Kconfig index 7bd87f56a..ee6612fa3 100644 --- a/examples/tcpblaster/Kconfig +++ b/examples/tcpblaster/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_TCPBLASTER - bool "TCP Performance Test" + tristate "TCP Performance Test" default n depends on NET_TCP ---help--- diff --git a/examples/tcpblaster/Make.defs b/examples/tcpblaster/Make.defs index f19df0e49..5fa794821 100644 --- a/examples/tcpblaster/Make.defs +++ b/examples/tcpblaster/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_TCPBLASTER),y) +ifneq ($(CONFIG_EXAMPLES_TCPBLASTER),) CONFIGURED_APPS += examples/tcpblaster endif diff --git a/examples/tcpblaster/Makefile b/examples/tcpblaster/Makefile index 4aad15a41..028a36877 100644 --- a/examples/tcpblaster/Makefile +++ b/examples/tcpblaster/Makefile @@ -33,110 +33,73 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Basic TCP networking test -TARGCMN_CSRCS = tcpblaster_cmdline.c +CSRCS = tcpblaster_cmdline.c ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_INIT),y) -TARGCMN_CSRCS += tcpblaster_netinit.c +CSRCS += tcpblaster_netinit.c endif -TARGCMN_COBJS = $(TARGCMN_CSRCS:.c=$(OBJEXT)) - # Target 1 Files -TARG1_CSRCS = ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_LOOPBACK),y) -TARG1_CSRCS += tcpblaster_server.c tcpblaster_client.c +CSRCS += tcpblaster_server.c tcpblaster_client.c else ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_SERVER),y) -TARG1_CSRCS += tcpblaster_server.c +CSRCS += tcpblaster_server.c else -TARG1_CSRCS += tcpblaster_client.c +CSRCS += tcpblaster_client.c endif -TARG1_MAINSRC = tcpblaster_target1.c - -TARG1_COBJS = $(TARG1_CSRCS:.c=$(OBJEXT)) -TARG1_MAINOBJ = $(TARG1_MAINSRC:.c=$(OBJEXT)) - -TARG_CSRCS = $(TARG1_CSRCS) $(TARG1_CSRCS) $(TARGCMN_CSRCS) -TARG_OBJS = $(TARG1_COBJS) $(TARGCMN_COBJS) +MAINSRC = tcpblaster_target1.c # Target 1 Application Info ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_SERVER),y) CONFIG_EXAMPLES_TCPBLASTER_PROGNAME1 ?= tcpserver -APPNAME1 = tcpserver else CONFIG_EXAMPLES_TCPBLASTER_PROGNAME1 ?= tcpclient -APPNAME1 = tcpclient endif CONFIG_EXAMPLES_TCPBLASTER_PRIORITY1 ?= 100 CONFIG_EXAMPLES_TCPBLASTER_STACKSIZE1 ?= 2048 -PROGNAME1 = $(CONFIG_EXAMPLES_TCPBLASTER_PROGNAME1) -PRIORITY1 = $(CONFIG_EXAMPLES_TCPBLASTER_PRIORITY1) -STACKSIZE1 = $(CONFIG_EXAMPLES_TCPBLASTER_STACKSIZE1) +PROGNAME = $(CONFIG_EXAMPLES_TCPBLASTER_PROGNAME1) +PRIORITY = $(CONFIG_EXAMPLES_TCPBLASTER_PRIORITY1) +STACKSIZE = $(CONFIG_EXAMPLES_TCPBLASTER_STACKSIZE1) # Target 2 ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_TARGET2),y) -TARG2_CSRCS = ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_SERVER),y) -TARG2_CSRCS += tcpblaster_client.c +CSRCS += tcpblaster_client.c else -TARG2_CSRCS += tcpblaster_server.c +CSRCS += tcpblaster_server.c endif -TARG2_MAINSRC = tcpblaster_target2.c - -TARG2_COBJS = $(TARG2_CSRCS:.c=$(OBJEXT)) -TARG2_MAINOBJ = $(TARG2_MAINSRC:.c=$(OBJEXT)) +MAINSRC += tcpblaster_target2.c # Target 2 Application Info ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_SERVER),y) CONFIG_EXAMPLES_TCPBLASTER_PROGNAME2 ?= tcpclient -APPNAME2 = tcpclient else CONFIG_EXAMPLES_TCPBLASTER_PROGNAME2 ?= tcpserver -APPNAME2 = tcpserver endif CONFIG_EXAMPLES_TCPBLASTER_PRIORITY2 ?= 100 CONFIG_EXAMPLES_TCPBLASTER_STACKSIZE2 ?= 2048 -PROGNAME2 = $(CONFIG_EXAMPLES_TCPBLASTER_PROGNAME2) -PRIORITY2 = $(CONFIG_EXAMPLES_TCPBLASTER_PRIORITY2) -STACKSIZE2 = $(CONFIG_EXAMPLES_TCPBLASTER_STACKSIZE2) +PROGNAME += $(CONFIG_EXAMPLES_TCPBLASTER_PROGNAME2) +PRIORITY += $(CONFIG_EXAMPLES_TCPBLASTER_PRIORITY2) +STACKSIZE += $(CONFIG_EXAMPLES_TCPBLASTER_STACKSIZE2) endif # All targets -TARG_SRCS = $(TARG1_CRCS) $(TARG1_MAINSRC) $(TARG2_CSRCS) $(TARG2_MAINSRC) $(TARGCMN_CSRCS) -TARG_OBJS = $(TARG1_COBJS) $(TARG2_COBJS) $(TARGCMN_COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - TARG_OBJS += $(TARG1_MAINOBJ) $(TARG2_MAINOBJ) -endif - ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_TARGET2),y) -MAINNAME1 = tcpblaster1_main -MAINNAME2 = tcpblaster2_main +APPNAME = tcpblaster1 tcpblaster2 else -MAINNAME1 = tcpblaster_main -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - TARG_BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - TARG_BIN = ..\\..\\libapps$(LIBEXT) -else - TARG_BIN = ../../libapps$(LIBEXT) -endif +APPNAME = tcpblaster endif # Host @@ -164,25 +127,8 @@ ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_LOOPBACK),y) endif endif -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - # Common build -VPATH = - -all: .built $(HOST_BIN) -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(TARG1_COBJS) $(TARG1_MAINOBJ) $(TARG2_COBJS) $(TARG2_MAINOBJ) $(TARGCMN_COBJS) : %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_TARGET2),y) ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_LOOPBACK),y) @@ -207,62 +153,18 @@ $(HOST_BIN): config.h $(HOST_OBJS) endif endif -.built: config.h $(TARG_OBJS) - $(call ARCHIVE, $(TARG_BIN), $(TARG_OBJS)) - $(Q) touch .built +context:: config.h $(HOST_BIN) -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME1): $(OBJS) $(TARG1_MAINOBJ) - @echo "LD: $(PROGNAME1)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME1) $(ARCHCRT0OBJ) $(TARG1_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME1) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME1) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(if $(CONFIG_BUILD_LOADABLE),,$(MAINNAME1))) - -ifeq ($(CONFIG_EXAMPLES_TCPBLASTER_TARGET2),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME2),$(PRIORITY2),$(STACKSIZE2),$(if $(CONFIG_BUILD_LOADABLE),,$(MAINNAME2))) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat \ - $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat -else -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat -endif -else -context: -endif - -.depend: Makefile config.h $(TARG_CSRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(TARG_CSRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: +clean:: ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_TARGET2),y) ifneq ($(CONFIG_EXAMPLES_TCPBLASTER_LOOPBACK),y) $(call DELFILE, *.$(HOSTOBJEXT)) $(call DELFILE, $(HOST_BIN)) endif endif - $(call DELFILE, .built) $(call DELFILE, *.dSYM) $(call DELFILE, config.h) - $(call CLEAN) -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +MODULE = CONFIG_EXAMPLES_TCPBLASTER -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/tcpblaster/tcpblaster_target1.c b/examples/tcpblaster/tcpblaster_target1.c index 6af107275..4e1be3158 100644 --- a/examples/tcpblaster/tcpblaster_target1.c +++ b/examples/tcpblaster/tcpblaster_target1.c @@ -69,7 +69,7 @@ static int server_child(int argc, char *argv[]) * tcpblaster_main ****************************************************************************/ -#if defined(CONFIG_BUILD_LOADABLE) +#if defined(BUILD_MODULE) int main(int argc, FAR char *argv[]) #elif defined(CONFIG_EXAMPLES_TCPBLASTER_TARGET2) int tcpblaster1_main(int argc, char *argv[]) diff --git a/examples/tcpecho/Kconfig b/examples/tcpecho/Kconfig index b39e6abd8..3c53814b1 100644 --- a/examples/tcpecho/Kconfig +++ b/examples/tcpecho/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_TCPECHO - bool "Simple TCP echo server" + tristate "Simple TCP echo server" default n ---help--- Simple single threaded, poll based TCP echo server. This example diff --git a/examples/tcpecho/Make.defs b/examples/tcpecho/Make.defs index e303b56d3..02c1c0ff1 100644 --- a/examples/tcpecho/Make.defs +++ b/examples/tcpecho/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_TCPECHO),y) +ifneq ($(CONFIG_EXAMPLES_TCPECHO),) CONFIGURED_APPS += examples/tcpecho endif diff --git a/examples/tcpecho/Makefile b/examples/tcpecho/Makefile index fb28fda28..466a1b77f 100644 --- a/examples/tcpecho/Makefile +++ b/examples/tcpecho/Makefile @@ -51,4 +51,6 @@ MAINSRC = tcpecho_main.c CONFIG_XYZ_PROGNAME ?= tcpecho$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_TCPECHO + include $(APPDIR)/Application.mk diff --git a/examples/telnetd/Kconfig b/examples/telnetd/Kconfig index 99533dbad..5a5663e30 100644 --- a/examples/telnetd/Kconfig +++ b/examples/telnetd/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_TELNETD - bool "Telnet daemon example" + tristate "Telnet daemon example" default n depends on NETUTILS_TELNETD ---help--- diff --git a/examples/telnetd/Make.defs b/examples/telnetd/Make.defs index 6413ef173..be27827e7 100644 --- a/examples/telnetd/Make.defs +++ b/examples/telnetd/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_TELNETD),y) +ifneq ($(CONFIG_EXAMPLES_TELNETD),) CONFIGURED_APPS += examples/telnetd endif diff --git a/examples/telnetd/Makefile b/examples/telnetd/Makefile index f0f0dcec5..3d2800a3f 100644 --- a/examples/telnetd/Makefile +++ b/examples/telnetd/Makefile @@ -50,4 +50,6 @@ APPNAME = telnetd PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_TELNETD + include $(APPDIR)/Application.mk diff --git a/examples/thttpd/Kconfig b/examples/thttpd/Kconfig index a74c848b4..b4209e9cd 100644 --- a/examples/thttpd/Kconfig +++ b/examples/thttpd/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_THTTPD - bool "THTTPD web server example" + tristate "THTTPD web server example" default n depends on FS_ROMFS && BUILD_FLAT ---help--- diff --git a/examples/thttpd/Make.defs b/examples/thttpd/Make.defs index 64c6f62aa..9bf92c16d 100644 --- a/examples/thttpd/Make.defs +++ b/examples/thttpd/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_THTTPD),y) +ifneq ($(CONFIG_EXAMPLES_THTTPD),) CONFIGURED_APPS += examples/thttpd endif diff --git a/examples/thttpd/Makefile b/examples/thttpd/Makefile index 172620442..d1a5fd4e2 100644 --- a/examples/thttpd/Makefile +++ b/examples/thttpd/Makefile @@ -33,43 +33,12 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # THTTPD Web Server Example -ASRCS = -CSRCS = MAINSRC = thttpd_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONTENT_MAKE = $(MAKE) -C content ifeq ($(CONFIG_THTTPD_BINFS),y) CONTENT_MAKE += -f Makefile.binfs @@ -80,62 +49,20 @@ endif CONFIG_XYZ_PROGNAME ?= thttpd$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Common build -VPATH = +all:: -all: .built -.PHONY: headers clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -headers: - @$(CONTENT_MAKE) headers TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) - -.built: headers $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @$(CONTENT_MAKE) binaries TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -context: +context:: @$(CONTENT_MAKE) context TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) -.depend: Makefile $(SRCS) +depend:: @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend @$(CONTENT_MAKE) depend TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) -clean: - $(call DELFILE, .built) +clean:: @$(CONTENT_MAKE) clean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" CROSSDEV=$(CROSSDEV) - $(call CLEAN) -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +MODULE = CONFIG_EXAMPLES_THTTPD -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/thttpd/content/Makefile.binfs b/examples/thttpd/content/Makefile.binfs index 6a530396e..999f9cdb7 100644 --- a/examples/thttpd/content/Makefile.binfs +++ b/examples/thttpd/content/Makefile.binfs @@ -33,13 +33,12 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs CONFIG_THTTPD_CGI_PRIORITY ?= 100 CONFIG_THTTPD_CGI_STACKSIZE ?= 2048 +APPNAME = hello tasks PRIORITY = $(CONFIG_THTTPD_CGI_PRIORITY) STACKSIZE = $(CONFIG_THTTPD_CGI_STACKSIZE) @@ -49,42 +48,12 @@ ROMFS_DIR = $(CONTENT_DIR)/romfs ROMFS_IMG = $(CONTENT_DIR)/romfs.img ROMFS_HDR = $(CONTENT_DIR)/romfs.h -ASRCS = CSRCS = hello.c tasks.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) +PROGNAME = hello$(EXEEXT) tasks$(EXEEXT) -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\..\\libapps$(LIBEXT) -else - BIN = ../../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path hello --dep-path tasks -VPATH = hello:tasks - -all: .built -.PHONY: context headers binaries depend clean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) +ROOTDEPPATH += --dep-path hello --dep-path tasks +VPATH += :hello:tasks # Create the romfs directory @@ -111,37 +80,13 @@ $(ROMFS_IMG): populate $(ROMFS_HDR) : $(ROMFS_IMG) @(cd $(CONTENT_DIR); xxd -i romfs.img | sed -e "s/^unsigned/static const unsigned/g" >$@) -.built: $(ROMFS_HDR) $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built +context:: $(ROMFS_HDR) -binaries: .built - -headers: $(ROMFS_HDR) - -$(BUILTIN_REGISTRY)$(DELIM)hello_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,hello,$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,hello_main)) - -$(BUILTIN_REGISTRY)$(DELIM)tasks_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,tasks,$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,tasks_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)hello_main.bdat $(BUILTIN_REGISTRY)$(DELIM)tasks_main.bdat - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: +clean:: $(call DELFILE$(ROMFS_HDR)) $(call DELFILE, $(ROMFS_IMG)) @rm -rf $(ROMFS_DIR) - $(call DELFILE, .built) - $(call CLEAN) -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +MODULE = CONFIG_EXAMPLES_THTTPD --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/tiff/Kconfig b/examples/tiff/Kconfig index e75655707..a64428185 100644 --- a/examples/tiff/Kconfig +++ b/examples/tiff/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_TIFF - bool "TIFF file generation example" + tristate "TIFF file generation example" default n ---help--- Enable the TIFF file generation example diff --git a/examples/tiff/Make.defs b/examples/tiff/Make.defs index 5121c255b..158f8e03a 100644 --- a/examples/tiff/Make.defs +++ b/examples/tiff/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_TIFF),y) +ifneq ($(CONFIG_EXAMPLES_TIFF),) CONFIGURED_APPS += examples/tiff endif diff --git a/examples/tiff/Makefile b/examples/tiff/Makefile index 3cd8ac43e..7f682c7da 100644 --- a/examples/tiff/Makefile +++ b/examples/tiff/Makefile @@ -33,111 +33,19 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # TIFF Unit Test -ASRCS = -CSRCS = MAINSRC = tiff_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= tiff$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# TIFF built-in application info - APPNAME = tiff PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build +MODULE = CONFIG_EXAMPLES_TIFF -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call DELFILE, result.tif) - $(call DELFILE, tmpfile1.dat) - $(call DELFILE, tmpfile2.dat) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/timer/Kconfig b/examples/timer/Kconfig index ab828d6fb..f8bad5df9 100644 --- a/examples/timer/Kconfig +++ b/examples/timer/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_TIMER - bool "Timer example" + tristate "Timer example" default n depends on TIMER && BUILD_FLAT ---help--- diff --git a/examples/timer/Make.defs b/examples/timer/Make.defs index 16437a79f..d160bac00 100644 --- a/examples/timer/Make.defs +++ b/examples/timer/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_TIMER),y) +ifneq ($(CONFIG_EXAMPLES_TIMER),) CONFIGURED_APPS += examples/timer endif diff --git a/examples/timer/Makefile b/examples/timer/Makefile index fec6936f8..c2e047507 100644 --- a/examples/timer/Makefile +++ b/examples/timer/Makefile @@ -53,4 +53,6 @@ ASRCS = CSRCS = MAINSRC = timer_main.c +MODULE = CONFIG_EXAMPLES_TIMER + include $(APPDIR)/Application.mk diff --git a/examples/touchscreen/Kconfig b/examples/touchscreen/Kconfig index a0c3de339..dc2572c41 100644 --- a/examples/touchscreen/Kconfig +++ b/examples/touchscreen/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_TOUCHSCREEN - bool "Touchscreen example" + tristate "Touchscreen example" default n ---help--- Enable the touchscreen example diff --git a/examples/touchscreen/Make.defs b/examples/touchscreen/Make.defs index f272a4022..df3d24baf 100644 --- a/examples/touchscreen/Make.defs +++ b/examples/touchscreen/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_TOUCHSCREEN),y) +ifneq ($(CONFIG_EXAMPLES_TOUCHSCREEN),) CONFIGURED_APPS += examples/touchscreen endif diff --git a/examples/touchscreen/Makefile b/examples/touchscreen/Makefile index 9fa44f4cf..a8a04c473 100644 --- a/examples/touchscreen/Makefile +++ b/examples/touchscreen/Makefile @@ -50,4 +50,6 @@ APPNAME = tc PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_TOUCHSCREEN + include $(APPDIR)/Application.mk diff --git a/examples/udgram/Kconfig b/examples/udgram/Kconfig index ca9e3d9f5..1b6433bd7 100644 --- a/examples/udgram/Kconfig +++ b/examples/udgram/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_UDGRAM - bool "Unix domain datagram example" + tristate "Unix domain datagram example" default n depends on NET_LOCAL ---help--- diff --git a/examples/udgram/Make.defs b/examples/udgram/Make.defs index e36058f35..3ebce3323 100644 --- a/examples/udgram/Make.defs +++ b/examples/udgram/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_UDGRAM),y) +ifneq ($(CONFIG_EXAMPLES_UDGRAM),) CONFIGURED_APPS += examples/udgram endif diff --git a/examples/udgram/Makefile b/examples/udgram/Makefile index f02b1043b..ecccb52d3 100644 --- a/examples/udgram/Makefile +++ b/examples/udgram/Makefile @@ -33,151 +33,26 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Basic Unix domain networking test -SERVER_ASRCS = -SERVER_AOBJS = $(SERVER_ASRCS:.S=$(OBJEXT)) +MAINSRC = udgram_client.c udgram_server.c -SERVER_CSRCS = -SERVER_COBJS = $(SERVER_CSRCS:.c=$(OBJEXT)) +PROGNAME = client$(EXEEXT) server$(EXEEXT) +APPNAME = client server -SERVER_MAINSRC = udgram_server.c -SERVER_MAINOBJ = $(SERVER_MAINSRC:.c=$(OBJEXT)) - -SERVER_SRCS = $(SERVER_ASRCS) $(SERVER_CSRCS) $(SERVER_MAINSRC) -SERVER_OBJS = $(SERVER_AOBJS) $(SERVER_COBJS) - -CONFIG_EXAMPLES_UDGRAM_SERVER_APPNAME ?= server CONFIG_EXAMPLES_UDGRAM_SERVER_STACKSIZE ?= 4096 CONFIG_EXAMPLES_UDGRAM_SERVER_PRIORITY ?= SCHED_PRIORITY_DEFAULT -CONFIG_EXAMPLES_UDGRAM_SERVER_PROGNAME ?= server$(EXEEXT) -SERVER_APPNAME = $(CONFIG_EXAMPLES_UDGRAM_SERVER_APPNAME) -SERVER_PRIORITY = $(CONFIG_EXAMPLES_UDGRAM_SERVER_PRIORITY) -SERVER_STACKSIZE = $(CONFIG_EXAMPLES_UDGRAM_SERVER_STACKSIZE) -SERVER_PROGNAME = $(CONFIG_EXAMPLES_UDGRAM_SERVER_PROGNAME) - -CLIENT_ASRCS = -CLIENT_AOBJS = $(CLIENT_ASRCS:.S=$(OBJEXT)) - -CLIENT_CSRCS = -CLIENT_COBJS = $(CLIENT_CSRCS:.c=$(OBJEXT)) - -CLIENT_MAINSRC = udgram_client.c -CLIENT_MAINOBJ = $(CLIENT_MAINSRC:.c=$(OBJEXT)) - -CLIENT_SRCS = $(CLIENT_ASRCS) $(CLIENT_CSRCS) $(CLIENT_MAINSRC) -CLIENT_OBJS = $(CLIENT_AOBJS) $(CLIENT_COBJS) - -CONFIG_EXAMPLES_UDGRAM_CLIENT_APPNAME ?= client -CONFIG_EXAMPLES_UDGRAM_CLIENT_STACKSIZE ?= 4096 +CONFIG_EXAMPLES_UDGRAM_CLIENT_STACKSIZE ?= 2048 CONFIG_EXAMPLES_UDGRAM_CLIENT_PRIORITY ?= SCHED_PRIORITY_DEFAULT -CONFIG_EXAMPLES_UDGRAM_CLIENT_PROGNAME ?= client(EXEEXT) -CLIENT_APPNAME = $(CONFIG_EXAMPLES_UDGRAM_CLIENT_APPNAME) -CLIENT_PRIORITY = $(CONFIG_EXAMPLES_UDGRAM_CLIENT_PRIORITY) -CLIENT_STACKSIZE = $(CONFIG_EXAMPLES_UDGRAM_CLIENT_STACKSIZE) -CLIENT_PROGNAME = $(CONFIG_EXAMPLES_UDGRAM_CLIENT_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_UDGRAM_CLIENT_PRIORITY) +PRIORITY += $(CONFIG_EXAMPLES_UDGRAM_SERVER_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_UDGRAM_CLIENT_STACKSIZE) +STACKSIZE += $(CONFIG_EXAMPLES_UDGRAM_SERVER_STACKSIZE) -AOBJS = $(CLIENT_AOBJS) $(SERVER_AOBJS) -COBJS = $(CLIENT_COBJS) $(CLIENT_MAINOBJ) $(SERVER_COBJS) $(SERVER_MAINOBJ) +MODULE = CONFIG_EXAMPLES_UDGRAM -SRCS = $(CLIENT_SRCS) $(SERVER_SRCS) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - SERVER_OBJS += $(SERVER_MAINOBJ) - CLIENT_OBJS += $(CLIENT_MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - UDGRAM_BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - UDGRAM_BIN = ..\\..\\libapps$(LIBEXT) -else - UDGRAM_BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(UDGRAM_BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) - -$(BIN_DIR)$(DELIM)$(CLIENT_PROGNAME): $(CLIENT_OBJS) - @echo "LD: $(CLIENT_PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(CLIENT_PROGNAME) $(ARCHCRT0OBJ) $(CLIENT_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(CLIENT_PROGNAME) - -$(BIN_DIR)$(DELIM)$(SERVER_PROGNAME): $(OBJS) $(SERVER_MAINOBJ) - @echo "LD: $(SERVER_PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(SERVER_PROGNAME) $(ARCHCRT0OBJ) $(SERVER_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(SERVER_PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(CLIENT_PROGNAME) $(BIN_DIR)$(DELIM)$(SERVER_PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) - -$(BUILTIN_REGISTRY)$(DELIM)$(CLIENT_APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(CLIENT_APPNAME),$(CLIENT_PRIORITY),$(CLIENT_STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(CLIENT_APPNAME)_main)) - -$(BUILTIN_REGISTRY)$(DELIM)$(SERVER_APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(SERVER_APPNAME),$(SERVER_PRIORITY),$(SERVER_STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(SERVER_APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(CLIENT_APPNAME)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(SERVER_APPNAME)_main.bdat - -else - -context: - -endif - -.depend: Makefile $(SERVER_SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SERVER_SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call DELFILE, *.dSYM) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/udp/Kconfig b/examples/udp/Kconfig index 57a18e36e..ce45413d6 100644 --- a/examples/udp/Kconfig +++ b/examples/udp/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_UDP - bool "UDP example" + tristate "UDP example" default n depends on NET_UDP ---help--- diff --git a/examples/udp/Make.defs b/examples/udp/Make.defs index b3a0f4370..ddc933dd7 100644 --- a/examples/udp/Make.defs +++ b/examples/udp/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_UDP),y) +ifneq ($(CONFIG_EXAMPLES_UDP),) CONFIGURED_APPS += examples/udp endif diff --git a/examples/udp/Makefile b/examples/udp/Makefile index 629b1a43b..fabf8436d 100644 --- a/examples/udp/Makefile +++ b/examples/udp/Makefile @@ -33,84 +33,61 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # UDP Test -TARGCMN_CSRCS = udp_cmdline.c +CSRCS = udp_cmdline.c ifeq ($(CONFIG_EXAMPLES_UDP_NETINIT),y) -TARGCMN_CSRCS += udp_netinit.c +CSRCS += udp_netinit.c endif -TARGCMN_COBJS = $(TARGCMN_CSRCS:.c=$(OBJEXT)) - # Target 1 -TARG1_CRCS = ifeq ($(CONFIG_EXAMPLES_UDP_SERVER1),y) -TARG1_CRCS += udp_server.c +CSRCS += udp_server.c else -TARG1_CRCS += udp_client.c +CSRCS += udp_client.c endif -TARG1_MAINSRC = udp_target1.c - -TARG1_COBJS = $(TARG1_CRCS:.c=$(OBJEXT)) -TARG1_MAINOBJ = $(TARG1_MAINSRC:.c=$(OBJEXT)) +MAINSRC = udp_target1.c ifeq ($(CONFIG_EXAMPLES_UDP_SERVER1),y) CONFIG_EXAMPLES_UDP_PROGNAME1 ?= udpserver -APPNAME1 = udpserver else CONFIG_EXAMPLES_UDP_PROGNAME1 ?= udpclient -APPNAME1 = udpclient endif CONFIG_EXAMPLES_UDP_PRIORITY1 ?= 100 CONFIG_EXAMPLES_UDP_STACKSIZE1 ?= 2048 -PROGNAME1 = $(CONFIG_EXAMPLES_UDP_PROGNAME1) -PRIORITY1 = $(CONFIG_EXAMPLES_UDP_PRIORITY1) -STACKSIZE1 = $(CONFIG_EXAMPLES_UDP_STACKSIZE1) +PROGNAME = $(CONFIG_EXAMPLES_UDP_PROGNAME1) +PRIORITY = $(CONFIG_EXAMPLES_UDP_PRIORITY1) +STACKSIZE = $(CONFIG_EXAMPLES_UDP_STACKSIZE1) # Target 2 ifeq ($(CONFIG_EXAMPLES_UDP_TARGET2),y) -TARG2_CSRCS = ifeq ($(CONFIG_EXAMPLES_UDP_SERVER1),y) -TARG2_CSRCS += udp_client.c +CSRCS += udp_client.c else -TARG2_CSRCS += udp_server.c +CSRCS += udp_server.c endif -TARG2_MAINSRC = udp_target2.c - -TARG2_COBJS = $(TARG2_CSRCS:.c=$(OBJEXT)) -TARG2_MAINOBJ = $(TARG2_MAINSRC:.c=$(OBJEXT)) +MAINSRC += udp_target2.c ifeq ($(CONFIG_EXAMPLES_UDP_SERVER1),y) CONFIG_EXAMPLES_UDP_PROGNAME2 ?= udpclient -APPNAME2 = udpclient else CONFIG_EXAMPLES_UDP_PROGNAME2 ?= udpserver -APPNAME2 = udpserver endif CONFIG_EXAMPLES_UDP_PRIORITY2 ?= 100 CONFIG_EXAMPLES_UDP_STACKSIZE2 ?= 2048 -PROGNAME2 = $(CONFIG_EXAMPLES_UDP_PROGNAME2) -PRIORITY2 = $(CONFIG_EXAMPLES_UDP_PRIORITY2) -STACKSIZE2 = $(CONFIG_EXAMPLES_UDP_STACKSIZE2) +PROGNAME += $(CONFIG_EXAMPLES_UDP_PROGNAME2) +PRIORITY += $(CONFIG_EXAMPLES_UDP_PRIORITY2) +STACKSIZE += $(CONFIG_EXAMPLES_UDP_STACKSIZE2) endif -TARG_SRCS = $(TARG1_CRCS) $(TARG1_MAINSRC) $(TARG2_CSRCS) $(TARG2_MAINSRC) $(TARGCMN_CSRCS) -TARG_OBJS = $(TARG1_COBJS) $(TARG2_COBJS) $(TARGCMN_COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - TARG_OBJS += $(TARG1_MAINOBJ) $(TARG2_MAINOBJ) -endif - # Host ifneq ($(CONFIG_EXAMPLES_UDP_TARGET2),y) @@ -130,45 +107,14 @@ endif HOST_OBJS = $(HOST_SRCS:.c=.$(HOSTOBJSEXT)) endif -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - TARG_BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - TARG_BIN = ..\\..\\libapps$(LIBEXT) -else - TARG_BIN = ../../libapps$(LIBEXT) -endif -endif - ifeq ($(CONFIG_EXAMPLES_UDP_TARGET2),y) -MAINNAME1 = udp1_main -MAINNAME2 = udp2_main +APPNAME = udp1 udp2 else -MAINNAME1 = udp_main +APPNAME = udp endif -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - # Common build -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(TARG1_COBJS) $(TARG1_MAINOBJ) $(TARG2_COBJS) $(TARG2_MAINOBJ) $(TARGCMN_COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -$(TARG_BIN): $(TARG_OBJS) $(HOST_BIN) - $(call ARCHIVE, $@, $(TARG_OBJS)) - ifneq ($(CONFIG_EXAMPLES_UDP_TARGET2),y) $(HOST_OBJS): %.$(HOSTOBJSEXT): %.c @echo "CC: $<" @@ -184,59 +130,16 @@ $(HOST_BIN): config.h $(HOST_OBJS) $(Q) $(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS) -o $@ endif -.built: config.h $(TARG_BIN) $(HOST_BIN) - $(Q) touch .built +context:: config.h $(HOST_BIN) -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME1): $(OBJS) $(TARG1_MAINOBJ) - @echo "LD: $(PROGNAME1)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME1) $(ARCHCRT0OBJ) $(TARG1_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME1) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME1) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(if $(CONFIG_BUILD_LOADABLE),,$(MAINNAME1))) - -ifeq ($(CONFIG_EXAMPLES_UDP_TARGET2),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME2),$(PRIORITY2),$(STACKSIZE2),$(if $(CONFIG_BUILD_LOADABLE),,$(MAINNAME2))) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat \ - $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat -else -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat -endif -else -context: -endif - -.depend: Makefile config.h $(TARG_SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(TARG_SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) +clean:: ifneq ($(CONFIG_EXAMPLES_UDP_TARGET2),y) $(call DELFILE, $(HOST_BIN)) $(call DELFILE, *.$(HOSTOBJSEXT)) endif $(call DELFILE, *.dSYM) $(call DELFILE, config.h) - $(call CLEAN) -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +MODULE = CONFIG_EXAMPLES_UDP -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/udp/udp_target1.c b/examples/udp/udp_target1.c index a8d259e2c..cabc78f79 100644 --- a/examples/udp/udp_target1.c +++ b/examples/udp/udp_target1.c @@ -48,7 +48,7 @@ * udp1_main ****************************************************************************/ -#if defined(CONFIG_BUILD_LOADABLE) +#if defined(BUILD_MODULE) int main(int argc, FAR char *argv[]) #elif defined(CONFIG_EXAMPLES_UDP_TARGET2) int udp1_main(int argc, char *argv[]) diff --git a/examples/udp/udp_target2.c b/examples/udp/udp_target2.c index 390412c41..e0a9ecae9 100644 --- a/examples/udp/udp_target2.c +++ b/examples/udp/udp_target2.c @@ -48,7 +48,7 @@ * udp2_main ****************************************************************************/ -#if defined(CONFIG_BUILD_LOADABLE) +#if defined(BUILD_MODULE) int main(int argc, FAR char *argv[]) #else int udp2_main(int argc, char *argv[]) diff --git a/examples/udpblaster/Kconfig b/examples/udpblaster/Kconfig index fde9e39a4..61516baed 100644 --- a/examples/udpblaster/Kconfig +++ b/examples/udpblaster/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_UDPBLASTER - bool "UDP blaster example" + tristate "UDP blaster example" default n depends on NET_UDP ---help--- diff --git a/examples/udpblaster/Make.defs b/examples/udpblaster/Make.defs index c5c7208bf..67d8030fa 100644 --- a/examples/udpblaster/Make.defs +++ b/examples/udpblaster/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_UDPBLASTER),y) +ifneq ($(CONFIG_EXAMPLES_UDPBLASTER),) CONFIGURED_APPS += examples/udpblaster endif diff --git a/examples/udpblaster/Makefile b/examples/udpblaster/Makefile index b840da209..4ebed385a 100644 --- a/examples/udpblaster/Makefile +++ b/examples/udpblaster/Makefile @@ -33,37 +33,12 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Basic TCP networking test -TARG_ASRCS = -TARG_AOBJS = $(TARG_ASRCS:.S=$(OBJEXT)) - -TARG_CSRCS = udpblaster_text.c -TARG_MAINSRC = udpblaster_target.c - -TARG_COBJS = $(TARG_CSRCS:.c=$(OBJEXT)) -TARG_MAINOBJ = $(TARG_MAINSRC:.c=$(OBJEXT)) - -TARG_SRCS = $(TARG_ASRCS) $(TARG_CSRCS) $(TARG_CSRCS) -TARG_OBJS = $(TARG_AOBJS) $(TARG_COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - TARG_OBJS += $(TARG_MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - TARG_BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - TARG_BIN = ..\\..\\libapps$(LIBEXT) -else - TARG_BIN = ../../libapps$(LIBEXT) -endif -endif +CSRCS = udpblaster_text.c +MAINSRC = udpblaster_target.c HOSTCFLAGS += -DUDPBLASTER_HOST=1 @@ -73,17 +48,9 @@ HOSTOBJEXT ?= .hobj HOST_OBJS = $(HOST_SRCS:.c=$(HOSTOBJEXT)) HOST_BIN = host -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_UPBLASTER_PROGNAME ?= udpblaster$(EXEEXT) PROGNAME = $(CONFIG_UPBLASTER_PROGNAME) -ROOTDEPPATH = --dep-path . - # NET test built-in application info CONFIG_EXAMPLES_UDPBLASTER_STACKSIZE ?= 2048 @@ -95,18 +62,6 @@ STACKSIZE = $(CONFIG_EXAMPLES_UDPBLASTER_STACKSIZE) # Common build -VPATH = - -all: .built $(HOST_BIN) -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(TARG_AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(TARG_COBJS) $(TARG_MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - ifneq ($(CONFIG_EXAMPLES_UDPBLASTER_LOOPBACK),y) $(HOST_OBJS): %$(HOSTOBJEXT): %.c @echo "CC: $<" @@ -123,52 +78,16 @@ $(HOST_BIN): config.h $(HOST_OBJS) $(Q) $(HOSTCC) $(HOSTLDFLAGS) $(HOST_OBJS) -o $@ endif -.built: config.h $(TARG_OBJS) - $(call ARCHIVE, $(TARG_BIN), $(TARG_OBJS)) - $(Q) touch .built +context:: config.h $(HOST_BIN) -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(TARG_MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(TARG_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile config.h $(TARG_SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(TARG_SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: +clean:: ifneq ($(CONFIG_EXAMPLES_UDPBLASTER_LOOPBACK),y) $(call DELFILE, *$(HOSTOBJEXT)) $(call DELFILE, $(HOST_BIN)) endif - $(call DELFILE, .built) $(call DELFILE, *.dSYM) $(call DELFILE, config.h) - $(call CLEAN) -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +MODULE = CONFIG_EXAMPLES_UDPBLASTER -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/udpblaster/udpblaster.h b/examples/udpblaster/udpblaster.h index 8ae5cad5e..0f8736b12 100644 --- a/examples/udpblaster/udpblaster.h +++ b/examples/udpblaster/udpblaster.h @@ -102,8 +102,8 @@ # define UDPBLASTER_MSS (UDPBLASTER_MTU - IPv4_HDRLEN - UDP_HDRLEN) # endif #elif defined(CONFIG_NET_6LOWPAN) -# define UDPBLASTER_MTU CONFIG_NET_6LOWPAN_MTU -# define UDPBLASTER_MSS (CONFIG_NET_6LOWPAN_MTU - IPv6_HDRLEN - UDP_HDRLEN) +# define UDPBLASTER_MTU CONFIG_NET_6LOWPAN_PKTSIZE +# define UDPBLASTER_MSS (CONFIG_NET_6LOWPAN_PKTSIZE - IPv6_HDRLEN - UDP_HDRLEN) #elif defined(CONFIG_NET_SLIP) # define UDPBLASTER_MTU CONFIG_NET_SLIP_MTU # ifdef CONFIG_EXAMPLES_UDPBLASTER_IPv6 diff --git a/examples/unionfs/Kconfig b/examples/unionfs/Kconfig index e9e002c72..00e04c3d7 100644 --- a/examples/unionfs/Kconfig +++ b/examples/unionfs/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_UNIONFS - bool "Union file system example" + tristate "Union file system example" default n depends on (FS_ROMFS || FS_UNIONFS) && BUILD_FLAT ---help--- diff --git a/examples/unionfs/Make.defs b/examples/unionfs/Make.defs index 17bef5e19..b516c81b3 100644 --- a/examples/unionfs/Make.defs +++ b/examples/unionfs/Make.defs @@ -33,6 +33,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_UNIONFS),y) +ifneq ($(CONFIG_EXAMPLES_UNIONFS),) CONFIGURED_APPS += examples/unionfs endif diff --git a/examples/unionfs/Makefile b/examples/unionfs/Makefile index 1db0448de..94a6f5a66 100644 --- a/examples/unionfs/Makefile +++ b/examples/unionfs/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # UNIONFS built-in application info @@ -45,56 +43,13 @@ STACKSIZE = 2048 # UNIONFS File System Example -ASRCS = -CSRCS = MAINSRC = unionfs_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= unionfs$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Common build -VPATH = - -all: .built -.PHONY: checkgenromfs clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - checkgenromfs: @genromfs -h 1>/dev/null 2>&1 || { \ echo "Host executable genromfs not available in PATH"; \ @@ -114,48 +69,12 @@ btestdir.img : checkgenromfs romfs_btestdir.h : btestdir.img @xxd -i $< >$@ || { echo "xxd of $< failed" ; exit 1 ; } -.built: romfs_atestdir.h romfs_btestdir.h $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built +context:: romfs_atestdir.h romfs_btestdir.h -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +distclean:: $(call DELFILE, atestdir.img) $(call DELFILE, btestdir.img) -preconfig: +MODULE = CONFIG_EXAMPLES_UNIONFS --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/usbserial/Kconfig b/examples/usbserial/Kconfig index dc7def9f8..f5e87ce92 100644 --- a/examples/usbserial/Kconfig +++ b/examples/usbserial/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_USBSERIAL - bool "USB serial test example" + tristate "USB serial test example" default n depends on LIB_BOARDCTL select BOARDCTL_USBDEVCTRL diff --git a/examples/usbserial/Make.defs b/examples/usbserial/Make.defs index 40572cb29..922d1f9e0 100644 --- a/examples/usbserial/Make.defs +++ b/examples/usbserial/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_USBSERIAL),y) +ifneq ($(CONFIG_EXAMPLES_USBSERIAL),) CONFIGURED_APPS += examples/usbserial endif diff --git a/examples/usbserial/Makefile b/examples/usbserial/Makefile index ec751a551..cb766f2a1 100644 --- a/examples/usbserial/Makefile +++ b/examples/usbserial/Makefile @@ -34,7 +34,6 @@ ############################################################################ -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # USB serial device example # Built-in application info @@ -43,97 +42,11 @@ APPNAME = usbserial PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -ASRCS = -CSRCS = MAINSRC = usbserial_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= usbserial$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +MODULE = CONFIG_EXAMPLES_USBSERIAL -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - @$(MAKE) -f Makefile.host clean TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/userfs/Kconfig b/examples/userfs/Kconfig index 99c2eeeaf..ac026b6bc 100644 --- a/examples/userfs/Kconfig +++ b/examples/userfs/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_USERFS - bool "UserFS test" + tristate "UserFS test" default n ---help--- Enables a simple test of the UserFS diff --git a/examples/userfs/Make.defs b/examples/userfs/Make.defs index 31f241c86..44371b267 100644 --- a/examples/userfs/Make.defs +++ b/examples/userfs/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_USERFS),y) +ifneq ($(CONFIG_EXAMPLES_USERFS),) CONFIGURED_APPS += examples/userfs endif diff --git a/examples/userfs/Makefile b/examples/userfs/Makefile index 13f68bea7..453947da0 100644 --- a/examples/userfs/Makefile +++ b/examples/userfs/Makefile @@ -53,4 +53,6 @@ MAINSRC = userfs_main.c CONFIG_EXAMPLES_USERFS_PROGNAME ?= userfs$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_USERFS_PROGNAME) +MODULE = CONFIG_EXAMPLES_USERFS + include $(APPDIR)/Application.mk diff --git a/examples/usrsocktest/Kconfig b/examples/usrsocktest/Kconfig index 14fc1f492..d40e73cbd 100644 --- a/examples/usrsocktest/Kconfig +++ b/examples/usrsocktest/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_USRSOCKTEST - bool "USRSOCK test example" + tristate "USRSOCK test example" default n depends on NET && NET_USRSOCK && !DISABLE_POLL select NET_USRSOCK_TCP diff --git a/examples/usrsocktest/Make.defs b/examples/usrsocktest/Make.defs index 74f505b51..e8d173bc3 100644 --- a/examples/usrsocktest/Make.defs +++ b/examples/usrsocktest/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_USRSOCKTEST),y) +ifneq ($(CONFIG_EXAMPLES_USRSOCKTEST),) CONFIGURED_APPS += examples/usrsocktest endif diff --git a/examples/usrsocktest/Makefile b/examples/usrsocktest/Makefile index 5060cbfe4..b84a67a3c 100644 --- a/examples/usrsocktest/Makefile +++ b/examples/usrsocktest/Makefile @@ -62,4 +62,6 @@ MAINSRC = usrsocktest_main.c CONFIG_EXAMPLES_USRSOCKTEST_PROGNAME ?= usrsocktest$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_USRSOCKTEST_PROGNAME) +MODULE = CONFIG_EXAMPLES_USRSOCKTEST + include $(APPDIR)/Application.mk diff --git a/examples/ustream/Kconfig b/examples/ustream/Kconfig index 3cd6a6e97..646d69c23 100644 --- a/examples/ustream/Kconfig +++ b/examples/ustream/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_USTREAM - bool "Unix domain stream example" + tristate "Unix domain stream example" default n depends on NET_LOCAL ---help--- diff --git a/examples/ustream/Make.defs b/examples/ustream/Make.defs index 95e44e6ee..7f1f2be81 100644 --- a/examples/ustream/Make.defs +++ b/examples/ustream/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_USTREAM),y) +ifneq ($(CONFIG_EXAMPLES_USTREAM),) CONFIGURED_APPS += examples/ustream endif diff --git a/examples/ustream/Makefile b/examples/ustream/Makefile index dc2dbb94e..20d7f2b44 100644 --- a/examples/ustream/Makefile +++ b/examples/ustream/Makefile @@ -34,140 +34,17 @@ ############################################################################ -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Basic Unix domain networking test -SERVER_ASRCS = -SERVER_AOBJS = $(SERVER_ASRCS:.S=$(OBJEXT)) +MAINSRC = ustream_client.c ustream_server.c -SERVER_CSRCS = -SERVER_COBJS = $(SERVER_CSRCS:.c=$(OBJEXT)) +PROGNAME = client$(EXEEXT) server$(EXEEXT) +APPNAME = client server -SERVER_MAINSRC = ustream_server.c -SERVER_MAINOBJ = $(SERVER_MAINSRC:.c=$(OBJEXT)) +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 -SERVER_SRCS = $(SERVER_ASRCS) $(SERVER_CSRCS) $(SERVER_MAINSRC) -SERVER_OBJS = $(SERVER_AOBJS) $(SERVER_COBJS) +MODULE = CONFIG_EXAMPLES_USTREAM -SERVER_PROGNAME = server$(EXEEXT) - -SERVER_APPNAME = server -SERVER_PRIORITY = SCHED_PRIORITY_DEFAULT -SERVER_STACKSIZE = 2048 - -CLIENT_ASRCS = -CLIENT_AOBJS = $(CLIENT_ASRCS:.S=$(OBJEXT)) - -CLIENT_CSRCS = -CLIENT_COBJS = $(CLIENT_CSRCS:.c=$(OBJEXT)) - -CLIENT_MAINSRC = ustream_client.c -CLIENT_MAINOBJ = $(CLIENT_MAINSRC:.c=$(OBJEXT)) - -CLIENT_SRCS = $(CLIENT_ASRCS) $(CLIENT_CSRCS) $(CLIENT_MAINSRC) -CLIENT_OBJS = $(CLIENT_AOBJS) $(CLIENT_COBJS) - -CLIENT_PROGNAME = client$(EXEEXT) - -CLIENT_APPNAME = client -CLIENT_PRIORITY = SCHED_PRIORITY_DEFAULT -CLIENT_STACKSIZE = 2048 - -AOBJS = $(CLIENT_AOBJS) $(SERVER_AOBJS) -COBJS = $(CLIENT_COBJS) $(CLIENT_MAINOBJ) $(SERVER_COBJS) $(SERVER_MAINOBJ) - -SRCS = $(CLIENT_SRCS) $(SERVER_SRCS) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - SERVER_OBJS += $(SERVER_MAINOBJ) - CLIENT_OBJS += $(CLIENT_MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - USTREAM_BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - USTREAM_BIN = ..\\..\\libapps$(LIBEXT) -else - USTREAM_BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(USTREAM_BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(CLIENT_PROGNAME): $(CLIENT_OBJS) - @echo "LD: $(CLIENT_PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(CLIENT_PROGNAME) $(ARCHCRT0OBJ) $(CLIENT_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(CLIENT_PROGNAME) - -$(BIN_DIR)$(DELIM)$(SERVER_PROGNAME): $(OBJS) $(SERVER_MAINOBJ) - @echo "LD: $(SERVER_PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(SERVER_PROGNAME) $(ARCHCRT0OBJ) $(SERVER_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(SERVER_PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(CLIENT_PROGNAME) $(BIN_DIR)$(DELIM)$(SERVER_PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) - -$(BUILTIN_REGISTRY)$(DELIM)$(CLIENT_APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(CLIENT_APPNAME),$(CLIENT_PRIORITY),$(CLIENT_STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(CLIENT_APPNAME)_main)) - -$(BUILTIN_REGISTRY)$(DELIM)$(SERVER_APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(SERVER_APPNAME),$(SERVER_PRIORITY),$(SERVER_STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(SERVER_APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(CLIENT_APPNAME)_main.bdat $(BUILTIN_REGISTRY)$(DELIM)$(SERVER_APPNAME)_main.bdat - -else - -context: - -endif - -.depend: Makefile $(SERVER_SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SERVER_SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call DELFILE, *.dSYM) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/veml6070/Kconfig b/examples/veml6070/Kconfig index 7092c5ee1..c2556a019 100644 --- a/examples/veml6070/Kconfig +++ b/examples/veml6070/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_VEML6070 - bool "VEML6070 UltraViolet sensor example" + tristate "VEML6070 UltraViolet sensor example" default n depends on SENSORS_VEML6070 ---help--- diff --git a/examples/veml6070/Make.defs b/examples/veml6070/Make.defs index 70c9d93b8..3f59fefe7 100644 --- a/examples/veml6070/Make.defs +++ b/examples/veml6070/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_VEML6070),y) +ifneq ($(CONFIG_EXAMPLES_VEML6070),) CONFIGURED_APPS += examples/veml6070 endif diff --git a/examples/veml6070/Makefile b/examples/veml6070/Makefile index f54edb349..843941f51 100644 --- a/examples/veml6070/Makefile +++ b/examples/veml6070/Makefile @@ -55,4 +55,6 @@ MAINSRC = veml6070_main.c CONFIG_EXAMPLES_VEML6070_PROGNAME ?= veml6070$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_VEML6070_PROGNAME) +MODULE = CONFIG_EXAMPLES_VEML6070 + include $(APPDIR)/Application.mk diff --git a/examples/watchdog/Kconfig b/examples/watchdog/Kconfig index 3d7faaef9..7adea1481 100644 --- a/examples/watchdog/Kconfig +++ b/examples/watchdog/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_WATCHDOG - bool "Watchdog Timer example" + tristate "Watchdog Timer example" default n ---help--- Enable the watchdog timer example diff --git a/examples/watchdog/Make.defs b/examples/watchdog/Make.defs index acf939cf2..2f94ad0c5 100644 --- a/examples/watchdog/Make.defs +++ b/examples/watchdog/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_WATCHDOG),y) +ifneq ($(CONFIG_EXAMPLES_WATCHDOG),) CONFIGURED_APPS += examples/watchdog endif diff --git a/examples/watchdog/Makefile b/examples/watchdog/Makefile index b710c7e23..1d96c8def 100644 --- a/examples/watchdog/Makefile +++ b/examples/watchdog/Makefile @@ -50,4 +50,6 @@ APPNAME = wdog PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_WATCHDOG + include $(APPDIR)/Application.mk diff --git a/examples/webserver/Kconfig b/examples/webserver/Kconfig index adaeb557c..882c0fc3a 100644 --- a/examples/webserver/Kconfig +++ b/examples/webserver/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_WEBSERVER - bool "uIP web server example" + tristate "uIP web server example" default n ---help--- Enable the uIP web server example diff --git a/examples/webserver/Make.defs b/examples/webserver/Make.defs index 355204771..0d21ad482 100644 --- a/examples/webserver/Make.defs +++ b/examples/webserver/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_WEBSERVER),y) +ifneq ($(CONFIG_EXAMPLES_WEBSERVER),) CONFIGURED_APPS += examples/webserver endif diff --git a/examples/webserver/Makefile b/examples/webserver/Makefile index 2c1988ef9..dec488d03 100644 --- a/examples/webserver/Makefile +++ b/examples/webserver/Makefile @@ -33,48 +33,16 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # uIP very tiny web server example -ASRCS = CSRCS = cgi.c httpd_fsdata.c MAINSRC = webserver_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= webserver$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Webserver built-in application info APPNAME = webserver @@ -83,62 +51,12 @@ STACKSIZE = 2048 # Common build -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - httpd_fsdata.c: httpd-fs/* $(TOPDIR)/tools/mkfsdata.pl -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -epend: .depend - -clean: - $(call DELFILE, .built) +clean:: $(call DELFILE, httpd_fsdata.c) - $(call CLEAN) -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +MODULE = CONFIG_EXAMPLES_WEBSERVER -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/wget/Kconfig b/examples/wget/Kconfig index 077c333c2..ceb76abbb 100644 --- a/examples/wget/Kconfig +++ b/examples/wget/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_WGET - bool "wget example" + tristate "wget example" default n depends on NET_TCP && !NSH_BUILTIN_APPS ---help--- diff --git a/examples/wget/Make.defs b/examples/wget/Make.defs index bd8b45e8a..dd963f623 100644 --- a/examples/wget/Make.defs +++ b/examples/wget/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_WGET),y) +ifneq ($(CONFIG_EXAMPLES_WGET),) CONFIGURED_APPS += examples/wget endif diff --git a/examples/wget/Makefile b/examples/wget/Makefile index 368550634..9fc13d0e9 100644 --- a/examples/wget/Makefile +++ b/examples/wget/Makefile @@ -46,4 +46,6 @@ APPNAME = wget CONFIG_XYZ_PROGNAME ?= wget$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_WGET + include $(APPDIR)/Application.mk diff --git a/examples/wgetjson/Kconfig b/examples/wgetjson/Kconfig index a6045c4c4..9e29ee98f 100644 --- a/examples/wgetjson/Kconfig +++ b/examples/wgetjson/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_WGETJSON - bool "wget JSON Example" + tristate "wget JSON Example" default n depends on NETUTILS_JSON ---help--- diff --git a/examples/wgetjson/Make.defs b/examples/wgetjson/Make.defs index 628dc3ea7..c51092a64 100644 --- a/examples/wgetjson/Make.defs +++ b/examples/wgetjson/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_WGETJSON),y) +ifneq ($(CONFIG_EXAMPLES_WGETJSON),) CONFIGURED_APPS += examples/wgetjson endif diff --git a/examples/wgetjson/Makefile b/examples/wgetjson/Makefile index 9ce0e3c60..8b6c379e8 100644 --- a/examples/wgetjson/Makefile +++ b/examples/wgetjson/Makefile @@ -50,4 +50,6 @@ APPNAME = wgetjson PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_WGETJSON + include $(APPDIR)/Application.mk diff --git a/examples/xbc_test/Kconfig b/examples/xbc_test/Kconfig index 16390be00..415c4a8ad 100644 --- a/examples/xbc_test/Kconfig +++ b/examples/xbc_test/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_XBC_TEST - bool "XBox Controller Test example" + tristate "XBox Controller Test example" default n ---help--- Enable the XBox Controller Test example diff --git a/examples/xbc_test/Make.defs b/examples/xbc_test/Make.defs index 18dbf308a..071c384c6 100644 --- a/examples/xbc_test/Make.defs +++ b/examples/xbc_test/Make.defs @@ -37,6 +37,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_XBC_TEST),y) +ifneq ($(CONFIG_EXAMPLES_XBC_TEST),) CONFIGURED_APPS += examples/xbc_test endif diff --git a/examples/xbc_test/Makefile b/examples/xbc_test/Makefile index 16be17d3d..15b15c047 100644 --- a/examples/xbc_test/Makefile +++ b/examples/xbc_test/Makefile @@ -56,4 +56,6 @@ MAINSRC = xbc_test_main.c CONFIG_EXAMPLES_XBC_TEST_PROGNAME ?= xbc_test$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_XBC_TEST_PROGNAME) +MODULE = CONFIG_EXAMPLES_XBC_TEST + include $(APPDIR)/Application.mk diff --git a/examples/xmlrpc/Kconfig b/examples/xmlrpc/Kconfig index 6014b1a6b..0a53b945e 100644 --- a/examples/xmlrpc/Kconfig +++ b/examples/xmlrpc/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_XMLRPC - bool "XML RPC example" + tristate "XML RPC example" default n depends on NET_TCP && !DISABLE_POLL select NETUTILS_XMLRPC diff --git a/examples/xmlrpc/Make.defs b/examples/xmlrpc/Make.defs index 44ed44e7b..0065db646 100644 --- a/examples/xmlrpc/Make.defs +++ b/examples/xmlrpc/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_XMLRPC),y) +ifneq ($(CONFIG_EXAMPLES_XMLRPC),) CONFIGURED_APPS += examples/xmlrpc endif diff --git a/examples/xmlrpc/Makefile b/examples/xmlrpc/Makefile index 99a575868..3b4a5d4d1 100644 --- a/examples/xmlrpc/Makefile +++ b/examples/xmlrpc/Makefile @@ -51,4 +51,6 @@ MAINSRC = xmlrpc_main.c CONFIG_XYZ_PROGNAME ?= xmlrpc$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) +MODULE = CONFIG_EXAMPLES_XMLRPC + include $(APPDIR)/Application.mk diff --git a/examples/zerocross/Kconfig b/examples/zerocross/Kconfig index f17d49374..69bd20da1 100644 --- a/examples/zerocross/Kconfig +++ b/examples/zerocross/Kconfig @@ -4,7 +4,7 @@ # config EXAMPLES_ZEROCROSS - bool "Zero Cross Detection example" + tristate "Zero Cross Detection example" default n depends on SENSORS_ZEROCROSS && !DISABLE_SIGNALS ---help--- diff --git a/examples/zerocross/Make.defs b/examples/zerocross/Make.defs index e3f15f592..3f64e25d9 100644 --- a/examples/zerocross/Make.defs +++ b/examples/zerocross/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_EXAMPLES_ZEROCROSS),y) +ifneq ($(CONFIG_EXAMPLES_ZEROCROSS),) CONFIGURED_APPS += examples/zerocross endif diff --git a/examples/zerocross/Makefile b/examples/zerocross/Makefile index 2cfc916ee..64425fc26 100644 --- a/examples/zerocross/Makefile +++ b/examples/zerocross/Makefile @@ -50,4 +50,6 @@ APPNAME = zerocross PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_EXAMPLES_ZEROCROSS + include $(APPDIR)/Application.mk diff --git a/fsutils/flash_eraseall/Makefile b/fsutils/flash_eraseall/Makefile index 94bda913f..970982ca9 100644 --- a/fsutils/flash_eraseall/Makefile +++ b/fsutils/flash_eraseall/Makefile @@ -33,73 +33,13 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Password file access library -ASRCS = CSRCS = - ifeq ($(CONFIG_FSUTILS_FLASH_ERASEALL),y) CSRCS += flash_eraseall.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -preconfig: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/fsutils/inifile/Makefile b/fsutils/inifile/Makefile index dae9da321..ae61334f4 100644 --- a/fsutils/inifile/Makefile +++ b/fsutils/inifile/Makefile @@ -33,68 +33,9 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # I2C tool - -ASRCS = CSRCS = inifile.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . -VPATH = - -# Build targets - -all: .built -.PHONY: context .depend depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/fsutils/mkfatfs/Makefile b/fsutils/mkfatfs/Makefile index 436f888ff..8b76cbc34 100644 --- a/fsutils/mkfatfs/Makefile +++ b/fsutils/mkfatfs/Makefile @@ -33,73 +33,11 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # mkfatfs utility - -ASRCS = -CSRCS = - ifeq ($(CONFIG_FSUTILS_MKFATFS),y) CSRCS = mkfatfs.c configfat.c writefat.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/fsutils/mksmartfs/Makefile b/fsutils/mksmartfs/Makefile index fca59bc77..8ea6f3c4a 100644 --- a/fsutils/mksmartfs/Makefile +++ b/fsutils/mksmartfs/Makefile @@ -35,73 +35,11 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Web client library - -ASRCS = -CSRCS = - ifeq ($(CONFIG_FSUTILS_MKSMARTFS),y) CSRCS = mksmartfs.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/fsutils/passwd/Makefile b/fsutils/passwd/Makefile index d4bbcc8e2..2588795fc 100644 --- a/fsutils/passwd/Makefile +++ b/fsutils/passwd/Makefile @@ -33,13 +33,10 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Password file access library -ASRCS = CSRCS = ifeq ($(CONFIG_FSUTILS_PASSWD),y) @@ -54,60 +51,4 @@ endif endif endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/gpsutils/minmea/Makefile b/gpsutils/minmea/Makefile index 9300c0261..404b631f7 100644 --- a/gpsutils/minmea/Makefile +++ b/gpsutils/minmea/Makefile @@ -33,70 +33,11 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NSH Library -ASRCS = CSRCS = minmea.c - CFLAGS += -std=c99 -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . -VPATH = - -# Build targets - -all: .built -.PHONY: context .depend depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/graphics/ft80x/Makefile b/graphics/ft80x/Makefile index 3814de116..4d0e950c8 100644 --- a/graphics/ft80x/Makefile +++ b/graphics/ft80x/Makefile @@ -33,71 +33,11 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # FTDI/BridgeTek FT80x library - -ASRCS = CSRCS = ft80x_dl.c ft80x_ramg.c ft80x_ramdl.c ft80x_ramcmd.c CSRCS += ft80x_coproc.c ft80x_touch.c ft80x_audio.c ft80x_backlight.c CSRCS += ft80x_gpio.c ft80x_regs.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/graphics/littlevgl/Makefile b/graphics/littlevgl/Makefile index fac195164..6f2a3c8f8 100644 --- a/graphics/littlevgl/Makefile +++ b/graphics/littlevgl/Makefile @@ -33,16 +33,13 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # LVGL graphic library ASRCS = CSRCS = VPATH = -DEPPATH = --dep-path . # LVGL Libraries @@ -69,30 +66,8 @@ UNPACK ?= tar -zxf LVGL_UNPACKDIR = $(WD)/$(LVGL_UNPACKNAME) -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(APPDIR)/graphics/littlevgl} -# Common build - -all: .built -.PHONY: context clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - $(LVGL_TARBALL): @echo "Downloading: $(LVGL_TARBALL)" $(Q) $(WGET) $(CONFIG_GRAPH_LVGL_URL)/$(LVGL_TARBALL) @@ -106,38 +81,14 @@ $(APPDIR)/include/graphics/lvgl.h: $(LVGL_UNPACKNAME) lvgl/lvgl.h @echo "CP: lvgl/lvgl.h" $(Q) cp lvgl/lvgl.h $(APPDIR)/include/graphics/lvgl.h -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) +context:: $(LVGL_UNPACKNAME) $(APPDIR)/include/graphics/lvgl.h -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: $(LVGL_UNPACKNAME) $(APPDIR)/include/graphics/lvgl.h - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: +clean:: $(call DELDIR, build) - $(call DELFILE, .built) - $(call CLEAN) -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +distclean:: $(call DELDIR, $(LVGL_UNPACKNAME)) $(call DELFILE, $(LVGL_TARBALL)) $(call DELFILE, $(APPDIR)/include/graphics/lvgl.h) -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/graphics/pdcurs34/Makefile b/graphics/pdcurs34/Makefile index 086adc516..2f8bdc8c9 100644 --- a/graphics/pdcurs34/Makefile +++ b/graphics/pdcurs34/Makefile @@ -33,72 +33,12 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # pdcurses Text User Interface - -ASRCS = -CSRCS = -VPATH = -DEPPATH = --dep-path . - include pdcurses/Make.defs include nuttx/Make.defs -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(APPDIR)/graphics/pdcurs34/include} -# Common build - -all: .built -.PHONY: context clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/graphics/screenshot/Kconfig b/graphics/screenshot/Kconfig index 259daf412..02f3d57c4 100644 --- a/graphics/screenshot/Kconfig +++ b/graphics/screenshot/Kconfig @@ -4,7 +4,7 @@ # config GRAPHICS_SCREENSHOT - bool "TIFF screenshot utility" + tristate "TIFF screenshot utility" default n depends on TIFF && NX ---help--- diff --git a/graphics/screenshot/Make.defs b/graphics/screenshot/Make.defs index ca52928f6..925c62ec7 100644 --- a/graphics/screenshot/Make.defs +++ b/graphics/screenshot/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_GRAPHICS_SCREENSHOT),y) +ifneq ($(CONFIG_GRAPHICS_SCREENSHOT),) CONFIGURED_APPS += graphics/screenshot endif diff --git a/graphics/screenshot/Makefile b/graphics/screenshot/Makefile index bb74deb49..018aefcd9 100644 --- a/graphics/screenshot/Makefile +++ b/graphics/screenshot/Makefile @@ -33,108 +33,21 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # TIFF Screenshot utility -ASRCS = -CSRCS = MAINSRC = screenshot_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= screenshot$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # TIFF screen built-in application info APPNAME = screenshot PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 4096 -# Common build +MODULE = CONFIG_GRAPHICS_SCREENSHOT -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/graphics/screenshot/screenshot_main.c b/graphics/screenshot/screenshot_main.c index 53a9c3e83..9460b555e 100644 --- a/graphics/screenshot/screenshot_main.c +++ b/graphics/screenshot/screenshot_main.c @@ -242,7 +242,7 @@ int save_screenshot(FAR const char *filename) * ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int screenshot_main(int argc, char *argv[]) diff --git a/graphics/tiff/Makefile b/graphics/tiff/Makefile index 3f8ec2a98..057d3d076 100644 --- a/graphics/tiff/Makefile +++ b/graphics/tiff/Makefile @@ -33,69 +33,9 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NuttX TIFF Creation Tool - -ASRCS = CSRCS = tiff_addstrip.c tiff_finalize.c tiff_initialize.c tiff_utils.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/graphics/traveler/Kconfig b/graphics/traveler/Kconfig index 476f740c5..3c2632fc5 100644 --- a/graphics/traveler/Kconfig +++ b/graphics/traveler/Kconfig @@ -4,7 +4,7 @@ # config GRAPHICS_TRAVELER - bool "Traveler game" + tristate "Traveler game" default n depends on NX || VIDEO_FB select FSUTILS_INIFILE diff --git a/graphics/traveler/Make.defs b/graphics/traveler/Make.defs index 4e5495d42..a99845c0b 100644 --- a/graphics/traveler/Make.defs +++ b/graphics/traveler/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_GRAPHICS_TRAVELER),y) +ifneq ($(CONFIG_GRAPHICS_TRAVELER),) CONFIGURED_APPS += graphics/traveler endif diff --git a/graphics/traveler/Makefile b/graphics/traveler/Makefile index f4da2d033..c5ed560a2 100644 --- a/graphics/traveler/Makefile +++ b/graphics/traveler/Makefile @@ -33,14 +33,11 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Directories TRAVELER_DIR = $(APPDIR)/graphics/traveler -TRAVELER_SRC = $(TRAVELER_DIR)/src TRAVELER_INC = $(TRAVELER_DIR)/include TRAVELER_DEMO = $(TRAVELER_DIR)/world TRAVELER_TOOLS = $(TRAVELER_DIR)/tools @@ -53,7 +50,6 @@ STACKSIZE = 2048 # Traveler files -ASRCS = CSRCS = trv_bitmapfile.c trv_bitmaps.c trv_color.c trv_doors.c CSRCS += trv_fsutils.c trv_graphicfile.c trv_graphics.c trv_input.c CSRCS += trv_mem.c trv_paltbl.c trv_pcx.c trv_planefiles.c trv_planelists.c @@ -71,58 +67,21 @@ ifeq ($(CONFIG_GRAPHICS_TRAVELER_NX),y) CSRCS += trv_nxbkgd.c trv_nxlistener.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - ifeq ($(CONFIG_GRAPHICS_TRAVELER_ROMFSDEMO),y) ROMFS_IMG = trv_romfs.img ROMFS_HDR = trv_romfs.h endif -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_GRAPHICS_TRAVELER_PROGNAME ?= hello$(EXEEXT) PROGNAME = $(CONFIG_GRAPHICS_TRAVELER_PROGNAME) CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TRAVELER_INC)} -DEPPATH = --dep-path . --dep-path src -VPATH = .:src +DEPPATH += --dep-path src +VPATH += :src # Common build -all: .built tools -.PHONY: tools clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - ifeq ($(CONFIG_GRAPHICS_TRAVELER_ROMFSDEMO),y) $(ROMFS_IMG): $(Q) genromfs -f $@ -d $(TRAVELER_DEMO) -V "DemoWorld" @@ -131,51 +90,15 @@ $(ROMFS_HDR): $(ROMFS_IMG) $(Q) (xxd -i $< | sed -e "s/^unsigned/static const unsigned/g" >$@) endif -.built: $(ROMFS_HDR) $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - tools: $(Q) $(MAKE) -C $(TRAVELER_TOOLS) -f Makefile.host TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) +context:: $(ROMFS_HDR) $(OBJS) tools -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - @$(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) +clean:: $(call DELFILE, $(ROMFS_IMG)) $(call DELFILE, $(ROMFS_HDR)) - $(call CLEAN) -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +MODULE = CONFIG_GRAPHICS_TRAVELER -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/graphics/traveler/src/trv_main.c b/graphics/traveler/src/trv_main.c index 6717b0ae9..783609d84 100644 --- a/graphics/traveler/src/trv_main.c +++ b/graphics/traveler/src/trv_main.c @@ -244,7 +244,7 @@ errout: * Description: ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int traveler_main(int argc, char *argv[]) diff --git a/interpreters/bas/Kconfig b/interpreters/bas/Kconfig index 74a146887..ddb1909d1 100644 --- a/interpreters/bas/Kconfig +++ b/interpreters/bas/Kconfig @@ -4,7 +4,7 @@ # config INTERPRETERS_BAS - bool "Basic Interpreter support" + tristate "Basic Interpreter support" default n select LIBC_FLOATINGPOINT depends on FS_READABLE diff --git a/interpreters/bas/Make.defs b/interpreters/bas/Make.defs index e5175ae00..2c32bd578 100644 --- a/interpreters/bas/Make.defs +++ b/interpreters/bas/Make.defs @@ -1,4 +1,4 @@ -ifeq ($(CONFIG_INTERPRETERS_BAS),y) +ifneq ($(CONFIG_INTERPRETERS_BAS),) CONFIGURED_APPS += interpreters/bas endif diff --git a/interpreters/bas/Makefile b/interpreters/bas/Makefile index ecc267034..b92cad3f6 100644 --- a/interpreters/bas/Makefile +++ b/interpreters/bas/Makefile @@ -33,38 +33,20 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # BAS Library -ASRCS = -CSRCS = bas.c bas_auto.c bas_fs.c bas_global.c bas_main.c bas_program.c +CSRCS = bas.c bas_auto.c bas_fs.c bas_global.c bas_program.c CSRCS += bas_str.c bas_token.c bas_value.c bas_var.c ifeq ($(CONFIG_INTERPRETER_BAS_VT100),y) CSRCS += bas_vt100.c endif -DEPPATH = --dep-path . -VPATH = . +MAINSRC = bas_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif +PROGNAME = bas$(EXEEXT) # BAS built-in application info @@ -75,47 +57,6 @@ APPNAME = bas PRIORITY = $(CONFIG_INTERPRETER_BAS_PRIORITY) STACKSIZE = $(CONFIG_INTERPRETER_BAS_STACKSIZE) -# Build targets +MODULE = CONFIG_INTERPRETERS_BAS -all: .built -.PHONY: context .depend depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/interpreters/bas/bas_main.c b/interpreters/bas/bas_main.c index a75f71fa3..324bf6121 100644 --- a/interpreters/bas/bas_main.c +++ b/interpreters/bas/bas_main.c @@ -82,7 +82,7 @@ * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int bas_main(int argc, char *argv[]) diff --git a/interpreters/ficl/Makefile b/interpreters/ficl/Makefile index 5d8dbc4df..256e63c25 100644 --- a/interpreters/ficl/Makefile +++ b/interpreters/ficl/Makefile @@ -36,7 +36,6 @@ BUILDDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Tools @@ -56,64 +55,8 @@ ASRCS += $(FICL_ASRCS) CXXSRCS += $(FICL_CXXSRCS) CSRCS += $(FICL_CSRCS) -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) +ROOTDEPPATH += --dep-path src -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) +VPATH += :src:$(FICL_SUBDIR) -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOT_DEPPATH = --dep-path . -SRC_DEPPATH = --dep-path src - -VPATH = src:$(FICL_SUBDIR) - -all: .built -.PHONY: debug context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -debug: - @#echo "FICL: $(FICL_SUBDIR)" - @#echo "VPATH: $(VPATH)" - @#echo "CFLAGS: $(CFLAGS)" - -.built: debug $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: debug Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOT_DEPPATH) $(SRC_DEPPATH) $(FICL_DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/interpreters/minibasic/Kconfig b/interpreters/minibasic/Kconfig index 1a1df4153..bab275fc0 100644 --- a/interpreters/minibasic/Kconfig +++ b/interpreters/minibasic/Kconfig @@ -4,7 +4,7 @@ # config INTERPRETERS_MINIBASIC - bool "Mini Basic Interpreter support" + tristate "Mini Basic Interpreter support" default n select LIBC_FLOATINGPOINT ---help--- diff --git a/interpreters/minibasic/Make.defs b/interpreters/minibasic/Make.defs index 99bcdad45..7e3d0fbbd 100644 --- a/interpreters/minibasic/Make.defs +++ b/interpreters/minibasic/Make.defs @@ -33,6 +33,6 @@ # ############################################################################ -ifeq ($(CONFIG_INTERPRETERS_MINIBASIC),y) +ifneq ($(CONFIG_INTERPRETERS_MINIBASIC),) CONFIGURED_APPS += interpreters/minibasic endif diff --git a/interpreters/minibasic/Makefile b/interpreters/minibasic/Makefile index b0e514901..5e4478024 100644 --- a/interpreters/minibasic/Makefile +++ b/interpreters/minibasic/Makefile @@ -33,84 +33,25 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Mini Basic Library -ASRCS = -CSRCS = basic.c script.c +CSRCS = basic.c -DEPPATH = --dep-path . -VPATH = . +MAINSRC = script.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif +PROGNAME = basic # Mini Basic built-in application info CONFIG_INTERPRETER_MINIBASIC_PRIORITY ?= 100 CONFIG_INTERPRETER_MINIBASIC_STACKSIZE ?= 4096 -APPNAME = basic +APPNAME = basic$(EXEEXT) PRIORITY = $(CONFIG_INTERPRETER_MINIBASIC_PRIORITY) STACKSIZE = $(CONFIG_INTERPRETER_MINIBASIC_STACKSIZE) -# Build targets +MODULE = CONFIG_INTERPRETERS_MINIBASIC -all: .built -.PHONY: context .depend depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/interpreters/minibasic/script.c b/interpreters/minibasic/script.c index c95d6e2f1..8ef07c8f1 100644 --- a/interpreters/minibasic/script.c +++ b/interpreters/minibasic/script.c @@ -151,7 +151,7 @@ static void usage(void) * ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int basic_main(int argc, char *argv[]) diff --git a/modbus/Makefile b/modbus/Makefile index 4efd42af6..01c174117 100644 --- a/modbus/Makefile +++ b/modbus/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # FreeModBus Library @@ -44,82 +42,20 @@ CSRCS = ifeq ($(CONFIG_MODBUS),y) -ifeq ($(CONFIG_MODBUS_SLAVE),y) -CSRCS += mb.c -endif + ifeq ($(CONFIG_MODBUS_SLAVE),y) + CSRCS += mb.c + endif -ifeq ($(CONFIG_MB_RTU_MASTER),y) -CSRCS += mb_m.c -endif + ifeq ($(CONFIG_MB_RTU_MASTER),y) + CSRCS += mb_m.c + endif -DEPPATH = --dep-path . -VPATH = . - -include ascii/Make.defs -include functions/Make.defs -include nuttx/Make.defs -include rtu/Make.defs -include tcp/Make.defs + include ascii/Make.defs + include functions/Make.defs + include nuttx/Make.defs + include rtu/Make.defs + include tcp/Make.defs endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\libapps$(LIBEXT) -else - BIN = ../libapps$(LIBEXT) -endif -endif - -# Build targets - -all: .built -.PHONY: context .depend depend clean distclean preconfig -.PRECIOUS: ../libapps$(LIBEXT) - -ifeq ($(CONFIG_MODBUS),y) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) -endif - -.built: $(OBJS) -ifeq ($(CONFIG_MODBUS),y) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built -endif - -install: - -context: - -.depend: Makefile $(SRCS) -ifeq ($(CONFIG_MODBUS),y) - $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ -endif - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/chat/Makefile b/netutils/chat/Makefile index a63416beb..2e3f88438 100644 --- a/netutils/chat/Makefile +++ b/netutils/chat/Makefile @@ -33,69 +33,8 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs -ASRCS = -CSRCS = +CSRCS = chat.c -CSRCS += chat.c - -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/codecs/Makefile b/netutils/codecs/Makefile index 6ebfbac49..5b3b35f62 100644 --- a/netutils/codecs/Makefile +++ b/netutils/codecs/Makefile @@ -33,67 +33,8 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs -ASRCS = CSRCS = urldecode.c base64.c md5.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/dhcpc/Makefile b/netutils/dhcpc/Makefile index d1b71843d..42f052762 100644 --- a/netutils/dhcpc/Makefile +++ b/netutils/dhcpc/Makefile @@ -33,73 +33,13 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # DHCP Client Library -ASRCS = CSRCS = - ifeq ($(CONFIG_NET_UDP),y) CSRCS += dhcpc.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/dhcpd/Makefile b/netutils/dhcpd/Makefile index f10111865..804ffd3f9 100644 --- a/netutils/dhcpd/Makefile +++ b/netutils/dhcpd/Makefile @@ -33,73 +33,13 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # DHCP Daemn Library -ASRCS = CSRCS = - ifeq ($(CONFIG_NET_UDP),y) CSRCS += dhcpd.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/discover/Make.defs b/netutils/discover/Make.defs index 5db6699a9..e04cd33c7 100644 --- a/netutils/discover/Make.defs +++ b/netutils/discover/Make.defs @@ -33,7 +33,7 @@ # ############################################################################ -ifeq ($(CONFIG_NETUTILS_DISCOVER),y) +ifneq ($(CONFIG_NETUTILS_DISCOVER),) CONFIGURED_APPS += netutils/discover endif diff --git a/netutils/discover/Makefile b/netutils/discover/Makefile index 1094cd914..df6b2e5f3 100644 --- a/netutils/discover/Makefile +++ b/netutils/discover/Makefile @@ -36,73 +36,12 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Telnet daemon -ASRCS = -CSRCS = - ifeq ($(CONFIG_NET_UDP),y) CSRCS += discover.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/esp8266/Makefile b/netutils/esp8266/Makefile index 0c303e4de..46a5c2b00 100644 --- a/netutils/esp8266/Makefile +++ b/netutils/esp8266/Makefile @@ -33,69 +33,9 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # ESP8266 Library - -ASRCS = CSRCS = esp8266.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/ftpc/Makefile b/netutils/ftpc/Makefile index 31a004d27..75906b5fd 100644 --- a/netutils/ftpc/Makefile +++ b/netutils/ftpc/Makefile @@ -33,18 +33,15 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # DHCP Daemn Library -ASRCS = CSRCS = ifeq ($(CONFIG_NET_TCP),y) # FTP connection management -CSRCS = ftpc_connect.c ftpc_disconnect.c +CSRCS += ftpc_connect.c ftpc_disconnect.c # FTP commands CSRCS += ftpc_cdup.c ftpc_chdir.c ftpc_chmod.c ftpc_filesize.c ftpc_filetime.c @@ -62,60 +59,4 @@ CSRCS += ftpc_response.c ftpc_getreply.c CSRCS += ftpc_utils.c ftpc_socket.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/ftpd/Makefile b/netutils/ftpd/Makefile index 56eb97aeb..be91ba8cb 100644 --- a/netutils/ftpd/Makefile +++ b/netutils/ftpd/Makefile @@ -33,73 +33,13 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Telnet daemon -ASRCS = CSRCS = - ifeq ($(CONFIG_NET_TCP),y) CSRCS += ftpd.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/json/Makefile b/netutils/json/Makefile index cfbb833cd..9bf97c538 100644 --- a/netutils/json/Makefile +++ b/netutils/json/Makefile @@ -33,67 +33,8 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs -ASRCS = CSRCS = cJSON.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/netlib/Makefile b/netutils/netlib/Makefile index 547e658c0..f2ec67973 100644 --- a/netutils/netlib/Makefile +++ b/netutils/netlib/Makefile @@ -33,13 +33,10 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Network Library -ASRCS = CSRCS = netlib_ipv4addrconv.c netlib_ethaddrconv.c netlib_parsehttpurl.c CSRCS += netlib_setifstatus.c netlib_getifstatus.c @@ -111,60 +108,4 @@ CSRCS += netlib_ipmsfilter.c endif endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/ntpclient/Makefile b/netutils/ntpclient/Makefile index f93e028bb..4d0e5dfe4 100755 --- a/netutils/ntpclient/Makefile +++ b/netutils/ntpclient/Makefile @@ -33,73 +33,13 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NTP client daemon Library -ASRCS = CSRCS = - ifeq ($(CONFIG_NET_UDP),y) CSRCS += ntpclient.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/ping/Makefile b/netutils/ping/Makefile index fb3e63726..e847c64e0 100644 --- a/netutils/ping/Makefile +++ b/netutils/ping/Makefile @@ -33,15 +33,10 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # ICMP/ICMPv6 ping support - -ASRCS = CSRCS = - ifeq ($(CONFIG_NETUTILS_PING),y) CSRCS += icmp_ping.c endif @@ -50,60 +45,4 @@ ifeq ($(CONFIG_NETUTILS_PING6),y) CSRCS += icmpv6_ping.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/pppd/Makefile b/netutils/pppd/Makefile index 48e532985..fd7d2f291 100644 --- a/netutils/pppd/Makefile +++ b/netutils/pppd/Makefile @@ -33,72 +33,11 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs -ASRCS = -CSRCS = - -CSRCS += pppd.c ppp.c ahdlc.c lcp.c ipcp.c +CSRCS = pppd.c ppp.c ahdlc.c lcp.c ipcp.c ifeq ($(CONFIG_NETUTILS_PPPD_PAP),y) CSRCS += pap.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/smtp/Makefile b/netutils/smtp/Makefile index 6bbf96fac..3918e7547 100644 --- a/netutils/smtp/Makefile +++ b/netutils/smtp/Makefile @@ -33,73 +33,13 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # SMTP Library -ASRCS = CSRCS = - ifeq ($(CONFIG_NET_TCP),y) CSRCS += smtp.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/telnetc/Makefile b/netutils/telnetc/Makefile index 78741fbb2..731b0eee2 100644 --- a/netutils/telnetc/Makefile +++ b/netutils/telnetc/Makefile @@ -33,73 +33,13 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Telnet daemon -ASRCS = CSRCS = - ifeq ($(CONFIG_NET_TCP),y) CSRCS += telnetc.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/telnetd/Makefile b/netutils/telnetd/Makefile index aab332297..7f67eaa49 100644 --- a/netutils/telnetd/Makefile +++ b/netutils/telnetd/Makefile @@ -33,73 +33,13 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Telnet daemon -ASRCS = CSRCS = - ifeq ($(CONFIG_NET_TCP),y) CSRCS += telnetd_daemon.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/tftpc/Makefile b/netutils/tftpc/Makefile index a88bad469..d792e8f77 100644 --- a/netutils/tftpc/Makefile +++ b/netutils/tftpc/Makefile @@ -33,75 +33,14 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # TFTP Client Library -ASRCS = -CSRCS = - ifeq ($(CONFIG_NET_UDP),y) ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) CSRCS += tftpc_get.c tftpc_put.c tftpc_packets.c endif endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/thttpd/Kconfig b/netutils/thttpd/Kconfig index 4bb5606be..c1b94fa54 100644 --- a/netutils/thttpd/Kconfig +++ b/netutils/thttpd/Kconfig @@ -4,7 +4,7 @@ # config NETUTILS_THTTPD - bool "THTTPD webserver" + tristate "THTTPD webserver" default n depends on (NXFLAT || FS_BINFS) && !DISABLE_POLL ---help--- diff --git a/netutils/thttpd/Make.defs b/netutils/thttpd/Make.defs index a6d0c2e48..d971fff90 100644 --- a/netutils/thttpd/Make.defs +++ b/netutils/thttpd/Make.defs @@ -33,7 +33,7 @@ # ############################################################################ -ifeq ($(CONFIG_NETUTILS_THTTPD),y) +ifneq ($(CONFIG_NETUTILS_THTTPD),) CONFIGURED_APPS += netutils/thttpd endif diff --git a/netutils/thttpd/Makefile b/netutils/thttpd/Makefile index 2327378a4..5ac46f9d5 100644 --- a/netutils/thttpd/Makefile +++ b/netutils/thttpd/Makefile @@ -33,15 +33,9 @@ # ############################################################################# --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -DELIM = $(strip /) -include $(APPDIR)$(DELIM)Make.defs - # THTTPD Library - -ASRCS = CSRCS = ifeq ($(CONFIG_NET_TCP),y) @@ -50,34 +44,11 @@ ifeq ($(CONFIG_NET_TCP),y) MAINSRC += thttpd.c endif -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= thttpd$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -DEPPATHS = --dep-path . - # CGI binaries (examples only, not used in the build) -CGIBINDIR = $(APPDIR)$(DELIM)netutils$(DELIM)thttpd$(DELIM)cgi-bin - -BINFS_CSRCS = -VPATH = . - ifeq ($(CONFIG_THTTPD_NXFLAT),y) SUBDIR_BIN1 = phf SUBDIR_BIN2 = redirect @@ -86,19 +57,11 @@ ifeq ($(CONFIG_THTTPD_NXFLAT),y) endif ifeq ($(CONFIG_THTTPD_BINFS),y) - BINFS_CSRCS = phf.c redirect.c ssi.c + CSRCS += phf.c redirect.c ssi.c DEPPATHS += --dep-path cgi-src VPATH += :cgi-src endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -BINFS_COBJS = $(BINFS_CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(BINFS_CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) $(BINFS_COBJS) - ifneq ($(CONFIG_BUILD_LOADABLE),y) OBJS += $(MAINOBJ) endif @@ -106,18 +69,11 @@ endif CONFIG_THTTPD_CGI_PRIORITY ?= 100 CONFIG_THTTPD_CGI_STACKSIZE ?= 2048 +APPNAME = phf redirect ssi PRIORITY = $(CONFIG_THTTPD_CGI_PRIORITY) STACKSIZE = $(CONFIG_THTTPD_CGI_STACKSIZE) -all: $(SUBDIR_BIN) .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) +context:: $(SUBDIR_BIN) ifeq ($(CONFIG_THTTPD_NXFLAT),y) cgi-bin: @@ -142,54 +98,6 @@ cgi-bin$(DELIM)$(SUBDIR_BIN3): cgi-bin cgi-src$(DELIM)$(SUBDIR_BIN3) $(Q) cp -a cgi-src$(DELIM)$(SUBDIR_BIN3) $@ endif -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built +MODULE = CONFIG_NETUTILS_THTTPD -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_THTTPD_BINFS),y) -$(BUILTIN_REGISTRY)$(DELIM)phf_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,phf,$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,phf_main)) - -$(BUILTIN_REGISTRY)$(DELIM)redirect_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,redirect,$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,redirect_main)) - -$(BUILTIN_REGISTRY)$(DELIM)ssi_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,ssi,$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,ssi_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)phf_main.bdat $(BUILTIN_REGISTRY)$(DELIM)redirect_main.bdat $(BUILTIN_REGISTRY)$(DELIM)ssi_main.bdat - -else -context: - -endif - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(DEPPATHS) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/thttpd/thttpd.c b/netutils/thttpd/thttpd.c index 6e2022378..13d7038ad 100644 --- a/netutils/thttpd/thttpd.c +++ b/netutils/thttpd/thttpd.c @@ -652,7 +652,7 @@ static void occasional(ClientData client_data, struct timeval *nowP) * ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int thttpd_main(int argc, char **argv) diff --git a/netutils/webclient/Makefile b/netutils/webclient/Makefile index e52c9c529..f5a1e2cf0 100644 --- a/netutils/webclient/Makefile +++ b/netutils/webclient/Makefile @@ -33,73 +33,11 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Web client library - -ASRCS = -CSRCS = - ifeq ($(CONFIG_NET_TCP),y) CSRCS = webclient.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/webserver/Makefile b/netutils/webserver/Makefile index d505ef61c..9d3ee76ba 100644 --- a/netutils/webserver/Makefile +++ b/netutils/webserver/Makefile @@ -33,17 +33,13 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Web server library -ASRCS = CSRCS = - ifeq ($(CONFIG_NET_TCP),y) -CSRCS = httpd.c httpd_cgi.c +CSRCS += httpd.c httpd_cgi.c ifeq ($(CONFIG_NETUTILS_HTTPD_SENDFILE),y) CSRCS += httpd_sendfile.c else ifeq ($(CONFIG_NETUTILS_HTTPD_MMAP),y) @@ -53,60 +49,4 @@ CSRCS += httpd_fs.c endif endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/netutils/xmlrpc/Makefile b/netutils/xmlrpc/Makefile index cc7ef2159..990facc1b 100644 --- a/netutils/xmlrpc/Makefile +++ b/netutils/xmlrpc/Makefile @@ -36,71 +36,11 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs -ASRCS = CSRCS = - ifeq ($(CONFIG_NET_TCP),y) CSRCS += xmlparser.c response.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/nshlib/Make.defs b/nshlib/Make.defs index 2bacb5b79..97ec50a8e 100644 --- a/nshlib/Make.defs +++ b/nshlib/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_NSH_LIBRARY),y) +ifneq ($(CONFIG_NSH_LIBRARY),) CONFIGURED_APPS += nshlib endif diff --git a/nshlib/Makefile b/nshlib/Makefile index e75de815c..a720dcfd2 100644 --- a/nshlib/Makefile +++ b/nshlib/Makefile @@ -33,13 +33,10 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NSH Library -ASRCS = CSRCS = nsh_init.c nsh_parse.c nsh_console.c nsh_script.c nsh_system.c CSRCS += nsh_command.c nsh_fscmds.c nsh_ddcmd.c nsh_proccmds.c nsh_mmcmds.c CSRCS += nsh_timcmds.c nsh_envcmds.c nsh_syscmds.c nsh_dbgcmds.c @@ -137,59 +134,4 @@ ifeq ($(CONFIG_NSH_LOGIN_PASSWD),y) CSRCS += nsh_passwdcmds.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\libapps$(LIBEXT) -else - BIN = ../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . -VPATH = - -# Build targets - -all: .built -.PHONY: context .depend depend clean distclean preconfig -.PRECIOUS: ../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/platform/Makefile b/platform/Makefile index 6810ae62e..d56b4beca 100644 --- a/platform/Makefile +++ b/platform/Makefile @@ -33,13 +33,9 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs CONFIG_ARCH_BOARD ?= dummy -DELIM ?= $(strip /) - -include $(APPDIR)$(DELIM)Make.defs # Directories @@ -54,62 +50,16 @@ else LINKDIR = $(if $(wildcard $(BOARDDIR)$(DELIM)Make.defs),$(BOARDDIR),$(DUMMYDIR)) endif -VPATH = board -DEPPATH = --dep-path $(PLATFORMDIR) +VPATH += board +ROOTDEPPATH += --obj-path bin +ROOTDEPPATH += --obj-suffix $(OBJEXT) +ROOTDEPPATH += --dep-path $(PLATFORMDIR) # Binaries -ASRCS = -CSRCS = - -include $(GNUDIR)$(DELIM)Make.defs -include $(PLATFORMDIR)$(DELIM)Make.defs -# REVISIT: Backslash causes problems in $(A/COBJS) patsubst -# AOBJS = $(patsubst %.S, bin$(DELIM)%$(OBJEXT), $(ASRCS)) -# COBJS = $(patsubst %.c, bin$(DELIM)%$(OBJEXT), $(CSRCS)) -AOBJS = $(patsubst %.S, bin/%$(OBJEXT), $(ASRCS)) -COBJS = $(patsubst %.c, bin/%$(OBJEXT), $(CSRCS)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\libapps$(LIBEXT) -else - BIN = ../libapps$(LIBEXT) -endif -endif - -# Build targets - -all: .built -.PHONY: context .depend depend clean_context clean distclean preconfig -.PRECIOUS: ../libapps$(LIBEXT) - -ifneq ($(ASRCS),) -# REVISIT: Backslash causes problems in $(AOBJS) target -# $(AOBJS): bin$(DELIM)%$(OBJEXT): %.S -$(AOBJS): bin/%$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) -endif - -ifneq ($(CSRCS),) -# REVISIT: Backslash causes problems in $(COBJS) target -# $(COBJS): bin$(DELIM)%$(OBJEXT): %.c -$(COBJS): bin/%$(OBJEXT): %.c - $(call COMPILE, $<, $@) -endif - -.built: $(OBJS) -ifneq ($(SRCS),) - $(call ARCHIVE, $(BIN), $(OBJS)) -endif - $(Q) touch .built - # Build context setup $(TOPDIR)$(DELIM).config: @@ -119,33 +69,14 @@ $(PLATFORMDIR): $(TOPDIR)$(DELIM).config $(Q) $(DIRUNLINK) $(PLATFORMDIR) $(Q) $(DIRLINK) $(LINKDIR) $(PLATFORMDIR) -dirlinks: $(PLATFORMDIR) +dirlinks: $(PLATFORMDIR) -install: - -context: dirlinks - -# Dependencies - -.depend: Makefile $(SRCS) $(PLATFORMDIR) - $(Q) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -# Clean targets +context:: dirlinks clean_context: $(Q) $(DIRUNLINK) $(PLATFORMDIR) -clean: - $(call DELFILE, .built) +clean:: $(Q) $(MAKE) -C bin TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" clean -distclean: clean clean_context - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/cdcacm/Kconfig b/system/cdcacm/Kconfig index 0dfa88a7f..af0685e84 100644 --- a/system/cdcacm/Kconfig +++ b/system/cdcacm/Kconfig @@ -4,7 +4,7 @@ # menuconfig SYSTEM_CDCACM - bool "USB CDC/ACM Device Commands" + tristate "USB CDC/ACM Device Commands" default n depends on LIB_BOARDCTL && CDCACM select BOARDCTL_USBDEVCTRL diff --git a/system/cdcacm/Make.defs b/system/cdcacm/Make.defs index 0e58498c8..b60961c59 100644 --- a/system/cdcacm/Make.defs +++ b/system/cdcacm/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_CDCACM),y) +ifneq ($(CONFIG_SYSTEM_CDCACM),) CONFIGURED_APPS += system/cdcacm endif diff --git a/system/cdcacm/Makefile b/system/cdcacm/Makefile index 9d14e39db..8ef8bbf5c 100644 --- a/system/cdcacm/Makefile +++ b/system/cdcacm/Makefile @@ -33,115 +33,20 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # USB CDC/ACM serial mass storage add-on -ASRCS = -CSRCS = MAINSRC = cdcacm_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= cdcacm$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +APPNAME = sercon serdis -# USB CDC/ACM built-in application info +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 -APPNAME1 = sercon -PRIORITY1 = SCHED_PRIORITY_DEFAULT -STACKSIZE1 = 2048 +MODULE = CONFIG_SYSTEM_CDCACM -APPNAME2 = serdis -PRIORITY2 = SCHED_PRIORITY_DEFAULT -STACKSIZE2 = 2048 - -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME1)_main)) - -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME2),$(PRIORITY2),$(STACKSIZE2),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME2)_main)) - -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 - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/cdcacm/cdcacm_main.c b/system/cdcacm/cdcacm_main.c index d290f739a..67b799ca4 100644 --- a/system/cdcacm/cdcacm_main.c +++ b/system/cdcacm/cdcacm_main.c @@ -72,7 +72,7 @@ static struct cdcacm_state_s g_cdcacm; * ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int sercon_main(int argc, char *argv[]) @@ -125,7 +125,7 @@ int sercon_main(int argc, char *argv[]) * device. ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char **argv) #else int serdis_main(int argc, char *argv[]) diff --git a/system/cle/Makefile b/system/cle/Makefile index f590deaff..135d4ea13 100644 --- a/system/cle/Makefile +++ b/system/cle/Makefile @@ -33,71 +33,9 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # EMACS-like Command Line Editor (CLE) - -ASRCS = CSRCS = cle.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/composite/Kconfig b/system/composite/Kconfig index a4f0b6b4c..250fd0b75 100644 --- a/system/composite/Kconfig +++ b/system/composite/Kconfig @@ -4,7 +4,7 @@ # menuconfig SYSTEM_COMPOSITE - bool "USB Composite Device Commands" + tristate "USB Composite Device Commands" default n depends on LIB_BOARDCTL && USBDEV_COMPOSITE && !KERNEL_BUILD select BOARDCTL_USBDEVCTRL diff --git a/system/composite/Make.defs b/system/composite/Make.defs index 1cdd2d24d..c04d7d175 100644 --- a/system/composite/Make.defs +++ b/system/composite/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_COMPOSITE),y) +ifneq ($(CONFIG_SYSTEM_COMPOSITE),) CONFIGURED_APPS += system/composite endif diff --git a/system/composite/Makefile b/system/composite/Makefile index 4192f05f8..7c22e5517 100644 --- a/system/composite/Makefile +++ b/system/composite/Makefile @@ -33,115 +33,21 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # USB device mass storage add-on -ASRCS = -CSRCS = MAINSRC = composite_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= composite$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # USB storage built-in application info -APPNAME1 = conn -PRIORITY1 = SCHED_PRIORITY_DEFAULT -STACKSIZE1 = 2048 +APPNAME = conn disconn +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 -APPNAME2 = disconn -PRIORITY2 = SCHED_PRIORITY_DEFAULT -STACKSIZE2 = 2048 +MODULE = CONFIG_SYSTEM_COMPOSITE -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME1)_main)) - -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME2),$(PRIORITY2),$(STACKSIZE2),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME2)_main)) - -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 - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/composite/composite_main.c b/system/composite/composite_main.c index e46c1be2d..99ef237d2 100644 --- a/system/composite/composite_main.c +++ b/system/composite/composite_main.c @@ -521,7 +521,7 @@ static int echo_serial(void) * ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int conn_main(int argc, char *argv[]) @@ -722,7 +722,7 @@ errout: ****************************************************************************/ #ifdef CONFIG_NSH_BUILTIN_APPS -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char **argv) #else int disconn_main(int argc, char *argv[]) diff --git a/system/cu/Kconfig b/system/cu/Kconfig index 8d924d938..8638e5a91 100644 --- a/system/cu/Kconfig +++ b/system/cu/Kconfig @@ -4,7 +4,7 @@ # menuconfig SYSTEM_CUTERM - bool "CU minimal serial terminal" + tristate "CU minimal serial terminal" default n ---help--- Enable the CU serial terminal. This is a minimalistic diff --git a/system/cu/Make.defs b/system/cu/Make.defs index f67b6d10a..cbda9d641 100644 --- a/system/cu/Make.defs +++ b/system/cu/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_CUTERM),y) +ifneq ($(CONFIG_SYSTEM_CUTERM),) CONFIGURED_APPS += system/cu endif diff --git a/system/cu/Makefile b/system/cu/Makefile index 3cbd93969..329fe05e2 100644 --- a/system/cu/Makefile +++ b/system/cu/Makefile @@ -33,50 +33,13 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs -# Minimal CU terminal - -ASRCS = -CSRCS = MAINSRC = cu_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= cu$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Built-in application info - CONFIG_SYSTEM_CUTERM_STACKSIZE ?= 2048 CONFIG_SYSTEM_CUTERM_PRIORITY ?= SCHED_PRIORITY_DEFAULT @@ -84,60 +47,6 @@ APPNAME = cu PRIORITY = $(CONFIG_SYSTEM_CUTERM_PRIORITY) STACKSIZE = $(CONFIG_SYSTEM_CUTERM_STACKSIZE) -# Common build +MODULE = CONFIG_SYSTEM_CUTERM -VPATH = - -all: .built -.PHONY: context clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/cu/cu_main.c b/system/cu/cu_main.c index 0d70cf3a7..aa00766a9 100644 --- a/system/cu/cu_main.c +++ b/system/cu/cu_main.c @@ -266,7 +266,7 @@ static int cu_cmd(char bcmd) * ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int cu_main(int argc, FAR char *argv[]) diff --git a/system/dhcpc/Kconfig b/system/dhcpc/Kconfig index 47dd46577..81462a2bf 100644 --- a/system/dhcpc/Kconfig +++ b/system/dhcpc/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_DHCPC_RENEW - bool "DHCP Address Renewal" + tristate "DHCP Address Renewal" default n select NETUTILS_DHCPC depends on NET_UDP && NET_BROADCAST && NET_IPv4 && NET_ETHERNET diff --git a/system/dhcpc/Make.defs b/system/dhcpc/Make.defs index 81c55afe8..6bf5a354d 100644 --- a/system/dhcpc/Make.defs +++ b/system/dhcpc/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_DHCPC_RENEW),y) +ifneq ($(CONFIG_SYSTEM_DHCPC_RENEW),) CONFIGURED_APPS += system/dhcpc endif diff --git a/system/dhcpc/Makefile b/system/dhcpc/Makefile index c44f6afc1..439acc42f 100644 --- a/system/dhcpc/Makefile +++ b/system/dhcpc/Makefile @@ -33,108 +33,24 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # DHCPC address renewal built-in application info CONFIG_DHCPC_RENEW_PRIORITY ?= SCHED_PRIORITY_DEFAULT CONFIG_DHCPC_RENEW_STACKSIZE ?= 2048 -RENEW_APPNAME = renew -RENEW_PRIORITY = $(CONFIG_DHCPC_RENEW_PRIORITY) -RENEW_STACKSIZE = $(CONFIG_DHCPC_RENEW_STACKSIZE) +APPNAME = renew +PRIORITY = $(CONFIG_DHCPC_RENEW_PRIORITY) +STACKSIZE = $(CONFIG_DHCPC_RENEW_STACKSIZE) CONFIG_DHCPC_RENEW_PROGNAME ?= renew$(EXEEXT) -RENEW_PROGNAME = $(CONFIG_DHCPC_RENEW_PROGNAME) +PROGNAME = $(CONFIG_DHCPC_RENEW_PROGNAME) # DHCPC address renewal -RENEW_SRCS = -RENEW_MAINSRC = renew_main.c +MAINSRC = renew_main.c -RENEW_OBJS = $(RENEW_SRCS:.c=$(OBJEXT)) -RENEW_MAINOBJ = $(RENEW_MAINSRC:.c=$(OBJEXT)) +MODULE = CONFIG_SYSTEM_DHCPC_RENEW -# Other DHCPC commands go here - -SRCS = $(RENEW_SRCS) $(RENEW_MAINSRC) -OBJS = $(RENEW_OBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(RENEW_MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(RENEW_OBJS) $(RENEW_MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(RENEW_PROGNAME): $(OBJS) $(RENEW_MAINOBJ) - @echo "LD: $(RENEW_PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(RENEW_PROGNAME) $(ARCHCRT0OBJ) $(RENEW_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(RENEW_PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(RENEW_PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(RENEW_APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(RENEW_APPNAME),$(RENEW_PRIORITY),$(RENEW_STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(RENEW_APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(RENEW_APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/dhcpc/renew_main.c b/system/dhcpc/renew_main.c index 341fd4a7c..718d4f162 100644 --- a/system/dhcpc/renew_main.c +++ b/system/dhcpc/renew_main.c @@ -69,7 +69,7 @@ static void dhcpc_showusage(FAR const char *progname, int exitcode) * renew_main ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int renew_main(int argc, char *argv[]) diff --git a/system/embedlog/Makefile b/system/embedlog/Makefile index 56c750ec3..74c841200 100644 --- a/system/embedlog/Makefile +++ b/system/embedlog/Makefile @@ -33,11 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs - -ROOTDEPPATH = --dep-path . WGET = wget CP = cp -R @@ -52,7 +48,7 @@ EMBEDLOG_TARBALL = $(EMBEDLOG_SOURCES).$(EMBEDLOG_EXT) CFLAGS += -I$(APPDIR)/include/system -SRCS = embedlog/src/el-options.c \ +CSRCS = embedlog/src/el-options.c \ embedlog/src/el-perror.c \ embedlog/src/el-pmemory.c \ embedlog/src/el-print.c \ @@ -116,22 +112,22 @@ endif ifeq ($(CONFIG_EMBEDLOG_ENABLE_OUT_FILE),y) CFLAGS += -DENABLE_OUT_FILE - SRCS += embedlog/src/el-file.c + CSRCS += embedlog/src/el-file.c else CFLAGS += -DENABLE_OUT_FILE=0 endif ifeq ($(CONFIG_EMBEDLOG_ENABLE_BINARY_LOGS),y) CFLAGS += -DENABLE_BINARY_LOGS - SRCS += embedlog/src/el-pbinary.c - SRCS += embedlog/src/el-encode-number.c + CSRCS += embedlog/src/el-pbinary.c + CSRCS += embedlog/src/el-encode-number.c else CFLAGS += -DENABLE_BINARY_LOGS=0 endif ifeq ($(CONFIG_EMBEDLOG_ENABLE_OUT_TTY),y) CFLAGS += -DENABLE_OUT_TTY - SRCS += embedlog/src/el-tty.c + CSRCS += embedlog/src/el-tty.c else CFLAGS += -DENABLE_OUT_TTY=0 endif @@ -172,19 +168,6 @@ CFLAGS += -DENABLE_CLOCK=0 # building of embedlog -CCEXT = .c -COBJS = $(SRCS:$(CCEXT)=$(OBJEXT)) - -ifeq ($(WINTOOL),y) - BIN = "${shell cygpath -w $(APPDIR)/libapps$(LIBEXT)}" -else - BIN = $(APPDIR)/libapps$(LIBEXT) -endif -DEPBIN = $(APPDIR)/libapps$(LIBEXT) - -all: .built -.PHONY: clean depend distclean preconfig context - $(EMBEDLOG_TARBALL): @echo "Downloading: $@" $(Q) $(WGET) -O $@ $(EMBEDLOG_URL)/$@ @@ -204,36 +187,16 @@ embedlog: $(EMBEDLOG_SOURCES) create_includes: $(Q) $(CP) $(EMBEDLOG_SOURCES)/include/embedlog.h $(APPDIR)/include/system -$(COBJS): %$(OBJEXT): %$(CCEXT) - $(Q) $(call COMPILE, $<, $@) - -.built: $(COBJS) - $(Q) $(call ARCHIVE, $(BIN), $(COBJS)) - $(Q) touch $@ - -context: embedlog +context:: embedlog $(Q) $(MAKE) create_includes -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(CSRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -install: - -clean: - $(Q) $(call DELFILE, .built) +clean:: $(Q) $(call DELFILE, $(APPDIR)/include/system/embedlog.h) $(Q) $(foreach COBJ, $(COBJS), $(call DELFILE, $(COBJ))) -distclean: clean - $(Q) $(call DELFILE, Make.dep) - $(Q) $(call DELFILE, .depend) +distclean:: $(Q) $(call DELDIR, embedlog) $(Q) $(call DELDIR, $(EMBEDLOG_SOURCES)) $(Q) $(call DELDIR, $(EMBEDLOG_TARBALL)) -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/flash_eraseall/Kconfig b/system/flash_eraseall/Kconfig index 3f378aca1..e4d8d768c 100644 --- a/system/flash_eraseall/Kconfig +++ b/system/flash_eraseall/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_FLASH_ERASEALL - bool "FLASH Erase-all Command" + tristate "FLASH Erase-all Command" default n depends on MTD && NSH_BUILTIN_APPS select FSUTILS_FLASH_ERASEALL diff --git a/system/flash_eraseall/Make.defs b/system/flash_eraseall/Make.defs index bd1c8a501..5d1796daf 100644 --- a/system/flash_eraseall/Make.defs +++ b/system/flash_eraseall/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_FLASH_ERASEALL),y) +ifneq ($(CONFIG_SYSTEM_FLASH_ERASEALL),) CONFIGURED_APPS += system/flash_eraseall endif diff --git a/system/flash_eraseall/Makefile b/system/flash_eraseall/Makefile index fb6595e0d..9d430b4ea 100644 --- a/system/flash_eraseall/Makefile +++ b/system/flash_eraseall/Makefile @@ -38,9 +38,7 @@ # TODO, this makefile should run make under the app dirs, instead of # sourcing the Make.defs! --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # flash_eraseall Application # TODO: appname can be automatically extracted from the directory name @@ -49,99 +47,11 @@ APPNAME = flash_eraseall PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 1024 -ASRCS = -CSRCS = MAINSRC = flash_eraseall_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= flash_eraseall$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +MODULE = CONFIG_SYSTEM_FLASH_ERASEALL -# Common build - -VPATH = - -all: .built -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -preconfig: - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/flash_eraseall/flash_eraseall_main.c b/system/flash_eraseall/flash_eraseall_main.c index c4a0dcb8d..5a15cdaf9 100644 --- a/system/flash_eraseall/flash_eraseall_main.c +++ b/system/flash_eraseall/flash_eraseall_main.c @@ -49,7 +49,7 @@ * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int flash_eraseall_main(int argc, char *argv[]) diff --git a/system/hex2bin/Kconfig b/system/hex2bin/Kconfig index be9663bda..5d346ed8d 100644 --- a/system/hex2bin/Kconfig +++ b/system/hex2bin/Kconfig @@ -4,7 +4,7 @@ # menuconfig SYSTEM_HEX2BIN - bool "Intel HEX to binary conversion" + tristate "Intel HEX to binary conversion" default n select LIB_HEX2BIN ---help--- diff --git a/system/hex2bin/Make.defs b/system/hex2bin/Make.defs index d89cd2341..277c3bc54 100644 --- a/system/hex2bin/Make.defs +++ b/system/hex2bin/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_HEX2BIN),y) +ifneq ($(CONFIG_SYSTEM_HEX2BIN),) CONFIGURED_APPS += system/hex2bin endif diff --git a/system/hex2bin/Makefile b/system/hex2bin/Makefile index ba7d9939a..2f4b54159 100644 --- a/system/hex2bin/Makefile +++ b/system/hex2bin/Makefile @@ -33,152 +33,42 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Hex2bin utility -ASRCS = -CSRCS = - -ifeq ($(CONFIG_BUILD_LOADABLE),y) - -HEX2BIN_MAINSRC = hex2bin_main.c -HEX2MEM_MAINSRC = hex2mem_main.c - -else - -ifeq ($(CONFIG_SYSTEM_HEX2BIN_BUILTIN),y) -HEX2BIN_MAINSRC = hex2bin_main.c -endif - -ifeq ($(CONFIG_SYSTEM_HEX2MEM_BUILTIN),y) -HEX2MEM_MAINSRC = hex2mem_main.c -endif - -endif - -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -HEX2BIN_MAINOBJ = $(HEX2BIN_MAINSRC:.c=$(OBJEXT)) -HEX2MEM_MAINOBJ = $(HEX2MEM_MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) -MAINOBJ = $(HEX2BIN_MAINOBJ) $(HEX2MEM_MAINOBJ) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_SYSTEM_HEX2BIN_PROGNAME ?= hex2bin$(EXEEXT) -HEX2BIN_PROGNAME = $(CONFIG_SYSTEM_HEX2BIN_PROGNAME) - -CONFIG_SYSTEM_HEX2MEM_PROGNAME ?= hex2mem$(EXEEXT) -HEX2MEM_PROGNAME = $(CONFIG_SYSTEM_HEX2MEM_PROGNAME) - -ROOTDEPPATH = --dep-path . -VPATH = - CONFIG_SYSTEM_HEX2BIN_STACKSIZE ?= 1536 CONFIG_SYSTEM_HEX2BIN_PRIORITY ?= 100 -HEX2BIN_STACKSIZE = $(CONFIG_SYSTEM_HEX2BIN_STACKSIZE) -HEX2BIN_PRIORITY = $(CONFIG_SYSTEM_HEX2BIN_PRIORITY) - +CONFIG_SYSTEM_HEX2MEM_PROGNAME ?= hex2mem$(EXEEXT) CONFIG_SYSTEM_HEX2MEM_STACKSIZE ?= 1536 CONFIG_SYSTEM_HEX2MEM_PRIORITY ?= 100 -HEX2MEM_STACKSIZE = $(CONFIG_SYSTEM_HEX2MEM_STACKSIZE) -HEX2MEM_PRIORITY = $(CONFIG_SYSTEM_HEX2MEM_PRIORITY) - -# Build targets - -all: .built -.PHONY: context .depend depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -# Register application(s) - -ifeq ($(CONFIG_SYSTEM_HEX2BIN_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)hex2bin.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,"hex2bin",$(HEX2BIN_PRIORITY),$(HEX2BIN_STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,hex2bin_main)) - -rhex2bin: $(BUILTIN_REGISTRY)$(DELIM)hex2bin.bdat +ifeq ($(CONFIG_SYSTEM_HEX2BIN),m) + MAINSRC = hex2bin_main.c hex2mem_main.c + PROGNAME = $(CONFIG_SYSTEM_HEX2BIN_PROGNAME) $(CONFIG_SYSTEM_HEX2MEM_PROGNAME) + APPNAME = hex2bin hex2mem + STACKSIZE = $(CONFIG_SYSTEM_HEX2BIN_STACKSIZE) $(CONFIG_SYSTEM_HEX2MEM_STACKSIZE) + PRIORITY = $(CONFIG_SYSTEM_HEX2BIN_PRIORITY) $(CONFIG_SYSTEM_HEX2MEM_PRIORITY) else -rhex2bin: + ifeq ($(CONFIG_SYSTEM_HEX2BIN_BUILTIN),y) + MAINSRC = hex2bin_main.c + PROGNAME = $(CONFIG_SYSTEM_HEX2BIN_PROGNAME) + APPNAME = hex2bin + STACKSIZE = $(CONFIG_SYSTEM_HEX2BIN_STACKSIZE) + PRIORITY = $(CONFIG_SYSTEM_HEX2BIN_PRIORITY) + endif + + ifeq ($(CONFIG_SYSTEM_HEX2MEM_BUILTIN),y) + MAINSRC += hex2mem_main.c + PROGNAME += $(CONFIG_SYSTEM_HEX2MEM_PROGNAME) + APPNAME += hex2mem + STACKSIZE += $(CONFIG_SYSTEM_HEX2MEM_STACKSIZE) + PRIORITY += $(CONFIG_SYSTEM_HEX2MEM_PRIORITY) + endif endif -ifeq ($(CONFIG_SYSTEM_HEX2MEM_BUILTIN),y) -$(BUILTIN_REGISTRY)$(DELIM)hex2mem.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,"hex2mem",$(HEX2MEM_PRIORITY),$(HEX2MEM_STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,hex2mem_main)) +MODULE = CONFIG_SYSTEM_HEX2BIN -rhex2mem: $(BUILTIN_REGISTRY)$(DELIM)hex2mem.bdat -else -rhex2mem: -endif - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(HEX2BIN_PROGNAME): $(OBJS) $(HEX2BIN_MAINOBJ) - @echo "LD: $(HEX2BIN_PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(HEX2BIN_PROGNAME) $(ARCHCRT0OBJ) $(HEX2BIN_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(HEX2BIN_PROGNAME) - -$(BIN_DIR)$(DELIM)$(HEX2MEM_PROGNAME): $(OBJS) $(HEX2MEM_MAINOBJ) - @echo "LD: $(HEX2MEM_PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(HEX2MEM_PROGNAME) $(ARCHCRT0OBJ) $(HEX2MEM_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(HEX2MEM_PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(HEX2BIN_PROGNAME) $(BIN_DIR)$(DELIM)$(HEX2MEM_PROGNAME) - -else -install: - -endif - -context: rhex2bin rhex2mem - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/hex2bin/hex2bin_main.c b/system/hex2bin/hex2bin_main.c index f66adf57c..20d613d25 100644 --- a/system/hex2bin/hex2bin_main.c +++ b/system/hex2bin/hex2bin_main.c @@ -109,7 +109,7 @@ static void show_usage(FAR const char *progname, int exitcode) * ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int hex2bin_main(int argc, char **argv) diff --git a/system/hex2bin/hex2mem_main.c b/system/hex2bin/hex2mem_main.c index 3d9f9ae63..54414f0cc 100644 --- a/system/hex2bin/hex2mem_main.c +++ b/system/hex2bin/hex2mem_main.c @@ -104,7 +104,7 @@ static void show_usage(FAR const char *progname, int exitcode) * ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int hex2mem_main(int argc, char **argv) diff --git a/system/hexed/Kconfig b/system/hexed/Kconfig index 15cbc4ff6..4e6c37fc3 100644 --- a/system/hexed/Kconfig +++ b/system/hexed/Kconfig @@ -4,7 +4,7 @@ # menuconfig SYSTEM_HEXED - bool "Hex editor" + tristate "Hex editor" default n ---help--- Enable support for the hexed command line hexadecial file editor diff --git a/system/hexed/Make.defs b/system/hexed/Make.defs index f47238fe2..a0da6fca6 100644 --- a/system/hexed/Make.defs +++ b/system/hexed/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_HEXED),y) +ifneq ($(CONFIG_SYSTEM_HEXED),) CONFIGURED_APPS += system/hexed endif diff --git a/system/hexed/Makefile b/system/hexed/Makefile index 858b182bf..5ca0fc70e 100644 --- a/system/hexed/Makefile +++ b/system/hexed/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # hexed Application @@ -46,102 +44,18 @@ APPNAME = hexed PRIORITY = $(CONFIG_SYSTEM_HEXED_PRIORITY) STACKSIZE = $(CONFIG_SYSTEM_HEXED_STACKSIZE) -ASRCS = CSRCS = bfile.c cmdargs.c hexcopy.c hexdump.c hexenter.c hexhelp.c CSRCS += hexinsert.c hexmove.c hexremove.c hexword.c MAINSRC = hexed.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -CONFIG_XYZ_PROGNAME ?= install$(EXEEXT) +CONFIG_XYZ_PROGNAME ?= hexed$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" include} -ROOTDEPPATH = --dep-path src -# Common build +VPATH += :src +ROOTDEPPATH += --dep-path src -VPATH = src +MODULE = CONFIG_SYSTEM_HEXED -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/hexed/src/hexed.c b/system/hexed/src/hexed.c index d86c7f885..6bf4eba0b 100644 --- a/system/hexed/src/hexed.c +++ b/system/hexed/src/hexed.c @@ -371,7 +371,7 @@ int runargs(void) /* hexed - Hexadecimal File Editor */ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int hexed_main(int argc, char *argv[]) diff --git a/system/i2c/Kconfig b/system/i2c/Kconfig index 6671626bd..2aec9f3d0 100644 --- a/system/i2c/Kconfig +++ b/system/i2c/Kconfig @@ -5,7 +5,7 @@ menuconfig SYSTEM_I2CTOOL - bool "I2C tool" + tristate "I2C tool" default n depends on I2C select I2C_DRIVER diff --git a/system/i2c/Make.defs b/system/i2c/Make.defs index d9cbd061c..1846dd2a9 100644 --- a/system/i2c/Make.defs +++ b/system/i2c/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_I2CTOOL),y) +ifneq ($(CONFIG_SYSTEM_I2CTOOL),) CONFIGURED_APPS += system/i2c endif diff --git a/system/i2c/Makefile b/system/i2c/Makefile index 0a52cba6f..af9b8a142 100644 --- a/system/i2c/Makefile +++ b/system/i2c/Makefile @@ -33,106 +33,20 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # I2C tool - -ASRCS = CSRCS = i2c_bus.c i2c_common.c i2c_dev.c i2c_get.c i2c_set.c i2c_verf.c CSRCS += i2c_devif.c MAINSRC = i2c_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= i2c$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . -VPATH = - APPNAME = i2c PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Build targets +MODULE = CONFIG_SYSTEM_I2CTOOL -all: .built -.PHONY: context .depend depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/i2c/i2c_main.c b/system/i2c/i2c_main.c index 3475c09c7..8ace1898f 100644 --- a/system/i2c/i2c_main.c +++ b/system/i2c/i2c_main.c @@ -345,7 +345,7 @@ static void i2c_teardown(FAR struct i2ctool_s *i2ctool) * Name: i2c_main ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int i2c_main(int argc, char *argv[]) diff --git a/system/install/Kconfig b/system/install/Kconfig index 652daf4a9..b8dde1431 100644 --- a/system/install/Kconfig +++ b/system/install/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_INSTALL - bool "FLASH Program Installation" + tristate "FLASH Program Installation" default n ---help--- Enable support for the FLASH installation tool. diff --git a/system/install/Make.defs b/system/install/Make.defs index d238d610c..fc99d2fb5 100644 --- a/system/install/Make.defs +++ b/system/install/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_INSTALL),y) +ifneq ($(CONFIG_SYSTEM_INSTALL),) CONFIGURED_APPS += system/install endif diff --git a/system/install/Makefile b/system/install/Makefile index 4c9bebec3..c6b2e5f0d 100644 --- a/system/install/Makefile +++ b/system/install/Makefile @@ -38,9 +38,7 @@ # TODO, this makefile should run make under the app dirs, instead of # sourcing the Make.defs! --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Install Application # TODO: appname can be automatically extracted from the directory name @@ -49,100 +47,11 @@ APPNAME = install PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 1024 -ASRCS = -CSRCS = MAINSRC = install.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= install$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +MODULE = CONFIG_SYSTEM_INSTALL -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/install/install.c b/system/install/install.c index 3f95b320a..060aba9ed 100644 --- a/system/install/install.c +++ b/system/install/install.c @@ -330,7 +330,7 @@ static int install_remove(const char *scriptname) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int install_main(int argc, char *argv[]) diff --git a/system/lm75/Kconfig b/system/lm75/Kconfig index 05a1570b7..c791e77c0 100644 --- a/system/lm75/Kconfig +++ b/system/lm75/Kconfig @@ -4,7 +4,7 @@ # menuconfig SYSTEM_LM75 - bool "Temperature" + tristate "Temperature" default n depends on LM75_I2C ---help--- diff --git a/system/lm75/Make.defs b/system/lm75/Make.defs index fff78f04e..2a59c7916 100644 --- a/system/lm75/Make.defs +++ b/system/lm75/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_LM75),y) +ifneq ($(CONFIG_SYSTEM_LM75),) CONFIGURED_APPS += system/lm75 endif diff --git a/system/lm75/Makefile b/system/lm75/Makefile index 9bbfc01b3..ecee3e6e8 100644 --- a/system/lm75/Makefile +++ b/system/lm75/Makefile @@ -33,116 +33,22 @@ # ############################################################################ -# TODO, this makefile should run make under the app dirs, instead of -# sourcing the Make.defs! - --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # LM-75 Temperature Sensor Application CONFIG_SYSTEM_LM75_PRIORITY ?= 100 CONFIG_SYSTEM_LM75_STACKSIZE ?= 1024 -APPNAME = temp +APPNAME = lm75 PRIORITY = $(CONFIG_SYSTEM_LM75_PRIORITY) STACKSIZE = $(CONFIG_SYSTEM_LM75_STACKSIZE) -ASRCS = -CSRCS = MAINSRC = lm75.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= lm75$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +MODULE = CONFIG_SYSTEM_LM75 -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,lm75_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/lm75/lm75.c b/system/lm75/lm75.c index 8d4127368..36a8ade27 100644 --- a/system/lm75/lm75.c +++ b/system/lm75/lm75.c @@ -183,7 +183,7 @@ static void parse_args(int argc, FAR char **argv) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int lm75_main(int argc, char *argv[]) diff --git a/system/lzf/Kconfig b/system/lzf/Kconfig index 69685b166..449ebf293 100644 --- a/system/lzf/Kconfig +++ b/system/lzf/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_LZF - bool "LZF compression tool" + tristate "LZF compression tool" default n depends on LIBC_LZF ---help--- diff --git a/system/lzf/Make.defs b/system/lzf/Make.defs index c63bae594..1b276e48c 100644 --- a/system/lzf/Make.defs +++ b/system/lzf/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_LZF),y) +ifneq ($(CONFIG_SYSTEM_LZF),) CONFIGURED_APPS += system/lzf endif diff --git a/system/lzf/Makefile b/system/lzf/Makefile index 1d1f2dcd1..10429d537 100644 --- a/system/lzf/Makefile +++ b/system/lzf/Makefile @@ -53,4 +53,6 @@ MAINSRC = lzf_main.c CONFIG_SYSTEM_LZF_PROGNAME ?= lzf$(EXEEXT) PROGNAME = $(CONFIG_SYSTEM_LZF_PROGNAME) +MODULE = CONFIG_SYSTEM_LZF + include $(APPDIR)/Application.mk diff --git a/system/mdio/Kconfig b/system/mdio/Kconfig index 5995017b4..420f1c619 100644 --- a/system/mdio/Kconfig +++ b/system/mdio/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_MDIO - bool "PHY Tool" + tristate "PHY Tool" default n depends on NETDEV_PHY_IOCTL ---help--- diff --git a/system/mdio/Make.defs b/system/mdio/Make.defs index 6868d7c9c..1099ba5a1 100644 --- a/system/mdio/Make.defs +++ b/system/mdio/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_MDIO),y) +ifneq ($(CONFIG_SYSTEM_MDIO),) CONFIGURED_APPS += system/mdio endif diff --git a/system/mdio/Makefile b/system/mdio/Makefile index a95ddf9c3..3c2669a32 100644 --- a/system/mdio/Makefile +++ b/system/mdio/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # MDIO tool built-in application info @@ -45,96 +43,11 @@ STACKSIZE = 2048 # MDIO tool -ASRCS = -CSRCS = MAINSRC = mdio_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= mdio$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +MODULE = CONFIG_SYSTEM_MDIO -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/mdio/mdio_main.c b/system/mdio/mdio_main.c index 5ad0c5475..847896425 100644 --- a/system/mdio/mdio_main.c +++ b/system/mdio/mdio_main.c @@ -159,7 +159,7 @@ int set_phy_reg(uint16_t phy_id, uint16_t reg_num, uint16_t val) * mdio_main ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int mdio_main(int argc, char *argv[]) diff --git a/system/netdb/Kconfig b/system/netdb/Kconfig index fec37e593..c2d39ff80 100644 --- a/system/netdb/Kconfig +++ b/system/netdb/Kconfig @@ -4,7 +4,7 @@ # menuconfig SYSTEM_NETDB - bool "netdb interface" + tristate "netdb interface" default n depends on LIBC_NETDB diff --git a/system/netdb/Make.defs b/system/netdb/Make.defs index 91d532649..fb4107468 100644 --- a/system/netdb/Make.defs +++ b/system/netdb/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_NETDB),y) +ifneq ($(CONFIG_SYSTEM_NETDB),) CONFIGURED_APPS += system/netdb endif diff --git a/system/netdb/Makefile b/system/netdb/Makefile index 2da1deaa2..b56019d34 100644 --- a/system/netdb/Makefile +++ b/system/netdb/Makefile @@ -33,86 +33,21 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # netdb Application +PROGNAME = netdb$(EXEEXT) + CONFIG_SYSTEM_NETDB_STACKSIZE ?= 2048 CONFIG_SYSTEM_NETDB_PRIORITY ?= 100 +APPNAME = netdb PRIORITY = $(CONFIG_SYSTEM_NETDB_PRIORITY) STACKSIZE = $(CONFIG_SYSTEM_NETDB_STACKSIZE) -ASRCS = -CSRCS = netdb_main.c +MAINSRC = netdb_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) +MODULE = CONFIG_SYSTEM_NETDB -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)netdb.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,"netdb",$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,netdb_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)netdb.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/netdb/netdb_main.c b/system/netdb/netdb_main.c index d4436c1c6..253feb8fa 100644 --- a/system/netdb/netdb_main.c +++ b/system/netdb/netdb_main.c @@ -94,7 +94,11 @@ static void show_usage(FAR const char *progname, int exitcode) * Public Functions ****************************************************************************/ +#ifdef BUILD_MODULE +int main(int argc, FAR char *argv[]) +#else int netdb_main(int argc, char **argv) +#endif { FAR struct hostent *host; FAR const char *addrtype; diff --git a/system/nsh/Makefile b/system/nsh/Makefile index 00d08731e..baa921f1a 100644 --- a/system/nsh/Makefile +++ b/system/nsh/Makefile @@ -52,6 +52,6 @@ PRIORITY = $(CONFIG_SYSTEM_NSH_PRIORITY) STACKSIZE = $(CONFIG_SYSTEM_NSH_STACKSIZE) endif -MODULE = SYSTEM_NSH +MODULE = CONFIG_SYSTEM_NSH include $(APPDIR)/Application.mk diff --git a/system/ntpc/Kconfig b/system/ntpc/Kconfig index c9f6b52e3..eddb55aa1 100644 --- a/system/ntpc/Kconfig +++ b/system/ntpc/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_NTPC - bool "NTP Daemon Commands" + tristate "NTP Daemon Commands" default n select NETUTILS_NTPCLIENT depends on NET_UDP diff --git a/system/ntpc/Make.defs b/system/ntpc/Make.defs index 07ab398c9..a3868a951 100644 --- a/system/ntpc/Make.defs +++ b/system/ntpc/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_NTPC),y) +ifneq ($(CONFIG_SYSTEM_NTPC),) CONFIGURED_APPS += system/ntpc endif diff --git a/system/ntpc/Makefile b/system/ntpc/Makefile index c665d8e24..33dd00e42 100644 --- a/system/ntpc/Makefile +++ b/system/ntpc/Makefile @@ -33,124 +33,22 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NTPC address renewal built-in application info CONFIG_SYSTEM_NTPC_PRIORITY ?= SCHED_PRIORITY_DEFAULT CONFIG_SYSTEM_NTPC_STACKSIZE ?= 2048 -APPNAME1 = ntpstart -APPNAME2 = ntpstop PRIORITY = $(CONFIG_SYSTEM_NTPC_PRIORITY) STACKSIZE = $(CONFIG_SYSTEM_NTPC_STACKSIZE) -PROGNAME1 = ntpstart$(EXEEXT) -PROGNAME2 = ntpstop$(EXEEXT) - # NTPC address renewal -ASRCS = -CSRCS = -MAINSRC1 = ntpcstart_main.c -MAINSRC2 = ntpcstop_main.c -MAINSRC = $(MAINSRC1) $(MAINSRC2) +MAINSRC = ntpcstart_main.c ntpcstop_main.c +APPNAME = ntpcstart ntpcstop +PROGNAME = ntpcstart$(EXEEXT) ntpcstop$(EXEEXT) -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ1 = $(MAINSRC1:.c=$(OBJEXT)) -MAINOBJ2 = $(MAINSRC2:.c=$(OBJEXT)) -MAINOBJ = $(MAINOBJ1) $(MAINOBJ2) +MODULE = CONFIG_SYSTEM_NTPC -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME1): $(OBJS) $(MAINOBJ1) - @echo "LD: $(PROGNAME1)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME1) $(ARCHCRT0OBJ) $(MAINOBJ1) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME1) - -$(BIN_DIR)$(DELIM)$(PROGNAME2): $(OBJS) $(MAINOBJ2) - @echo "LD: $(PROGNAME2)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME2) $(ARCHCRT0OBJ) $(MAINOBJ2) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME2) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME1) $(BIN_DIR)$(DELIM)$(PROGNAME2) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME1),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME1)_main)) - -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME2),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME2)_main)) - -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 - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/ntpc/ntpcstart_main.c b/system/ntpc/ntpcstart_main.c index 5be8dad0b..87f1c2ebf 100644 --- a/system/ntpc/ntpcstart_main.c +++ b/system/ntpc/ntpcstart_main.c @@ -52,7 +52,7 @@ * ntpcstart_main ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int ntpcstart_main(int argc, char *argv[]) diff --git a/system/ntpc/ntpcstop_main.c b/system/ntpc/ntpcstop_main.c index 48b8837ba..4f20d0110 100644 --- a/system/ntpc/ntpcstop_main.c +++ b/system/ntpc/ntpcstop_main.c @@ -52,7 +52,7 @@ * ntpcstop_main ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int ntpcstop_main(int argc, char *argv[]) diff --git a/system/nxplayer/Kconfig b/system/nxplayer/Kconfig index 8a7a4370a..531b8c00b 100644 --- a/system/nxplayer/Kconfig +++ b/system/nxplayer/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_NXPLAYER - bool "NxPlayer Media Player" + tristate "NxPlayer Media Player" default n depends on AUDIO ---help--- diff --git a/system/nxplayer/Make.defs b/system/nxplayer/Make.defs index c3f912559..b0a857777 100644 --- a/system/nxplayer/Make.defs +++ b/system/nxplayer/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_NXPLAYER),y) +ifneq ($(CONFIG_SYSTEM_NXPLAYER),) CONFIGURED_APPS += system/nxplayer endif diff --git a/system/nxplayer/Makefile b/system/nxplayer/Makefile index 66e591a1b..54235ec9c 100644 --- a/system/nxplayer/Makefile +++ b/system/nxplayer/Makefile @@ -35,13 +35,10 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NxPlayer Library -ASRCS = CSRCS = nxplayer.c # NxPlayer Application @@ -50,7 +47,7 @@ APPNAME = nxplayer PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -ifeq ($(CONFIG_BUILD_LOADABLE),y) +ifeq ($(CONFIG_SYSTEM_NXPLAYER),m) MAINSRC = nxplayer_main.c else ifeq ($(CONFIG_NXPLAYER_COMMAND_LINE),y) @@ -58,100 +55,9 @@ MAINSRC = nxplayer_main.c endif endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= nxplayer$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +MODULE = CONFIG_SYSTEM_NXPLAYER -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -ifeq ($(CONFIG_NXPLAYER_COMMAND_LINE),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/nxplayer/nxplayer_main.c b/system/nxplayer/nxplayer_main.c index ad6a1765c..5f8ca57bc 100644 --- a/system/nxplayer/nxplayer_main.c +++ b/system/nxplayer/nxplayer_main.c @@ -653,7 +653,7 @@ static int nxplayer_cmd_help(FAR struct nxplayer_s *pPlayer, char *parg) * ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int nxplayer_main(int argc, char *argv[]) diff --git a/system/nxrecorder/Kconfig b/system/nxrecorder/Kconfig index f6c9e6e84..abccf0020 100644 --- a/system/nxrecorder/Kconfig +++ b/system/nxrecorder/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_NXRECORDER - bool "NxRecorder pcm raw data Recorder" + tristate "NxRecorder pcm raw data Recorder" default n depends on AUDIO ---help--- diff --git a/system/nxrecorder/Make.defs b/system/nxrecorder/Make.defs index 379732ac0..1db32ac76 100644 --- a/system/nxrecorder/Make.defs +++ b/system/nxrecorder/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_NXRECORDER),y) +ifneq ($(CONFIG_SYSTEM_NXRECORDER),) CONFIGURED_APPS += system/nxrecorder endif diff --git a/system/nxrecorder/Makefile b/system/nxrecorder/Makefile index c76dea3e6..7eb2bb058 100644 --- a/system/nxrecorder/Makefile +++ b/system/nxrecorder/Makefile @@ -32,22 +32,17 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NxRecorder Library -ASRCS = CSRCS = nxrecorder.c -# NxRecorder Application - APPNAME = nxrecorder PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -ifeq ($(CONFIG_BUILD_LOADABLE),y) +ifeq ($(CONFIG_SYSTEM_NXRECORDER),m) MAINSRC = nxrecorder_main.c else ifeq ($(CONFIG_NXRECORDER_COMMAND_LINE),y) @@ -55,100 +50,9 @@ MAINSRC = nxrecorder_main.c endif endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= nxrecorder$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +MODULE = CONFIG_SYSTEM_NXRECORDER -# Common build - -VPATH := :$(SRCDIR) - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -ifeq ($(CONFIG_NXRECORDER_COMMAND_LINE),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $^ >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/nxrecorder/nxrecorder_main.c b/system/nxrecorder/nxrecorder_main.c index 6c49df33c..a4a98d023 100644 --- a/system/nxrecorder/nxrecorder_main.c +++ b/system/nxrecorder/nxrecorder_main.c @@ -391,7 +391,7 @@ static int nxrecorder_cmd_help(FAR struct nxrecorder_s *pRecorder, char *parg) * ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int nxrecorder_main(int argc, char *argv[]) diff --git a/system/ping/Kconfig b/system/ping/Kconfig index 63761a01b..cfaec74ff 100644 --- a/system/ping/Kconfig +++ b/system/ping/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_PING - bool "ICMP 'ping' command" + tristate "ICMP 'ping' command" default n depends on NET_ICMP_SOCKET || NET_USRSOCK ---help--- diff --git a/system/ping/Make.defs b/system/ping/Make.defs index bfa131c0c..5b063a182 100644 --- a/system/ping/Make.defs +++ b/system/ping/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_PING),y) +ifneq ($(CONFIG_SYSTEM_PING),) CONFIGURED_APPS += system/ping endif diff --git a/system/ping/Makefile b/system/ping/Makefile index 3d9a30cce..0bbf0bcf8 100644 --- a/system/ping/Makefile +++ b/system/ping/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # ICMP ping command @@ -51,97 +49,8 @@ PROGNAME = $(CONFIG_SYSTEM_PING_PROGNAME) # Files -ASRCS = -CSRCS = MAINSRC = ping.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) +MODULE = CONFIG_SYSTEM_PING -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/ping/ping.c b/system/ping/ping.c index b5f21c812..8a4a0b468 100644 --- a/system/ping/ping.c +++ b/system/ping/ping.c @@ -442,7 +442,7 @@ static void show_usage(FAR const char *progname, int exitcode) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int ping_main(int argc, char **argv) diff --git a/system/ping6/Kconfig b/system/ping6/Kconfig index 5e9582953..695464043 100644 --- a/system/ping6/Kconfig +++ b/system/ping6/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_PING6 - bool "ICMPv6 'ping6' command" + tristate "ICMPv6 'ping6' command" default n depends on NET_ICMPv6_SOCKET || NET_USRSOCK ---help--- diff --git a/system/ping6/Make.defs b/system/ping6/Make.defs index d25253e78..fa3b2ebbd 100644 --- a/system/ping6/Make.defs +++ b/system/ping6/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_PING6),y) +ifneq ($(CONFIG_SYSTEM_PING6),) CONFIGURED_APPS += system/ping6 endif diff --git a/system/ping6/Makefile b/system/ping6/Makefile index 3c11bb8ac..3d2d83eb5 100644 --- a/system/ping6/Makefile +++ b/system/ping6/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # ICMP ping6 command @@ -51,97 +49,8 @@ PROGNAME = $(CONFIG_SYSTEM_PING6_PROGNAME) # Files -ASRCS = -CSRCS = MAINSRC = ping6.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) +MODULE = CONFIG_SYSTEM_PING6 -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/ping6/ping6.c b/system/ping6/ping6.c index 62718417f..a10aa0f2f 100644 --- a/system/ping6/ping6.c +++ b/system/ping6/ping6.c @@ -443,7 +443,7 @@ static void show_usage(FAR const char *progname, int exitcode) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int ping6_main(int argc, char **argv) diff --git a/system/prun/Kconfig b/system/prun/Kconfig index 1fa76a791..a2ddef44e 100644 --- a/system/prun/Kconfig +++ b/system/prun/Kconfig @@ -4,7 +4,7 @@ # menuconfig SYSTEM_PRUN - bool "Pascal P-Code interpreter" + tristate "Pascal P-Code interpreter" default n depends on INTERPRETERS_PCODE ---help--- diff --git a/system/prun/Make.defs b/system/prun/Make.defs index 06ab6b63c..2476fe531 100644 --- a/system/prun/Make.defs +++ b/system/prun/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_PRUN),y) +ifneq ($(CONFIG_SYSTEM_PRUN),) CONFIGURED_APPS += system/prun endif diff --git a/system/prun/Makefile b/system/prun/Makefile index a6f673977..79bdac686 100644 --- a/system/prun/Makefile +++ b/system/prun/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Pascal P-Code interpreter / Virtual machine @@ -51,104 +49,15 @@ APPNAME = pexec PRIORITY = $(CONFIG_SYSTEM_PEXEC_PRIORITY) STACKSIZE = $(CONFIG_SYSTEM_PEXEC_STACKSIZE) -ASRCS = -CSRCS = -MAINSRC = prun.c +CSRCS = prun.c ifeq ($(CONFIG_SYSTEM_PEXEC),y) -CSRCS += pexec_main.c -endif - -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) +MAINSRC += pexec_main.c endif CONFIG_XYZ_PROGNAME ?= prun$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +MODULE = CONFIG_SYSTEM_PRUN -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -ifeq ($(CONFIG_SYSTEM_PEXEC),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif -else -context: -endif - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/prun/pexec_main.c b/system/prun/pexec_main.c index e25355d39..c5bcea8e7 100644 --- a/system/prun/pexec_main.c +++ b/system/prun/pexec_main.c @@ -81,7 +81,7 @@ static void show_usage(FAR const char *progname, int errcode) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int pexec_main(int argc, FAR char **argv) diff --git a/system/ramtest/Kconfig b/system/ramtest/Kconfig index 816a2d0be..ee6114a48 100644 --- a/system/ramtest/Kconfig +++ b/system/ramtest/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_RAMTEST - bool "RAM Test" + tristate "RAM Test" default n ---help--- Enable a simple RAM test. diff --git a/system/ramtest/Make.defs b/system/ramtest/Make.defs index 3b192bdc0..05023b90c 100644 --- a/system/ramtest/Make.defs +++ b/system/ramtest/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_RAMTEST),y) +ifneq ($(CONFIG_SYSTEM_RAMTEST),) CONFIGURED_APPS += system/ramtest endif diff --git a/system/ramtest/Makefile b/system/ramtest/Makefile index d98573725..77a18e26e 100644 --- a/system/ramtest/Makefile +++ b/system/ramtest/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # RAM test @@ -49,97 +47,8 @@ STACKSIZE = $(CONFIG_SYSTEM_RAMTEST_STACKSIZE) CONFIG_SYSTEM_RAMTEST_PROGNAME ?= ramtest$(EXEEXT) PROGNAME = $(CONFIG_SYSTEM_RAMTEST_PROGNAME) -ASRCS = -CSRCS = MAINSRC = ramtest.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) +MODULE = CONFIG_SYSTEM_RAMTEST -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME).bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME).bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/ramtest/ramtest.c b/system/ramtest/ramtest.c index e45fd4692..cc85432b4 100644 --- a/system/ramtest/ramtest.c +++ b/system/ramtest/ramtest.c @@ -556,7 +556,7 @@ static void addr_in_addr(FAR struct ramtest_s *info) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int ramtest_main(int argc, char **argv) diff --git a/system/readline/Makefile b/system/readline/Makefile index cc936f86a..86c7a5abb 100644 --- a/system/readline/Makefile +++ b/system/readline/Makefile @@ -33,75 +33,9 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # The Readline Library - -ASRCS = CSRCS = readline.c readline_common.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -# Context build phase target - -install: - -context: - -# Dependency build phase target - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -# Housekeeping targets - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/sched_note/Kconfig b/system/sched_note/Kconfig index c0857a8f3..3efd40554 100644 --- a/system/sched_note/Kconfig +++ b/system/sched_note/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_NOTE - bool "Scheduler monitor" + tristate "Scheduler monitor" default n depends on DRIVER_NOTE ---help--- diff --git a/system/sched_note/Make.defs b/system/sched_note/Make.defs index 8f998fe6f..b2f468915 100644 --- a/system/sched_note/Make.defs +++ b/system/sched_note/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_NOTE),y) +ifneq ($(CONFIG_SYSTEM_NOTE),) CONFIGURED_APPS += system/sched_note endif diff --git a/system/sched_note/Makefile b/system/sched_note/Makefile index b6caf3f69..174bec01f 100644 --- a/system/sched_note/Makefile +++ b/system/sched_note/Makefile @@ -53,4 +53,6 @@ MAINSRC = note_main.c CONFIG_SYSTEM_NOTE_PROGNAME ?= note$(EXEEXT) PROGNAME = $(CONFIG_SYSTEM_NOTE_PROGNAME) +MODULE = CONFIG_SYSTEM_NOTE + include $(APPDIR)/Application.mk diff --git a/system/setlogmask/Kconfig b/system/setlogmask/Kconfig index adeb7d81f..aa6041724 100644 --- a/system/setlogmask/Kconfig +++ b/system/setlogmask/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_SETLOGMASK - bool "'setlogmask' command" + tristate "'setlogmask' command" default n ---help--- Enable support for 'setlogmask' command used to set syslog level. diff --git a/system/setlogmask/Make.defs b/system/setlogmask/Make.defs index 075afeb87..75120298c 100644 --- a/system/setlogmask/Make.defs +++ b/system/setlogmask/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_SETLOGMASK),y) +ifneq ($(CONFIG_SYSTEM_SETLOGMASK),) CONFIGURED_APPS += system/setlogmask endif diff --git a/system/setlogmask/Makefile b/system/setlogmask/Makefile index a662d4a67..7608ca72b 100644 --- a/system/setlogmask/Makefile +++ b/system/setlogmask/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # setlogmask command @@ -51,97 +49,8 @@ PROGNAME = $(CONFIG_SYSTEM_SETLOGMASK_PROGNAME) # Files -ASRCS = -CSRCS = MAINSRC = setlogmask.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) +MODULE = CONFIG_SYSTEM_SETLOGMASK -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/setlogmask/setlogmask.c b/system/setlogmask/setlogmask.c index 95e8ef0c4..1d267220a 100644 --- a/system/setlogmask/setlogmask.c +++ b/system/setlogmask/setlogmask.c @@ -85,7 +85,7 @@ static void show_usage(FAR const char *progname, int exitcode) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int setlogmask_main(int argc, char **argv) diff --git a/system/stackmonitor/Kconfig b/system/stackmonitor/Kconfig index e0ad801f4..d359263b0 100644 --- a/system/stackmonitor/Kconfig +++ b/system/stackmonitor/Kconfig @@ -4,7 +4,7 @@ # menuconfig SYSTEM_STACKMONITOR - bool "Stack Monitor" + tristate "Stack Monitor" default n depends on FS_PROCFS && !_FS_PROCFS_EXCLUDE_PROCESS && STACK_COLORATION ---help--- diff --git a/system/stackmonitor/Make.defs b/system/stackmonitor/Make.defs index 85da0edfb..4bf5491fc 100644 --- a/system/stackmonitor/Make.defs +++ b/system/stackmonitor/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_STACKMONITOR),y) +ifneq ($(CONFIG_SYSTEM_STACKMONITOR),) CONFIGURED_APPS += system/stackmonitor endif diff --git a/system/stackmonitor/Makefile b/system/stackmonitor/Makefile index 129c2ff36..215b5368f 100644 --- a/system/stackmonitor/Makefile +++ b/system/stackmonitor/Makefile @@ -33,113 +33,20 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Stack Monitor Application PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -ASRCS = -CSRCS = MAINSRC = stackmonitor.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= ramtest$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +APPNAME = stackmonitor_start stackmonitor_stop -# Common build +MODULE = CONFIG_SYSTEM_STACKMONITOR -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)stackmonitor_start.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,"stkmon_start",$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,stackmonitor_start)) - -$(BUILTIN_REGISTRY)$(DELIM)stackmonitor_stop.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,"stkmon_stop",$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,stackmonitor_stop)) - -context: $(BUILTIN_REGISTRY)$(DELIM)stackmonitor_start.bdat $(BUILTIN_REGISTRY)$(DELIM)stackmonitor_stop.bdat -else -context: - -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/stackmonitor/stackmonitor.c b/system/stackmonitor/stackmonitor.c index f0419f5be..6616343fb 100644 --- a/system/stackmonitor/stackmonitor.c +++ b/system/stackmonitor/stackmonitor.c @@ -418,7 +418,7 @@ static int stackmonitor_daemon(int argc, char **argv) * Public Functions ****************************************************************************/ -int stackmonitor_start(int argc, char **argv) +int stackmonitor_start_main(int argc, char **argv) { /* Has the monitor already started? */ @@ -459,7 +459,7 @@ int stackmonitor_start(int argc, char **argv) return 0; } -int stackmonitor_stop(int argc, char **argv) +int stackmonitor_stop_main(int argc, char **argv) { /* Has the monitor already started? */ diff --git a/system/sudoku/Kconfig b/system/sudoku/Kconfig index 982e7a86b..f0e5a97e9 100644 --- a/system/sudoku/Kconfig +++ b/system/sudoku/Kconfig @@ -4,7 +4,7 @@ # menuconfig SYSTEM_SUDOKU - bool "Sudoku" + tristate "Sudoku" default n select SYSTEM_READLINE ---help--- diff --git a/system/sudoku/Make.defs b/system/sudoku/Make.defs index 0695a50c5..cc5fdcb66 100644 --- a/system/sudoku/Make.defs +++ b/system/sudoku/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_SUDOKU),y) +ifneq ($(CONFIG_SYSTEM_SUDOKU),) CONFIGURED_APPS += system/sudoku endif diff --git a/system/sudoku/Makefile b/system/sudoku/Makefile index 09bee17d9..b0bacf122 100644 --- a/system/sudoku/Makefile +++ b/system/sudoku/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Sudoku Application @@ -45,100 +43,11 @@ CONFIG_SYSTEM_SUDOKU_PRIORITY ?= 100 STACKSIZE = $(CONFIG_SYSTEM_SUDOKU_STACKSIZE) PRIORITY = $(CONFIG_SYSTEM_SUDOKU_PRIORITY) -ASRCS = -CSRCS = MAINSRC = sudoku.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= sudoku$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +MODULE = CONFIG_SYSTEM_SUDOKU -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)sudoku.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,"sudoku",$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,sudoku_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)sudoku.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/sudoku/sudoku.c b/system/sudoku/sudoku.c index 53df3e9a1..9ceb681b5 100644 --- a/system/sudoku/sudoku.c +++ b/system/sudoku/sudoku.c @@ -500,7 +500,7 @@ static inline void count_cells(void) * Private Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int sudoku_main(int argc, char **argv, char **envp) diff --git a/system/symtab/Makefile b/system/symtab/Makefile index 04ec8f69e..8c735dd2f 100644 --- a/system/symtab/Makefile +++ b/system/symtab/Makefile @@ -33,71 +33,9 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Symbol table support - -ASRCS = CSRCS = symtab.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -install: - -context: - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/system/Makefile b/system/system/Makefile index e2d46fc6b..70e07de15 100644 --- a/system/system/Makefile +++ b/system/system/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # system command diff --git a/system/taskset/Kconfig b/system/taskset/Kconfig index 00db246bc..87f585d8d 100644 --- a/system/taskset/Kconfig +++ b/system/taskset/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_TASKSET - bool "Taskset Command" + tristate "Taskset Command" default n depends on SMP && NSH_LIBRARY && SCHED_WAITPID ---help--- diff --git a/system/taskset/Make.defs b/system/taskset/Make.defs index ec5f41d67..5528cf0c8 100644 --- a/system/taskset/Make.defs +++ b/system/taskset/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_TASKSET),y) +ifneq ($(CONFIG_SYSTEM_TASKSET),) CONFIGURED_APPS += system/taskset endif diff --git a/system/taskset/Makefile b/system/taskset/Makefile index 618f11651..11887a9b8 100644 --- a/system/taskset/Makefile +++ b/system/taskset/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # taskset command @@ -51,97 +49,8 @@ PROGNAME = $(CONFIG_SYSTEM_TASKSET_PROGNAME) # Files -ASRCS = -CSRCS = MAINSRC = taskset.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) +MODULE = CONFIG_SYSTEM_TASKSET -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/taskset/taskset.c b/system/taskset/taskset.c index bf21cab09..494a5ed1d 100644 --- a/system/taskset/taskset.c +++ b/system/taskset/taskset.c @@ -94,7 +94,7 @@ static bool get_cpuset(const char *arg, cpu_set_t *cpu_set) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int taskset_main(int argc, char **argv) diff --git a/system/tee/Kconfig b/system/tee/Kconfig index 22d394f9b..176867574 100644 --- a/system/tee/Kconfig +++ b/system/tee/Kconfig @@ -4,7 +4,7 @@ # config SYSTEM_TEE - bool "Tee Command" + tristate "Tee Command" default n ---help--- Enable support for the tee command. diff --git a/system/tee/Make.defs b/system/tee/Make.defs index 9ff686e1a..82fbf3454 100644 --- a/system/tee/Make.defs +++ b/system/tee/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_TEE),y) +ifneq ($(CONFIG_SYSTEM_TEE),) CONFIGURED_APPS += system/tee endif diff --git a/system/tee/Makefile b/system/tee/Makefile index d0ff4d190..919a3ec3d 100644 --- a/system/tee/Makefile +++ b/system/tee/Makefile @@ -35,9 +35,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # tee command @@ -48,100 +46,11 @@ APPNAME = tee PRIORITY = $(CONFIG_SYSTEM_TEE_PRIORITY) STACKSIZE = $(CONFIG_SYSTEM_TEE_PRIORITY) -ASRCS = -CSRCS = MAINSRC = tee.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= tee$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +MODULE = CONFIG_SYSTEM_TEE -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/tee/tee.c b/system/tee/tee.c index 760bc323b..64708fdde 100644 --- a/system/tee/tee.c +++ b/system/tee/tee.c @@ -121,7 +121,7 @@ static void show_usage(FAR const char *progrname, int exitcode) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int tee_main(int argc, char *argv[]) diff --git a/system/telnet/Kconfig b/system/telnet/Kconfig index d57bab1db..977a330b2 100644 --- a/system/telnet/Kconfig +++ b/system/telnet/Kconfig @@ -4,7 +4,7 @@ # menuconfig SYSTEM_TELNET_CHATD - bool "Telnet chat deamon" + tristate "Telnet chat deamon" default n depends on NET && NET_TCP && !DISABLE_POLL select NETUTILS_TELNETC @@ -32,7 +32,7 @@ endif # NSH_BUILTIN_APPS endif # SYSTEM_TELNET_CHATD menuconfig SYSTEM_TELNET_CLIENT - bool "Telnet client" + tristate "Telnet client" default n depends on NET && NET_TCP && !DISABLE_POLL select NETUTILS_TELNETC @@ -44,7 +44,7 @@ if SYSTEM_TELNET_CLIENT config SYSTEM_TELNET_CLIENT_PROGNAME string "Telnet client program name" - default "chatd" + default "telnet" depends on BUILD_LOADABLE if NSH_BUILTIN_APPS diff --git a/system/telnet/Make.defs b/system/telnet/Make.defs index cb9c7a480..77db47bcf 100644 --- a/system/telnet/Make.defs +++ b/system/telnet/Make.defs @@ -34,8 +34,8 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_TELNET_CHATD),y) +ifneq ($(CONFIG_SYSTEM_TELNET_CHATD),) CONFIGURED_APPS += system/telnet -else ifeq ($(CONFIG_SYSTEM_TELNET_CLIENT),y) +else ifneq ($(CONFIG_SYSTEM_TELNET_CLIENT),) CONFIGURED_APPS += system/telnet endif diff --git a/system/telnet/Makefile b/system/telnet/Makefile index 5ee29d07d..cb4a2d1f5 100644 --- a/system/telnet/Makefile +++ b/system/telnet/Makefile @@ -33,174 +33,40 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs -# Telnet Programs +ifneq ($(CONFIG_SYSTEM_TELNET_CHATD),) -ifeq ($(CONFIG_SYSTEM_TELNET_CHATD),y) - -# Chatd files - -CHATD_CSRCS = -CHATD_MAINSRC = telnet_chatd.c - -CHATD_COBJS = $(CHATD_CSRCS:.c=$(OBJEXT)) -CHATD_MAINOBJ = $(CHATD_MAINSRC:.c=$(OBJEXT)) - -# Chatd Application Info +MAINSRC = telnet_chatd.c CONFIG_SYSTEM_TELNET_CHATD_PROGNAME ?= chatd CONFIG_SYSTEM_TELNET_CHATD_PRIORITY ?= 100 CONFIG_SYSTEM_TELNET_CHATD_STACKSIZE ?= 2048 -CHATD_MAINNAME = chatd_main -CHATD_APPNAME = chatd -CHATD_PROGNAME = $(CONFIG_SYSTEM_TELNET_CHATD_PROGNAME) -CHATD_PRIORITY = $(CONFIG_SYSTEM_TELNET_CHATD_PRIORITY) -CHATD_STACKSIZE = $(CONFIG_SYSTEM_TELNET_CHATD_STACKSIZE) +APPNAME = chatd +PROGNAME = $(CONFIG_SYSTEM_TELNET_CHATD_PROGNAME) +PRIORITY = $(CONFIG_SYSTEM_TELNET_CHATD_PRIORITY) +STACKSIZE = $(CONFIG_SYSTEM_TELNET_CHATD_STACKSIZE) + +MODULE = CONFIG_CONFIG_SYSTEM_TELNET_CHATD endif -ifeq ($(CONFIG_SYSTEM_TELNET_CLIENT),y) +ifneq ($(CONFIG_SYSTEM_TELNET_CLIENT),) -# Telnet client files +MAINSRC += telnet_client.c -CLIENT_CSRCS = -CLIENT_MAINSRC = telnet_client.c - -CLIENT_COBJS = $(CLIENT_CSRCS:.c=$(OBJEXT)) -CLIENT_MAINOBJ = $(CLIENT_MAINSRC:.c=$(OBJEXT)) - -# Telnet client Application Info - -CONFIG_SYSTEM_TELNET_CLIENT_PROGNAME ?= tcpclient +CONFIG_SYSTEM_TELNET_CLIENT_PROGNAME ?= telnet CONFIG_SYSTEM_TELNET_CLIENT_PRIORITY ?= 100 CONFIG_SYSTEM_TELNET_CLIENT_STACKSIZE ?= 2048 -CLIENT_MAINNAME = telnet_main -CLIENT_APPNAME = telnet -CLIENT_PROGNAME = $(CONFIG_SYSTEM_TELNET_CLIENT_PROGNAME) -CLIENT_PRIORITY = $(CONFIG_SYSTEM_TELNET_CLIENT_PRIORITY) -CLIENT_STACKSIZE = $(CONFIG_SYSTEM_TELNET_CLIENT_STACKSIZE) +APPNAME += telnet +PROGNAME += $(CONFIG_SYSTEM_TELNET_CLIENT_PROGNAME) +PRIORITY += $(CONFIG_SYSTEM_TELNET_CLIENT_PRIORITY) +STACKSIZE += $(CONFIG_SYSTEM_TELNET_CLIENT_STACKSIZE) + +MODULE = CONFIG_CONFIG_SYSTEM_TELNET_CLIENT endif -# All programns - -TARG_SRCS = $(CHATD_CRCS) $(CHATD_MAINSRC) $(CLIENT_CSRCS) $(CLIENT_MAINSRC) -TARG_OBJS = $(CHATD_COBJS) $(CLIENT_COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - TARG_OBJS += $(CHATD_MAINOBJ) $(CLIENT_MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - TARG_BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - TARG_BIN = ..\\..\\libapps$(LIBEXT) -else - TARG_BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(CHATD_COBJS) $(CHATD_MAINOBJ) $(CLIENT_COBJS) $(CLIENT_MAINOBJ) : %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(TARG_OBJS) - $(call ARCHIVE, $(TARG_BIN), $(TARG_OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -ifeq ($(CONFIG_SYSTEM_TELNET_CHATD),y) - -$(BIN_DIR)$(DELIM)$(CHATD_PROGNAME): $(OBJS) $(CHATD_MAINOBJ) - @echo "LD: $(CHATD_PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(CHATD_PROGNAME) $(ARCHCRT0OBJ) $(CHATD_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(CHATD_PROGNAME) - -chatd_install: $(BIN_DIR)$(DELIM)$(CHATD_PROGNAME) -else -chatd_install: -endif - -ifeq ($(CONFIG_SYSTEM_TELNET_CLIENT),y) - -$(BIN_DIR)$(DELIM)$(CLIENT_PROGNAME): $(OBJS) $(CLIENT_MAINOBJ) - @echo "LD: $(CLIENT_PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(CLIENT_PROGNAME) $(ARCHCRT0OBJ) $(CLIENT_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(CLIENT_PROGNAME) - -client_install: $(BIN_DIR)$(DELIM)$(CLIENT_PROGNAME) -else -client_install: -endif - -install: chatd_install client_install - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -ifeq ($(CONFIG_SYSTEM_TELNET_CHATD),y) - -$(BUILTIN_REGISTRY)$(DELIM)$(CHATD_APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(CHATD_APPNAME),$(CHATD_PRIORITY),$(CHATD_STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(CHATD_MAINNAME))) - -chatd_register: $(BUILTIN_REGISTRY)$(DELIM)$(CHATD_APPNAME)_main.bdat -else -chatd_register: -endif - -ifeq ($(CONFIG_SYSTEM_TELNET_CLIENT),y) -$(BUILTIN_REGISTRY)$(DELIM)$(CLIENT_APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(CLIENT_APPNAME),$(CLIENT_PRIORITY),$(CLIENT_STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(CLIENT_MAINNAME))) - -client_register: $(BUILTIN_REGISTRY)$(DELIM)$(CLIENT_APPNAME)_main.bdat -else -client_register: -endif - -context: chatd_register client_register -else -context: -endif - -.depend: Makefile $(TARG_CSRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(TARG_CSRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call DELFILE, *.dSYM) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/telnet/telnet_chatd.c b/system/telnet/telnet_chatd.c index e2481d009..a76aa39b7 100644 --- a/system/telnet/telnet_chatd.c +++ b/system/telnet/telnet_chatd.c @@ -321,7 +321,7 @@ static void _event_handler(struct telnet_s *telnet, * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int chatd_main(int argc, char *argv[]) diff --git a/system/telnet/telnet_client.c b/system/telnet/telnet_client.c index 0433d02f2..47f9599fb 100644 --- a/system/telnet/telnet_client.c +++ b/system/telnet/telnet_client.c @@ -271,7 +271,7 @@ static void show_usage(const char *progname, int exitcode) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int telnet_main(int argc, char *argv[]) diff --git a/system/ubloxmodem/Kconfig b/system/ubloxmodem/Kconfig index c7d987be5..34a9657a9 100644 --- a/system/ubloxmodem/Kconfig +++ b/system/ubloxmodem/Kconfig @@ -5,7 +5,7 @@ menuconfig SYSTEM_UBLOXMODEM - bool "u-blox modem configuration tool" + tristate "u-blox modem configuration tool" default n ---help--- Enable the u-blox modem configuration tool. diff --git a/system/ubloxmodem/Make.defs b/system/ubloxmodem/Make.defs index ad91fd534..97f89f6a5 100644 --- a/system/ubloxmodem/Make.defs +++ b/system/ubloxmodem/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_UBLOXMODEM),y) +ifneq ($(CONFIG_SYSTEM_UBLOXMODEM),) CONFIGURED_APPS += system/ubloxmodem endif diff --git a/system/ubloxmodem/Makefile b/system/ubloxmodem/Makefile index 9750784b0..ccc592b97 100644 --- a/system/ubloxmodem/Makefile +++ b/system/ubloxmodem/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # u-blox modem tool @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = ubloxmodem_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= ubloxmodem$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . -VPATH = - APPNAME = ubloxmodem PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Build targets +MODULE = CONFIG_SYSTEM_UBLOXMODEM -all: .built -.PHONY: context .depend depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/ubloxmodem/ubloxmodem_main.c b/system/ubloxmodem/ubloxmodem_main.c index 0be141bfc..f7c7b1288 100644 --- a/system/ubloxmodem/ubloxmodem_main.c +++ b/system/ubloxmodem/ubloxmodem_main.c @@ -406,7 +406,7 @@ static int ubloxmodem_exec(FAR struct ubloxmodem_cxt *cxt) * ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char** argv) #else int ubloxmodem_main(int argc, FAR char** argv) diff --git a/system/usbmsc/Kconfig b/system/usbmsc/Kconfig index d3a4e8b65..b34565e36 100644 --- a/system/usbmsc/Kconfig +++ b/system/usbmsc/Kconfig @@ -4,7 +4,7 @@ # menuconfig SYSTEM_USBMSC - bool "USB Mass Storage Device Commands" + tristate "USB Mass Storage Device Commands" default n depends on LIB_BOARDCTL && USBMSC && !KERNEL_BUILD select BOARDCTL_USBDEVCTRL diff --git a/system/usbmsc/Make.defs b/system/usbmsc/Make.defs index a4cb9065d..6b43f509e 100644 --- a/system/usbmsc/Make.defs +++ b/system/usbmsc/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_USBMSC),y) +ifneq ($(CONFIG_SYSTEM_USBMSC),) CONFIGURED_APPS += system/usbmsc endif diff --git a/system/usbmsc/Makefile b/system/usbmsc/Makefile index cdf24e8da..efed20b50 100644 --- a/system/usbmsc/Makefile +++ b/system/usbmsc/Makefile @@ -33,118 +33,23 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs - -# USB device mass storage add-on - -ASRCS = -CSRCS = -MAINSRC = usbmsc_main.c - -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -CONFIG_XYZ_PROGNAME ?= usbmsc$(EXEEXT) -PROGNAME = $(CONFIG_XYZ_PROGNAME) - -ROOTDEPPATH = --dep-path . - -# USB storage built-in application info CONFIG_SYSTEM_USBMSC_CMD_STACKSIZE ?= 768 CONFIG_SYSTEM_USBMSC_CMD_PRIORITY ?= SCHED_PRIORITY_DEFAULT -APPNAME1 = msconn -PRIORITY1 = $(CONFIG_SYSTEM_USBMSC_CMD_PRIORITY) -STACKSIZE1 = $(CONFIG_SYSTEM_USBMSC_CMD_STACKSIZE) +PRIORITY = $(CONFIG_SYSTEM_USBMSC_CMD_PRIORITY) +STACKSIZE = $(CONFIG_SYSTEM_USBMSC_CMD_STACKSIZE) -APPNAME2 = msdis -PRIORITY2 = $(CONFIG_SYSTEM_USBMSC_CMD_PRIORITY) -STACKSIZE2 = $(CONFIG_SYSTEM_USBMSC_CMD_STACKSIZE) - -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) +MAINSRC = usbmsc_main.c +PROGNAME = usbmsc$(EXEEXT) +ifeq ($(CONFIG_SYSTEM_USBMSC),m) +APPNAME = usbmsc else -install: - +APPNAME = msconn msdis endif -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME1)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME1),$(PRIORITY1),$(STACKSIZE1),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME1)_main)) +MODULE = CONFIG_SYSTEM_USBMSC -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME2)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME2),$(PRIORITY2),$(STACKSIZE2),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME2)_main)) - -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 - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/usbmsc/usbmsc_main.c b/system/usbmsc/usbmsc_main.c index d8260c0ea..b8c33f411 100644 --- a/system/usbmsc/usbmsc_main.c +++ b/system/usbmsc/usbmsc_main.c @@ -433,7 +433,7 @@ static void usbmsc_disconnect(FAR void *handle) * ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int msconn_main(int argc, char *argv[]) @@ -639,7 +639,7 @@ int msconn_main(int argc, char *argv[]) ****************************************************************************/ #ifdef CONFIG_NSH_BUILTIN_APPS -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char **argv) #else int msdis_main(int argc, char *argv[]) diff --git a/system/vi/Kconfig b/system/vi/Kconfig index e5e7d079a..e940188b3 100644 --- a/system/vi/Kconfig +++ b/system/vi/Kconfig @@ -4,7 +4,7 @@ # menuconfig SYSTEM_VI - bool "VI Work-Alike Text Editor" + tristate "VI Work-Alike Text Editor" default n ---help--- Enable support for NuttX tiny VI work-alike editor. diff --git a/system/vi/Make.defs b/system/vi/Make.defs index 8cd14add9..8f6d2d329 100644 --- a/system/vi/Make.defs +++ b/system/vi/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_VI),y) +ifneq ($(CONFIG_SYSTEM_VI),) CONFIGURED_APPS += system/vi endif diff --git a/system/vi/Makefile b/system/vi/Makefile index 83d265524..13d01b076 100644 --- a/system/vi/Makefile +++ b/system/vi/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # VI-Workalike Editor @@ -46,100 +44,11 @@ APPNAME = vi PRIORITY = $(CONFIG_SYSTEM_VI_PRIORITY) STACKSIZE = $(CONFIG_SYSTEM_VI_STACKSIZE) -ASRCS = -CSRCS = MAINSRC = vi.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= vi$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . +MODULE = CONFIG_SYSTEM_VI -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/vi/vi.c b/system/vi/vi.c index 7689bb943..985600f94 100644 --- a/system/vi/vi.c +++ b/system/vi/vi.c @@ -3599,7 +3599,7 @@ static void vi_showusage(FAR struct vi_s *vi, FAR const char *progname, * ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int vi_main(int argc, char **argv) diff --git a/system/zmodem/Kconfig b/system/zmodem/Kconfig index 956357305..284175104 100644 --- a/system/zmodem/Kconfig +++ b/system/zmodem/Kconfig @@ -4,7 +4,7 @@ # menuconfig SYSTEM_ZMODEM - bool "Zmodem Commands" + tristate "Zmodem Commands" default n ---help--- This selection enables the 'sz' and 'rz' NSH commands. diff --git a/system/zmodem/Make.defs b/system/zmodem/Make.defs index 355627776..30c863e8d 100644 --- a/system/zmodem/Make.defs +++ b/system/zmodem/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_SYSTEM_ZMODEM),y) +ifneq ($(CONFIG_SYSTEM_ZMODEM),) CONFIGURED_APPS += system/zmodem endif diff --git a/system/zmodem/Makefile b/system/zmodem/Makefile index ec39c2486..53308e08d 100644 --- a/system/zmodem/Makefile +++ b/system/zmodem/Makefile @@ -33,17 +33,13 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs - -# Zmodem sz and rz commands CONFIG_SYSTEM_SZPROGNAME ?= sz$(EXEEXT) -SZ_PROGNAME = $(CONFIG_SYSTEM_SZPROGNAME) +PROGNAME = $(CONFIG_SYSTEM_SZPROGNAME) CONFIG_SYSTEM_RZPROGNAME ?= rz$(EXEEXT) -RZ_PROGNAME = $(CONFIG_SYSTEM_RZPROGNAME) +PROGNAME += $(CONFIG_SYSTEM_RZPROGNAME) CONFIG_SYSTEM_ZMODEM_PRIORITY ?= 100 CONFIG_SYSTEM_ZMODEM_STACKSIZE ?= 2048 @@ -51,112 +47,11 @@ CONFIG_SYSTEM_ZMODEM_STACKSIZE ?= 2048 PRIORITY = $(CONFIG_SYSTEM_ZMODEM_PRIORITY) STACKSIZE = $(CONFIG_SYSTEM_ZMODEM_STACKSIZE) -# Source/object files - -ASRCS = - CSRCS = zm_send.c zm_receive.c zm_state.c zm_proto.c zm_watchdog.c CSRCS += zm_utils.c -SZ_MAINSRC = sz_main.c -RZ_MAINSRC = rz_main.c +MAINSRC = sz_main.c rz_main.c +APPNAME = sz rz -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -SZ_MAINOBJ = $(SZ_MAINSRC:.c=$(OBJEXT)) -RZ_MAINOBJ = $(RZ_MAINSRC:.c=$(OBJEXT)) -MAINOBJ = $(SZ_MAINOBJ) $(RZ_MAINOBJ) +MODULE = CONFIG_SYSTEM_ZMODEM -SRCS = $(ASRCS) $(CSRCS) $(SZ_MAINSRC) $(RZ_MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(SZ_PROGNAME): $(OBJS) $(SZ_MAINOBJ) - @echo "LD: $(SZ_PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(SZ_PROGNAME) $(ARCHCRT0OBJ) $(SZ_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(SZ_PROGNAME) - -$(BIN_DIR)$(DELIM)$(RZ_PROGNAME): $(OBJS) $(RZ_MAINOBJ) - @echo "LD: $(RZ_PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(RZ_PROGNAME) $(ARCHCRT0OBJ) $(RZ_MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(RZ_PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(SZ_PROGNAME) $(BIN_DIR)$(DELIM)$(RZ_PROGNAME) - -else -install: - -endif - -# Register application - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)sz.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,"sz",$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,sz_main)) - -$(BUILTIN_REGISTRY)$(DELIM)rz.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,"rz",$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,rz_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)sz.bdat $(BUILTIN_REGISTRY)$(DELIM)rz.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/system/zmodem/rz_main.c b/system/zmodem/rz_main.c index c0ccef3ba..422c8d438 100644 --- a/system/zmodem/rz_main.c +++ b/system/zmodem/rz_main.c @@ -74,7 +74,7 @@ static void show_usage(FAR const char *progname, int errcode) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int rz_main(int argc, FAR char **argv) diff --git a/system/zmodem/sz_main.c b/system/zmodem/sz_main.c index 198dd3c22..ca16a3445 100644 --- a/system/zmodem/sz_main.c +++ b/system/zmodem/sz_main.c @@ -91,7 +91,7 @@ static void show_usage(FAR const char *progname, int errcode) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int sz_main(int argc, FAR char **argv) diff --git a/testing/unity/Makefile b/testing/unity/Makefile index ef61306ed..ab853157b 100644 --- a/testing/unity/Makefile +++ b/testing/unity/Makefile @@ -35,9 +35,7 @@ # Standard includes --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Set up build configuration and environment @@ -62,30 +60,6 @@ CFLAGS += -I$(APPS_INCDIR) -DUNITY_INCLUDE_CONFIG_H CSRCS = $(UNITY_SRCDIR)$(DELIM)unity.c -VPATH = -DEPPATH = --dep-path $(DELIM) - -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(CSRCS) -OBJS = $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -# Common build - -all: .built -.PHONY: clean depend distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - $(UNITY_TARBALL): @echo "Downloading: $(UNITY_TARBALL)" $(Q) $(WGET) $(CONFIG_TESTING_UNITY_URL)/$(UNITY_TARBALL) @@ -105,37 +79,16 @@ $(APPS_INCDIR)$(DELIM)unity.h: $(UNITY_SRCDIR)$(DELIM)unity.h $(APPS_INCDIR)$(DELIM)unity_internals.h: $(UNITY_SRCDIR)$(DELIM)unity_internals.h $(Q) cp $< $@ -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) +context:: $(APPS_INCDIR)$(DELIM)unity.h $(APPS_INCDIR)$(DELIM)unity_internals.h -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) @touch $@ - -install: - -context: $(APPS_INCDIR)$(DELIM)unity.h $(APPS_INCDIR)$(DELIM)unity_internals.h - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: +clean:: $(call DELDIR, build) - $(call DELFILE, .built) - $(call CLEAN) -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) +distclean:: $(call DELDIR, $(UNITY_UNPACKNAME)) $(call DELFILE, .downloaded) $(call DELFILE, $(UNITY_TARBALL)) $(call DELFILE, $(APPDIR)/include/testing/unity.h) $(call DELFILE, $(APPDIR)/include/testing/unity_internals.h) -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/tools/mksymtab.sh b/tools/mksymtab.sh index b92090be7..eb1c99408 100755 --- a/tools/mksymtab.sh +++ b/tools/mksymtab.sh @@ -94,6 +94,8 @@ echo "#if defined(CONFIG_EXECFUNCS_HAVE_SYMTAB)" >>$outfile echo "const struct symtab_s CONFIG_EXECFUNCS_SYMTAB_ARRAY[] = " >>$outfile echo "#elif defined(CONFIG_SYSTEM_NSH_SYMTAB)" >>$outfile echo "const struct symtab_s CONFIG_SYSTEM_NSH_SYMTAB_ARRAYNAME[] = " >>$outfile +echo "#else" >>$outfile +echo "const struct symtab_s dummy_symtab[] = " >>$outfile echo "#endif" >>$outfile echo "{" >>$outfile @@ -107,4 +109,6 @@ echo "#if defined(CONFIG_EXECFUNCS_HAVE_SYMTAB)" >>$outfile echo "const int CONFIG_EXECFUNCS_NSYMBOLS_VAR = sizeof(CONFIG_EXECFUNCS_SYMTAB_ARRAY) / sizeof(struct symtab_s);" >>$outfile echo "#elif defined(CONFIG_SYSTEM_NSH_SYMTAB)" >>$outfile echo "const int CONFIG_SYSTEM_NSH_SYMTAB_COUNTNAME = sizeof(CONFIG_SYSTEM_NSH_SYMTAB_COUNTNAME) / sizeof(struct symtab_s);" >>$outfile +echo "#else" >>$outfile +echo "const int dummy_nsymtabs = sizeof(dummy_symtab) / sizeof(struct symtab_s);" >>$outfile echo "#endif" >>$outfile diff --git a/wireless/bluetooth/btsak/Kconfig b/wireless/bluetooth/btsak/Kconfig index 28742f72c..295db5e0a 100644 --- a/wireless/bluetooth/btsak/Kconfig +++ b/wireless/bluetooth/btsak/Kconfig @@ -4,7 +4,7 @@ # config BTSAK - bool "Bluetooth Swiss Army Knife" + tristate "Bluetooth Swiss Army Knife" default n ---help--- Enable the Bluetooth Swiss Army Knife diff --git a/wireless/bluetooth/btsak/Make.defs b/wireless/bluetooth/btsak/Make.defs index 8ada620c8..a3bd1d57a 100644 --- a/wireless/bluetooth/btsak/Make.defs +++ b/wireless/bluetooth/btsak/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_BTSAK),y) +ifneq ($(CONFIG_BTSAK),) CONFIGURED_APPS += wireless/bluetooth/btsak endif diff --git a/wireless/bluetooth/btsak/Makefile b/wireless/bluetooth/btsak/Makefile index 814198bf8..123975587 100644 --- a/wireless/bluetooth/btsak/Makefile +++ b/wireless/bluetooth/btsak/Makefile @@ -33,12 +33,10 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs # Bluetooth SAK (swiss army knife ) -ASRCS = CSRCS = btsak_advertise.c btsak_features.c btsak_gatt.c btsak_info.c CSRCS += btsak_scan.c btsak_security.c MAINSRC = btsak_main.c @@ -54,4 +52,6 @@ APPNAME = bt PRIORITY = $(CONFIG_BTSAK_PRIORITY) STACKSIZE = $(CONFIG_BTSAK_STACKSIZE) +MODULE = CONFIG_BTSAK + include $(APPDIR)/Application.mk diff --git a/wireless/bluetooth/btsak/btsak_main.c b/wireless/bluetooth/btsak/btsak_main.c index 67de139c1..010556832 100644 --- a/wireless/bluetooth/btsak/btsak_main.c +++ b/wireless/bluetooth/btsak/btsak_main.c @@ -254,7 +254,7 @@ void btsak_cmd_gatt(FAR struct btsak_s *btsak, int argc, FAR char *argv[]) * bt_main ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int bt_main(int argc, char *argv[]) diff --git a/wireless/ieee802154/i8sak/Kconfig b/wireless/ieee802154/i8sak/Kconfig index a2f31ed01..6ba2c20fe 100644 --- a/wireless/ieee802154/i8sak/Kconfig +++ b/wireless/ieee802154/i8sak/Kconfig @@ -4,7 +4,7 @@ # config IEEE802154_I8SAK - bool "IEEE 802.15.4 Swiss Army Knife" + tristate "IEEE 802.15.4 Swiss Army Knife" default n select IEEE802154_LIBUTILS select IEEE802154_LIBMAC diff --git a/wireless/ieee802154/i8sak/Make.defs b/wireless/ieee802154/i8sak/Make.defs index f13a65b1c..e1563163e 100644 --- a/wireless/ieee802154/i8sak/Make.defs +++ b/wireless/ieee802154/i8sak/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_IEEE802154_I8SAK),y) +ifneq ($(CONFIG_IEEE802154_I8SAK),) CONFIGURED_APPS += wireless/ieee802154/i8sak endif diff --git a/wireless/ieee802154/i8sak/Makefile b/wireless/ieee802154/i8sak/Makefile index 77e954f1c..4b00946af 100644 --- a/wireless/ieee802154/i8sak/Makefile +++ b/wireless/ieee802154/i8sak/Makefile @@ -34,110 +34,26 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # IEEE 802.15.4 SAK (swiss army knife ) -CONFIG_IEEE802154_I8SAK_PROGNAME ?= i8$(EXEEXT) +CONFIG_IEEE802154_I8SAK_PROGNAME ?= i8ask$(EXEEXT) CONFIG_IEEE802154_I8SAK_PRIORITY ?= 100 CONFIG_IEEE802154_I8SAK_STACKSIZE ?= 4096 PROGNAME = $(CONFIG_IEEE802154_I8SAK_PROGNAME) -APPNAME = i8 +APPNAME = i8ask PRIORITY = $(CONFIG_IEEE802154_I8SAK_PRIORITY) STACKSIZE = $(CONFIG_IEEE802154_I8SAK_STACKSIZE) # IEEE 802.15.4 SAK (Swiss Army Knife) -ASRCS = CSRCS = i8sak_acceptassoc.c i8sak_assoc.c i8sak_scan.c i8sak_blaster.c i8sak_poll.c CSRCS += i8sak_sniffer.c i8sak_startpan.c i8sak_tx.c i8sak_get.c i8sak_set.c CSRCS += i8sak_reset.c i8sak_regdump.c i8sak_events.c MAINSRC = i8sak_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) +MODULE = CONFIG_IEEE802154_I8SAK -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\..\\libapps$(LIBEXT) -else - BIN = ../../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean -.PRECIOUS: ../../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - -endif - -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/wireless/ieee802154/i8sak/i8sak_main.c b/wireless/ieee802154/i8sak/i8sak_main.c index f5ffe4d50..537f89bff 100644 --- a/wireless/ieee802154/i8sak/i8sak_main.c +++ b/wireless/ieee802154/i8sak/i8sak_main.c @@ -839,10 +839,10 @@ static int i8sak_showusage(FAR const char *progname, int exitcode) * i8_main ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_LOADABLE int main(int argc, FAR char *argv[]) #else -int i8_main(int argc, char *argv[]) +int i8ask_main(int argc, char *argv[]) #endif { FAR const struct i8sak_command_s *i8sakcmd; diff --git a/wireless/ieee802154/i8shark/Kconfig b/wireless/ieee802154/i8shark/Kconfig index bb6a2a65d..ee93ea7fe 100644 --- a/wireless/ieee802154/i8shark/Kconfig +++ b/wireless/ieee802154/i8shark/Kconfig @@ -4,7 +4,7 @@ # config IEEE802154_I8SHARK - bool "IEEE 802.15.4 Wireshark adapter" + tristate "IEEE 802.15.4 Wireshark adapter" default n select IEEE802154_LIBUTILS select IEEE802154_LIBMAC diff --git a/wireless/ieee802154/i8shark/Make.defs b/wireless/ieee802154/i8shark/Make.defs index 11fce00ed..7927052a2 100644 --- a/wireless/ieee802154/i8shark/Make.defs +++ b/wireless/ieee802154/i8shark/Make.defs @@ -34,6 +34,6 @@ # ############################################################################ -ifeq ($(CONFIG_IEEE802154_I8SHARK),y) +ifneq ($(CONFIG_IEEE802154_I8SHARK),) CONFIGURED_APPS += wireless/ieee802154/i8shark endif diff --git a/wireless/ieee802154/i8shark/Makefile b/wireless/ieee802154/i8shark/Makefile index 809b1fdf3..6bf6a6883 100644 --- a/wireless/ieee802154/i8shark/Makefile +++ b/wireless/ieee802154/i8shark/Makefile @@ -48,4 +48,6 @@ APPNAME = i8shark PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 +MODULE = CONFIG_IEEE802154_I8SHARK + include $(APPDIR)/Application.mk diff --git a/wireless/ieee802154/i8shark/i8shark_main.c b/wireless/ieee802154/i8shark/i8shark_main.c index 73ad65ba8..8bbfc6699 100644 --- a/wireless/ieee802154/i8shark/i8shark_main.c +++ b/wireless/ieee802154/i8shark/i8shark_main.c @@ -467,7 +467,7 @@ static int i8shark_daemon(int argc, FAR char *argv[]) * Name: i8shark_main ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int i8shark_main(int argc, char *argv[]) diff --git a/wireless/ieee802154/libmac/Makefile b/wireless/ieee802154/libmac/Makefile index 614642f52..845cdf7c2 100644 --- a/wireless/ieee802154/libmac/Makefile +++ b/wireless/ieee802154/libmac/Makefile @@ -33,13 +33,10 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # libmac source files -ASRCS = # Add IOCTL helpers CSRCS = ieee802154_assocreq.c ieee802154_assocresp.c ieee802154_disassocreq.c CSRCS += ieee802154_getreq.c ieee802154_gtsreq.c ieee802154_orphanresp.c @@ -57,58 +54,4 @@ CSRCS += sixlowpan_setreq.c sixlowpan_startreq.c sixlowpan_syncreq.c CSRCS += sixlowpan_pollreq.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\..\\libapps$(LIBEXT) -else - BIN = ../../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . -VPATH = - -# Build targets - -all: .built -.PHONY: context .depend depend clean distclean -.PRECIOUS: ../../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - --include Make.dep - +include $(APPDIR)/Application.mk diff --git a/wireless/ieee802154/libutils/Makefile b/wireless/ieee802154/libutils/Makefile index f15011f43..ab59574c0 100644 --- a/wireless/ieee802154/libutils/Makefile +++ b/wireless/ieee802154/libutils/Makefile @@ -33,67 +33,9 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # libutils source files - -ASRCS = CSRCS += ieee802154_addrtostr.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\..\\libapps$(LIBEXT) -else - BIN = ../../../libapps$(LIBEXT) -endif -endif - -ROOTDEPPATH = --dep-path . -VPATH = - -# Build targets - -all: .built -.PHONY: context .depend depend clean distclean -.PRECIOUS: ../../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -install: - -context: - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - --include Make.dep - +include $(APPDIR)/Application.mk diff --git a/wireless/iwpan/Kconfig b/wireless/iwpan/Kconfig index e1d173895..6442577d4 100644 --- a/wireless/iwpan/Kconfig +++ b/wireless/iwpan/Kconfig @@ -4,7 +4,7 @@ # menuconfig WIRELESS_IWPAN - bool "IEEE 802.15.4 Command Line Tool" + tristate "IEEE 802.15.4 Command Line Tool" default n depends on NET && DRIVERS_WIRELESS select IEEE802154_LIBMAC diff --git a/wireless/iwpan/Make.defs b/wireless/iwpan/Make.defs index f265ef8b6..318227160 100644 --- a/wireless/iwpan/Make.defs +++ b/wireless/iwpan/Make.defs @@ -35,7 +35,7 @@ # ############################################################################ -ifeq ($(CONFIG_WIRELESS_IWPAN),y) +ifneq ($(CONFIG_WIRELESS_IWPAN),) CONFIGURED_APPS += wireless/iwpan endif diff --git a/wireless/iwpan/Makefile b/wireless/iwpan/Makefile index 0b178cbed..19452db8a 100644 --- a/wireless/iwpan/Makefile +++ b/wireless/iwpan/Makefile @@ -37,115 +37,24 @@ # TODO, this makefile should run make under the app dirs, instead of # sourcing the Make.defs! --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs - -# IEEE802.11 Wapi Application CONFIG_WIRELESS_IWPAN_PRIORITY ?= 100 CONFIG_WIRELESS_IWPAN_STACKSIZE ?= 2048 +# IEEE802.11 Wapi Application + +include $(APPDIR)/wireless/iwpan/src/Make.defs + +ifneq ($(MAINSRC),) APPNAME = iwpan PRIORITY = $(CONFIG_WIRELESS_IWPAN_PRIORITY) STACKSIZE = $(CONFIG_WIRELESS_IWPAN_STACKSIZE) -ASRCS = -CSRCS = -MAINSRC = - -VPATH = . - -include $(APPDIR)/wireless/iwpan/src/Make.defs - -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_IWPAN_PROGNAME ?= iwpan$(EXEEXT) PROGNAME = $(CONFIG_IWPAN_PROGNAME) - -ROOTDEPPATH = --dep-path . - -# Common build - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - endif -# Register application +MODULE = CONFIG_WIRELESS_IWPAN -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/wireless/iwpan/src/Make.defs b/wireless/iwpan/src/Make.defs index 935fcb23d..fde94d3d4 100644 --- a/wireless/iwpan/src/Make.defs +++ b/wireless/iwpan/src/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_WIRELESS_IWPAN),y) +ifneq ($(CONFIG_WIRELESS_IWPAN),) CSRCS = MAINSRC = iwpan.c diff --git a/wireless/iwpan/src/iwpan.c b/wireless/iwpan/src/iwpan.c index 87b74912d..237d27d3e 100644 --- a/wireless/iwpan/src/iwpan.c +++ b/wireless/iwpan/src/iwpan.c @@ -676,7 +676,7 @@ static void iwpan_showusage(FAR const char *progname, int exitcode) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int iwpan_main(int argc, char *argv[]) diff --git a/wireless/wapi/Kconfig b/wireless/wapi/Kconfig index b54039898..b78e88564 100644 --- a/wireless/wapi/Kconfig +++ b/wireless/wapi/Kconfig @@ -4,7 +4,7 @@ # menuconfig WIRELESS_WAPI - bool "IEEE 802.11 Configuration Library" + tristate "IEEE 802.11 Configuration Library" default n depends on NET && DRIVERS_WIRELESS ---help--- diff --git a/wireless/wapi/Make.defs b/wireless/wapi/Make.defs index f8cf01b20..57eec174d 100644 --- a/wireless/wapi/Make.defs +++ b/wireless/wapi/Make.defs @@ -34,7 +34,7 @@ # ############################################################################ -ifeq ($(CONFIG_WIRELESS_WAPI),y) +ifneq ($(CONFIG_WIRELESS_WAPI),) CONFIGURED_APPS += wireless/wapi endif diff --git a/wireless/wapi/Makefile b/wireless/wapi/Makefile index 9ad3b198b..36bd84db6 100644 --- a/wireless/wapi/Makefile +++ b/wireless/wapi/Makefile @@ -36,114 +36,24 @@ # TODO, this makefile should run make under the app dirs, instead of # sourcing the Make.defs! --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # IEEE802.11 Wapi Application CONFIG_WIRELESS_WAPI_PRIORITY ?= 100 CONFIG_WIRELESS_WAPI_STACKSIZE ?= 2048 +include $(APPDIR)/wireless/wapi/src/Make.defs + +ifneq ($(MAINSRC),) APPNAME = wapi PRIORITY = $(CONFIG_WIRELESS_WAPI_PRIORITY) STACKSIZE = $(CONFIG_WIRELESS_WAPI_STACKSIZE) -ASRCS = -CSRCS = -MAINSRC = - -VPATH = . -DEPPATH = --dep-path . - -include $(APPDIR)/wireless/wapi/src/Make.defs - -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_LOADABLE),y) - OBJS += $(MAINOBJ) -endif - -ifeq ($(CONFIG_WINDOWS_NATIVE),y) - BIN = ..\..\libapps$(LIBEXT) -else -ifeq ($(WINTOOL),y) - BIN = ..\\..\\libapps$(LIBEXT) -else - BIN = ../../libapps$(LIBEXT) -endif -endif - -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_WAPI_PROGNAME ?= wapi$(EXEEXT) PROGNAME = $(CONFIG_WAPI_PROGNAME) - -# Common build - -all: .built -.PHONY: context depend clean distclean preconfig -.PRECIOUS: ../../libapps$(LIBEXT) - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_LOADABLE),y) -$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) - @echo "LD: $(PROGNAME)" - $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) - $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) - -install: $(BIN_DIR)$(DELIM)$(PROGNAME) - -else -install: - endif -# Register application +MODULE = CONFIG_WIRELESS_WAPI -ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(if $(CONFIG_BUILD_LOADABLE),,$(APPNAME)_main)) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Create dependencies - -.depend: Makefile $(SRCS) - $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep - $(Q) touch $@ - -depend: .depend - -clean: - $(call DELFILE, .built) - $(call CLEAN) - -distclean: clean - $(call DELFILE, Make.dep) - $(call DELFILE, .depend) - -preconfig: - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/wireless/wapi/src/Make.defs b/wireless/wapi/src/Make.defs index cea03125f..4315e1501 100644 --- a/wireless/wapi/src/Make.defs +++ b/wireless/wapi/src/Make.defs @@ -33,7 +33,7 @@ # ############################################################################ -ifeq ($(CONFIG_WIRELESS_WAPI),y) +ifneq ($(CONFIG_WIRELESS_WAPI),) CSRCS = network.c util.c wireless.c driver_wext.c diff --git a/wireless/wapi/src/wapi.c b/wireless/wapi/src/wapi.c index 5268b3e7f..aaf631597 100644 --- a/wireless/wapi/src/wapi.c +++ b/wireless/wapi/src/wapi.c @@ -765,7 +765,7 @@ static void wapi_showusage(FAR const char *progname, int exitcode) * Public Functions ****************************************************************************/ -#ifdef CONFIG_BUILD_LOADABLE +#ifdef BUILD_MODULE int main(int argc, FAR char *argv[]) #else int wapi_main(int argc, char *argv[])