diff --git a/Application.mk b/Application.mk new file mode 100644 index 000000000..99cbd8bc7 --- /dev/null +++ b/Application.mk @@ -0,0 +1,124 @@ +############################################################################ +# apps/Application.mk +# +# Copyright (C) 2015 Gregory Nutt. All rights reserved. +# Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved. +# Authors: Gregory Nutt +# Paul Alexander Patience +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) +OBJS = $(AOBJS) $(COBJS) + +ifneq ($(CONFIG_BUILD_KERNEL),y) + OBJS += $(MAINOBJ) +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 depend distclean + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +.built: $(OBJS) + $(call ARCHIVE, $(BIN), $(OBJS)) + $(Q) touch .built + +ifeq ($(CONFIG_BUILD_KERNEL),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) +ifneq ($(APPNAME),) +ifneq ($(PRIORITY),) +ifneq ($(STACKSIZE),) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) + +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif +else +context: +endif +else +context: +endif +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 diff --git a/examples/adc/Makefile b/examples/adc/Makefile index 1cd406a80..14dcaa648 100644 --- a/examples/adc/Makefile +++ b/examples/adc/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NuttX NX Graphics Example. @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = adc_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= adc$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Touchscreen built-in application info APPNAME = adc PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/ajoystick/Makefile b/examples/ajoystick/Makefile index b294c36dd..321f36ce4 100644 --- a/examples/ajoystick/Makefile +++ b/examples/ajoystick/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Hello, World! Example @@ -43,95 +41,12 @@ ASRCS = CSRCS = MAINSRC = ajoy_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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_AJOY_PROGNAME ?= ajoy$(EXEEXT) PROGNAME = $(CONFIG_AJOY_PROGNAME) -ROOTDEPPATH = --dep-path . - # Buttons built-in application info APPNAME = ajoy PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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 diff --git a/examples/buttons/Makefile b/examples/buttons/Makefile index ed1361922..1e59ef2d0 100644 --- a/examples/buttons/Makefile +++ b/examples/buttons/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Hello, World! Example @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = buttons_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= buttons$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Buttons built-in application info APPNAME = buttons PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/can/Makefile b/examples/can/Makefile index 44d43ace8..fa024eaa9 100644 --- a/examples/can/Makefile +++ b/examples/can/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NuttX NX Graphics Example. @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = can_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= can$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Touchscreen built-in application info APPNAME = can PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/configdata/Makefile b/examples/configdata/Makefile index c5b7dbe2d..d3a23e212 100644 --- a/examples/configdata/Makefile +++ b/examples/configdata/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # CONFIGDATA Unit Test @@ -43,82 +41,7 @@ ASRCS = CSRCS = MAINSRC = configdata_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= configdata$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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 $@ - -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/cpuhog/Makefile b/examples/cpuhog/Makefile index b21f143c0..29f46d3c9 100644 --- a/examples/cpuhog/Makefile +++ b/examples/cpuhog/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # do nothing loop to use up cpu time @@ -43,38 +41,9 @@ ASRCS = CSRCS = MAINSRC = cpuhog_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= cpuhog$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Built-in application info CONFIG_EXAMPLES_CPUHOG_PRIORITY ?= 50 @@ -84,57 +53,4 @@ APPNAME = cpuhog PRIORITY = $(CONFIG_EXAMPLES_CPUHOG_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_CPUHOG_STACKSIZE) -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/dhcpd/Makefile b/examples/dhcpd/Makefile index 7ca4bed09..f8de0d6bd 100644 --- a/examples/dhcpd/Makefile +++ b/examples/dhcpd/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # DHCP Daemon Example @@ -43,96 +41,13 @@ ASRCS = CSRCS = MAINSRC = target.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= dhcpd$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # DHCPD built-in application info APPNAME = dhcpd PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/discover/Makefile b/examples/discover/Makefile index 51abaf5dc..214f03d9f 100644 --- a/examples/discover/Makefile +++ b/examples/discover/Makefile @@ -36,9 +36,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Discover built-in application info @@ -50,89 +48,7 @@ ASRCS = CSRCS = MAINSRC = discover_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/djoystick/Makefile b/examples/djoystick/Makefile index c1897b3e7..dccb826a7 100644 --- a/examples/djoystick/Makefile +++ b/examples/djoystick/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Hello, World! Example @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = djoy_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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_DJOY_PROGNAME ?= djoy$(EXEEXT) PROGNAME = $(CONFIG_DJOY_PROGNAME) -ROOTDEPPATH = --dep-path . - # Buttons built-in application info APPNAME = djoy PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/flash_test/Makefile b/examples/flash_test/Makefile index ad91bed84..08ad8dc05 100644 --- a/examples/flash_test/Makefile +++ b/examples/flash_test/Makefile @@ -34,9 +34,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs ifeq ($(WINTOOL),y) INCDIROPT = -w @@ -52,93 +50,7 @@ ASRCS = CSRCS = MAINSRC = flash_test.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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_test$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/ftpc/Makefile b/examples/ftpc/Makefile index 950677c9e..a12654b98 100644 --- a/examples/ftpc/Makefile +++ b/examples/ftpc/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # FTPC Client Application @@ -47,93 +45,7 @@ ASRCS = CSRCS = ftpc_cmds.c MAINSRC = ftpc_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= ftpc$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(APPNAME)_main) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - -# Create dependencies - -.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/examples/hello/Makefile b/examples/hello/Makefile index ce7c5fea2..986b68a8e 100644 --- a/examples/hello/Makefile +++ b/examples/hello/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Hello, World! built-in application info @@ -49,89 +47,7 @@ ASRCS = CSRCS = MAINSRC = hello_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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_HELLO_PROGNAME ?= hello$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_HELLO_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/hidkbd/Makefile b/examples/hidkbd/Makefile index acb4d4e24..32fd923a6 100644 --- a/examples/hidkbd/Makefile +++ b/examples/hidkbd/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # USB Host HID keyboard Example @@ -43,82 +41,7 @@ ASRCS = CSRCS = MAINSRC = hidkbd_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= hidkbd$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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 $@ - -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/i2schar/Makefile b/examples/i2schar/Makefile index 3347fb66d..91230f749 100644 --- a/examples/i2schar/Makefile +++ b/examples/i2schar/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # I2S character driver test @@ -49,95 +47,13 @@ CSRCS += i2schar_receiver.c endif MAINSRC = i2schar_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= i2schar$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Touchscreen built-in application info APPNAME = i2schar PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/igmp/Makefile b/examples/igmp/Makefile index 1c58629b5..9a94d11db 100644 --- a/examples/igmp/Makefile +++ b/examples/igmp/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs APPNAME = igmp PRIORITY = SCHED_PRIORITY_DEFAULT @@ -47,89 +45,7 @@ ASRCS = CSRCS = MAINSRC = igmp.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= igmp$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/json/Makefile b/examples/json/Makefile index 3a19041c7..c89c7d5c3 100644 --- a/examples/json/Makefile +++ b/examples/json/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # cJSON built-in application info @@ -47,89 +45,7 @@ ASRCS = CSRCS = MAINSRC = json_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= json$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/keypadtest/Makefile b/examples/keypadtest/Makefile index 6aefb4a8c..8faaf7341 100644 --- a/examples/keypadtest/Makefile +++ b/examples/keypadtest/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Keypad Test Example @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = keypadtest_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 - # helloxx built-in application info APPNAME = keypadtest PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -ifeq ($(WINTOOL),y) - INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" -else - INSTALL_DIR = $(BIN_DIR) -endif - CONFIG_XYZ_PROGNAME ?= keypadtest$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/lcdrw/Makefile b/examples/lcdrw/Makefile index 35b2064f3..2166b97cd 100644 --- a/examples/lcdrw/Makefile +++ b/examples/lcdrw/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # LCD Read/Write Test @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = lcdrw_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= lcdrw$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # LCD R/W built-in application info APPNAME = lcdrw PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/ltdc/Makefile b/examples/ltdc/Makefile index 97f16a657..547e5ca0d 100644 --- a/examples/ltdc/Makefile +++ b/examples/ltdc/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # ltdc framebuffer example @@ -50,89 +48,7 @@ CSRCS += dma2d.c endif MAINSRC = ltdc_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= slcd$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/mm/Makefile b/examples/mm/Makefile index 155f811c9..3f86b95f7 100644 --- a/examples/mm/Makefile +++ b/examples/mm/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Memory Management Test @@ -43,82 +41,7 @@ ASRCS = CSRCS = MAINSRC = mm_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= mm$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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 $@ - -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/modbus/Makefile b/examples/modbus/Makefile index b8bbce88c..b793d882c 100644 --- a/examples/modbus/Makefile +++ b/examples/modbus/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # FreeModBus demo built-in application info @@ -49,89 +47,7 @@ ASRCS = CSRCS = MAINSRC = modbus_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= modbus$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/mount/Makefile b/examples/mount/Makefile index f54edbb82..295389c60 100644 --- a/examples/mount/Makefile +++ b/examples/mount/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # mount() test @@ -43,82 +41,7 @@ ASRCS = CSRCS = ramdisk.c MAINSRC = mount_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= mount$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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 $@ - -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/mtdpart/Makefile b/examples/mtdpart/Makefile index 8b418327c..3a5a2f2af 100755 --- a/examples/mtdpart/Makefile +++ b/examples/mtdpart/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Hello, World! Example @@ -43,82 +41,7 @@ ASRCS = CSRCS = MAINSRC = mtdpart_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= mtdpart$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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 $@ - -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/mtdrwb/Makefile b/examples/mtdrwb/Makefile index 48a292296..c284910b8 100755 --- a/examples/mtdrwb/Makefile +++ b/examples/mtdrwb/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Hello, World! Example @@ -43,82 +41,7 @@ ASRCS = CSRCS = MAINSRC = mtdrwb_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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_MTDRWB_PROGNAME ?= mtdrwb$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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 $@ - -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/netloop/Makefile b/examples/netloop/Makefile index ac7991881..2ca76e7a2 100644 --- a/examples/netloop/Makefile +++ b/examples/netloop/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Device Driver poll()/select() Example @@ -43,33 +41,6 @@ ASRCS = CSRCS = lo_listener.c MAINSRC = lo_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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_NETLOOP_STACKSIZE ?= 2048 CONFIG_EXAMPLES_NETLOOP_PRIORITY ?= 100 @@ -80,63 +51,4 @@ STACKSIZE = $(CONFIG_EXAMPLES_NETLOOP_STACKSIZE) CONFIG_XYZ_PROGNAME ?= poll$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(APPNAME)_main) - -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat -else -context: -endif - - -.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) - --include Make.dep +include $(APPDIR)/Application.mk diff --git a/examples/netpkt/Makefile b/examples/netpkt/Makefile index 2f6d2eee5..b492d98ea 100644 --- a/examples/netpkt/Makefile +++ b/examples/netpkt/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Network packet socket example @@ -49,89 +47,7 @@ ASRCS = CSRCS = MAINSRC = netpkt_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= netpkt$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/nrf24l01_term/Makefile b/examples/nrf24l01_term/Makefile index db267b59e..e080cba9f 100644 --- a/examples/nrf24l01_term/Makefile +++ b/examples/nrf24l01_term/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Basic nRF24L01+ terminal demonstration @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = nrf24l01_term.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= nrf24l01_term$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # built-in application info APPNAME = nrf24l01_term PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/nsh/Makefile b/examples/nsh/Makefile index bcfb1fb6c..bfb6958a7 100644 --- a/examples/nsh/Makefile +++ b/examples/nsh/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NuttShell (NSH) Example @@ -43,82 +41,7 @@ ASRCS = CSRCS = MAINSRC = nsh_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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_NSH_PROGNAME ?= nsh$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_NSH_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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 $@ - -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/null/Makefile b/examples/null/Makefile index 3a63cb748..4b8e714f0 100644 --- a/examples/null/Makefile +++ b/examples/null/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # The smallest thing you can build -- the NULL example. @@ -43,82 +41,7 @@ ASRCS = CSRCS = MAINSRC = null_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= null$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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 $@ - -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/nx/Makefile b/examples/nx/Makefile index 6c5d15063..c6ceb0a4b 100644 --- a/examples/nx/Makefile +++ b/examples/nx/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NuttX NX Graphics Example. @@ -46,95 +44,13 @@ CSRCS += nx_server.c endif MAINSRC = nx_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= nx$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # NX built-in application info APPNAME = nx PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/nxffs/Makefile b/examples/nxffs/Makefile index 0d92dc146..045d3a55b 100644 --- a/examples/nxffs/Makefile +++ b/examples/nxffs/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Hello, World! Example @@ -43,82 +41,7 @@ ASRCS = CSRCS = MAINSRC = nxffs_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= nxffs$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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 $@ - -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/nxhello/Makefile b/examples/nxhello/Makefile index bd41344c1..16f834737 100644 --- a/examples/nxhello/Makefile +++ b/examples/nxhello/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NuttX NX Graphics Example. @@ -43,95 +41,13 @@ ASRCS = CSRCS = nxhello_bkgd.c MAINSRC = nxhello_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= nxhello$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # NXHELLO built-in application info APPNAME = nxhello PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/nximage/Makefile b/examples/nximage/Makefile index ec8a96709..8f1aaf998 100644 --- a/examples/nximage/Makefile +++ b/examples/nximage/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NuttX NX Graphics Example. @@ -43,95 +41,13 @@ ASRCS = CSRCS = nximage_bkgd.c nximage_bitmap.c MAINSRC = nximage_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= nximage$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # NXIMAGE built-in application info APPNAME = nximage PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/nxlines/Makefile b/examples/nxlines/Makefile index fae42e1c3..c0d8adec7 100644 --- a/examples/nxlines/Makefile +++ b/examples/nxlines/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NuttX NX Graphics Example. @@ -43,95 +41,13 @@ ASRCS = CSRCS = nxlines_bkgd.c MAINSRC = nxlines_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= nxlines$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # NXLINES built-in application info APPNAME = nxlines PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/nxterm/Makefile b/examples/nxterm/Makefile index f8add33dc..ca374bc75 100644 --- a/examples/nxterm/Makefile +++ b/examples/nxterm/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NuttX NX Console Example. @@ -43,95 +41,13 @@ ASRCS = CSRCS = nxterm_toolbar.c nxterm_wndo.c nxterm_server.c MAINSRC = nxterm_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= nxterm$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # NX built-in application info APPNAME = nxterm PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/nxtext/Makefile b/examples/nxtext/Makefile index 5734b5554..b38a9a91c 100644 --- a/examples/nxtext/Makefile +++ b/examples/nxtext/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NuttX NX Graphics Example. @@ -47,95 +45,13 @@ ifeq ($(CONFIG_NX_MULTIUSER),y) CSRCS += nxtext_server.c endif -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= nxtext$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # NXTEXT built-in application info APPNAME = nxtext PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/ostest/Makefile b/examples/ostest/Makefile index d591ce3f2..32befbb71 100644 --- a/examples/ostest/Makefile +++ b/examples/ostest/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # ostest built-in application info @@ -112,89 +110,7 @@ endif # CONFIG_PRIORITY_INHERITANCE endif # CONFIG_DISABLE_PTHREAD endif # CONFIG_DISABLE_SIGNALS -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= ostest$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/pashello/Makefile b/examples/pashello/Makefile index 9db97eace..403173867 100644 --- a/examples/pashello/Makefile +++ b/examples/pashello/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Pascal Add-On Example @@ -51,82 +49,7 @@ ASRCS = CSRCS = device.c MAINSRC = pashello.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= pashello$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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 $@ - -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/pipe/Makefile b/examples/pipe/Makefile index 45a76c19e..62d1ac584 100644 --- a/examples/pipe/Makefile +++ b/examples/pipe/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Pipe Example @@ -43,82 +41,7 @@ ASRCS = CSRCS = transfer_test.c interlock_test.c redirect_test.c MAINSRC = pipe_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= pipe$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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 $@ - -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/pppd/Makefile b/examples/pppd/Makefile index 924c57ed4..9f75a710e 100644 --- a/examples/pppd/Makefile +++ b/examples/pppd/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # pppd Example @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = pppd_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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_PPPD_PROGNAME ?= pppd$(EXEEXT) PROGNAME = $(CONFIG_EXAMPLES_PPPD_PROGNAME) -ROOTDEPPATH = --dep-path . - # PPPD built-in application info APPNAME = pppd PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/pwm/Makefile b/examples/pwm/Makefile index c836d129e..25ec0b9e7 100644 --- a/examples/pwm/Makefile +++ b/examples/pwm/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # PWM Example. @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = pwm_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= pwm$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # PWM built-in application info APPNAME = pwm PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/qencoder/Makefile b/examples/qencoder/Makefile index b0d0ef9f9..70c316272 100644 --- a/examples/qencoder/Makefile +++ b/examples/qencoder/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NuttX NX Graphics Example. @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = qe_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= qencoder$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Quadrature Encoder built-in application info APPNAME = qe PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/random/Makefile b/examples/random/Makefile index 06c3056ca..5e4231259 100644 --- a/examples/random/Makefile +++ b/examples/random/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # /dev/random test @@ -47,89 +45,7 @@ ASRCS = CSRCS = MAINSRC = random_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= random$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/relays/Makefile b/examples/relays/Makefile index 3cfbaa6e7..691b0ed14 100644 --- a/examples/relays/Makefile +++ b/examples/relays/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # relays Example @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = relays_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= relays$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Buttons built-in application info APPNAME = relays PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 512 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/rgmp/Makefile b/examples/rgmp/Makefile index c59e92a1e..2cc19a0cf 100644 --- a/examples/rgmp/Makefile +++ b/examples/rgmp/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # The smallest thing you can build -- the NULL example. @@ -43,82 +41,7 @@ ASRCS = CSRCS = MAINSRC = rgmp_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= rgmp$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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 $@ - -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/sendmail/Makefile b/examples/sendmail/Makefile index c2f3ecda0..3a0430744 100644 --- a/examples/sendmail/Makefile +++ b/examples/sendmail/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Sendmail SMTP Example @@ -43,84 +41,7 @@ ASRCS = CSRCS = MAINSRC = sendmail_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= sendmail$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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) - --include Make.dep - +include $(APPDIR)/Application.mk diff --git a/examples/serialblaster/Makefile b/examples/serialblaster/Makefile index 44b5c92f4..8d35eeef0 100644 --- a/examples/serialblaster/Makefile +++ b/examples/serialblaster/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # For testing: Blast canned characters at a designated serial port @@ -43,38 +41,9 @@ ASRCS = CSRCS = MAINSRC = serialblaster_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= serialblaster$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Built-in application info CONFIG_EXAMPLES_SERIALBLASTER_PRIORITY ?= 50 @@ -84,57 +53,4 @@ APPNAME = serialblaster PRIORITY = $(CONFIG_EXAMPLES_SERIALBLASTER_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_SERIALBLASTER_STACKSIZE) -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/serialrx/Makefile b/examples/serialrx/Makefile index 2558dd979..b95087bee 100644 --- a/examples/serialrx/Makefile +++ b/examples/serialrx/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # For testing: Blast canned characters at a designated serial port @@ -43,38 +41,9 @@ ASRCS = CSRCS = MAINSRC = serialrx_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= serialrx$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Built-in application info CONFIG_EXAMPLES_SERIALRX_PRIORITY ?= 50 @@ -84,57 +53,4 @@ APPNAME = serialrx PRIORITY = $(CONFIG_EXAMPLES_SERIALRX_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_SERIALRX_STACKSIZE) -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/serloop/Makefile b/examples/serloop/Makefile index 850d2e1b0..716e2622b 100644 --- a/examples/serloop/Makefile +++ b/examples/serloop/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Mindlessly simple console loopack test @@ -43,84 +41,7 @@ ASRCS = CSRCS = MAINSRC = serloop_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= serloop$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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) - --include Make.dep - +include $(APPDIR)/Application.mk diff --git a/examples/slcd/Makefile b/examples/slcd/Makefile index 4f15d6fad..d22a55517 100644 --- a/examples/slcd/Makefile +++ b/examples/slcd/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Hello, World! built-in application info @@ -49,89 +47,7 @@ ASRCS = CSRCS = MAINSRC = slcd_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= slcd$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/smart/Makefile b/examples/smart/Makefile index 9248f5eeb..e612c8e5a 100644 --- a/examples/smart/Makefile +++ b/examples/smart/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # SMART file system stress test @@ -43,82 +41,7 @@ ASRCS = CSRCS = MAINSRC = smart_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= smart$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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 $@ - -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/smart_test/Makefile b/examples/smart_test/Makefile index c9160d629..a7449252d 100644 --- a/examples/smart_test/Makefile +++ b/examples/smart_test/Makefile @@ -34,9 +34,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs ifeq ($(WINTOOL),y) INCDIROPT = -w @@ -52,93 +50,7 @@ ASRCS = CSRCS = MAINSRC = smart_test.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= smart_test$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: context depend clean distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - $(Q) touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/tcpecho/Makefile b/examples/tcpecho/Makefile index d0a21e0b7..fb28fda28 100644 --- a/examples/tcpecho/Makefile +++ b/examples/tcpecho/Makefile @@ -36,9 +36,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Discover built-in application info @@ -50,89 +48,7 @@ ASRCS = CSRCS = MAINSRC = tcpecho_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= tcpecho$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/telnetd/Makefile b/examples/telnetd/Makefile index 1713a9645..f0f0dcec5 100644 --- a/examples/telnetd/Makefile +++ b/examples/telnetd/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Telnetd Example @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = telnetd.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= telnetd$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Buttons built-in application info APPNAME = telnetd PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/timer/Makefile b/examples/timer/Makefile index dfbca4635..02390b68d 100644 --- a/examples/timer/Makefile +++ b/examples/timer/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Timer built-in application info @@ -55,86 +53,4 @@ ASRCS = CSRCS = MAINSRC = timer_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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)timer_main.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),timer_main) - -context: $(BUILTIN_REGISTRY)$(DELIM)timer_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/examples/touchscreen/Makefile b/examples/touchscreen/Makefile index 69e2549ce..9fa44f4cf 100644 --- a/examples/touchscreen/Makefile +++ b/examples/touchscreen/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # NuttX NX Graphics Example. @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = tc_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= touchscreen$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Touchscreen built-in application info APPNAME = tc PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/usbterm/Makefile b/examples/usbterm/Makefile index 3b55f0990..98e7d8128 100644 --- a/examples/usbterm/Makefile +++ b/examples/usbterm/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # USB terminal example @@ -43,96 +41,13 @@ ASRCS = CSRCS = MAINSRC = usbterm_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= usbterm$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Built-in application info APPNAME = usbterm PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/watchdog/Makefile b/examples/watchdog/Makefile index 2354894f4..b710c7e23 100644 --- a/examples/watchdog/Makefile +++ b/examples/watchdog/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Watchdog Timer Example. @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = watchdog_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= watchdog$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Touchscreen built-in application info APPNAME = wdog PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/wget/Makefile b/examples/wget/Makefile index b30c062b5..9fa488e41 100644 --- a/examples/wget/Makefile +++ b/examples/wget/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # wget webclient example @@ -43,83 +41,7 @@ ASRCS = CSRCS = MAINSRC = wget_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= wget$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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 $@ - -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/wgetjson/Makefile b/examples/wgetjson/Makefile index f4ddd234d..9ce0e3c60 100644 --- a/examples/wgetjson/Makefile +++ b/examples/wgetjson/Makefile @@ -33,9 +33,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # Hello, World! Example @@ -43,95 +41,13 @@ ASRCS = CSRCS = MAINSRC = wgetjson_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= wgetjson$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - # Buttons built-in application info APPNAME = wgetjson PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 2048 -# Common build - -VPATH = - -all: .built -.PHONY: context clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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/examples/xmlrpc/Makefile b/examples/xmlrpc/Makefile index 5b8356db3..99a575868 100644 --- a/examples/xmlrpc/Makefile +++ b/examples/xmlrpc/Makefile @@ -36,9 +36,7 @@ # ############################################################################ --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs # XML RPC built-in application info @@ -50,89 +48,7 @@ ASRCS = CSRCS = calls.c MAINSRC = xmlrpc_main.c -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) -MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) -OBJS = $(AOBJS) $(COBJS) - -ifneq ($(CONFIG_BUILD_KERNEL),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 ?= xmlrpc$(EXEEXT) PROGNAME = $(CONFIG_XYZ_PROGNAME) -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built -.PHONY: clean depend distclean - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -.built: $(OBJS) - $(call ARCHIVE, $(BIN), $(OBJS)) - @touch .built - -ifeq ($(CONFIG_BUILD_KERNEL),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),$(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