This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new deaa6c5  build: Replace $(TOPDIR)/Make.defs with $(APPDIR)/Make.defs
deaa6c5 is described below

commit deaa6c5b7bf8445b4a300691525f60aa506be0d7
Author: Xiang Xiao <xiaoxi...@xiaomi.com>
AuthorDate: Wed May 20 12:35:03 2020 +0800

    build: Replace $(TOPDIR)/Make.defs with $(APPDIR)/Make.defs
    
    and move NUTTXLIB defintion to the common place
    
    Signed-off-by: Xiang Xiao <xiaoxi...@xiaomi.com>
---
 Application.mk                                          |  8 ++++++--
 Directory.mk                                            |  1 -
 Make.defs                                               | 17 +++++++++++++++--
 Makefile                                                | 12 ------------
 builtin/Makefile                                        |  2 +-
 canutils/candump/Makefile                               |  2 +-
 canutils/canlib/Makefile                                |  2 +-
 canutils/cansend/Makefile                               |  2 +-
 canutils/libcanard/Makefile                             |  2 +-
 canutils/libcanutils/Makefile                           |  2 +-
 canutils/libobd2/Makefile                               |  2 +-
 examples/abntcodi/Makefile                              |  2 +-
 examples/adc/Makefile                                   |  2 +-
 examples/adxl372_test/Makefile                          |  2 +-
 examples/ajoystick/Makefile                             |  2 +-
 examples/alarm/Makefile                                 |  2 +-
 examples/apa102/Makefile                                |  2 +-
 examples/apds9960/Makefile                              |  2 +-
 examples/audio_rttl/Makefile                            |  2 +-
 examples/bastest/Makefile                               |  2 +-
 examples/battery/Makefile                               |  2 +-
 examples/bmi160/Makefile                                |  2 +-
 examples/bmp180/Makefile                                |  2 +-
 examples/bridge/Makefile                                |  2 +-
 examples/buttons/Makefile                               |  2 +-
 examples/calib_udelay/Makefile                          |  2 +-
 examples/camera/Makefile                                |  2 +-
 examples/can/Makefile                                   |  2 +-
 examples/canard/Makefile                                |  2 +-
 examples/cctype/Makefile                                |  2 +-
 examples/charger/Makefile                               |  2 +-
 examples/chat/Makefile                                  |  2 +-
 examples/chrono/Makefile                                |  2 +-
 examples/configdata/Makefile                            |  2 +-
 examples/cpuhog/Makefile                                |  2 +-
 examples/cromfs/Makefile                                |  2 +-
 examples/dac/Makefile                                   |  2 +-
 examples/dhcpd/Makefile                                 |  2 +-
 examples/dhcpd/Makefile.host                            |  2 +-
 examples/dhtxx/Makefile                                 |  2 +-
 examples/discover/Makefile                              |  2 +-
 examples/djoystick/Makefile                             |  2 +-
 examples/dsptest/Makefile                               |  2 +-
 examples/elf/Makefile                                   |  2 +-
 examples/elf/tests/Makefile                             |  2 +-
 examples/elf/tests/errno/Makefile                       |  8 +-------
 examples/elf/tests/hello/Makefile                       |  8 +-------
 examples/elf/tests/helloxx/Makefile                     |  8 +-------
 examples/elf/tests/longjmp/Makefile                     |  8 +-------
 examples/elf/tests/mutex/Makefile                       |  8 +-------
 examples/elf/tests/pthread/Makefile                     |  8 +-------
 examples/elf/tests/signal/Makefile                      |  8 +-------
 examples/elf/tests/struct/Makefile                      |  8 +-------
 examples/elf/tests/task/Makefile                        |  8 +-------
 examples/embedlog/Makefile                              |  2 +-
 examples/fb/Makefile                                    |  2 +-
 examples/fboverlay/Makefile                             |  2 +-
 examples/flash_test/Makefile                            |  2 +-
 examples/flowc/Makefile                                 |  2 +-
 examples/ft80x/Makefile                                 |  2 +-
 examples/ftpc/Makefile                                  |  2 +-
 examples/ftpd/Makefile                                  |  2 +-
 examples/gpio/Makefile                                  |  2 +-
 examples/gps/Makefile                                   |  2 +-
 examples/hdc1008_demo/Makefile                          |  2 +-
 examples/hello/Makefile                                 |  2 +-
 examples/helloxx/Makefile                               |  2 +-
 examples/hidkbd/Makefile                                |  2 +-
 examples/hts221_reader/Makefile                         |  2 +-
 examples/i2schar/Makefile                               |  2 +-
 examples/i2sloop/Makefile                               |  2 +-
 examples/igmp/Makefile                                  |  2 +-
 examples/ina219/Makefile                                |  2 +-
 examples/ina226/Makefile                                |  2 +-
 examples/ini_dumper/Makefile                            |  2 +-
 examples/ipforward/Makefile                             |  2 +-
 examples/json/Makefile                                  |  2 +-
 examples/leds/Makefile                                  |  2 +-
 examples/lis3dsh_reader/Makefile                        |  2 +-
 examples/lsm303_reader/Makefile                         |  2 +-
 examples/lsm330spi_test/Makefile                        |  2 +-
 examples/lsm6dsl_reader/Makefile                        |  2 +-
 examples/lvgldemo/Makefile                              |  2 +-
 examples/max31855/Makefile                              |  2 +-
 examples/media/Makefile                                 |  2 +-
 examples/mld/Makefile                                   |  2 +-
 examples/mlx90614/Makefile                              |  2 +-
 examples/modbus/Makefile                                |  2 +-
 examples/modbusmaster/Makefile                          |  2 +-
 examples/module/Makefile                                |  2 +-
 examples/module/drivers/Makefile                        |  2 +-
 examples/module/drivers/chardev/Makefile                |  8 +-------
 examples/mount/Makefile                                 |  2 +-
 examples/mtdpart/Makefile                               |  2 +-
 examples/mtdrwb/Makefile                                |  2 +-
 examples/netlink_route/Makefile                         |  2 +-
 examples/netloop/Makefile                               |  2 +-
 examples/netpkt/Makefile                                |  2 +-
 examples/nettest/Makefile                               |  2 +-
 examples/nrf24l01_term/Makefile                         |  2 +-
 examples/null/Makefile                                  |  2 +-
 examples/nunchuck/Makefile                              |  2 +-
 examples/nx/Makefile                                    |  2 +-
 examples/nxdemo/Makefile                                |  2 +-
 examples/nxflat/Makefile                                |  2 +-
 examples/nxflat/tests/Makefile                          |  2 +-
 examples/nxflat/tests/errno/Makefile                    |  2 +-
 examples/nxflat/tests/hello++/Makefile                  |  2 +-
 examples/nxflat/tests/hello/Makefile                    |  2 +-
 examples/nxflat/tests/longjmp/Makefile                  |  2 +-
 examples/nxflat/tests/mutex/Makefile                    |  2 +-
 examples/nxflat/tests/pthread/Makefile                  |  2 +-
 examples/nxflat/tests/signal/Makefile                   |  2 +-
 examples/nxflat/tests/struct/Makefile                   |  2 +-
 examples/nxflat/tests/task/Makefile                     |  2 +-
 examples/nxhello/Makefile                               |  2 +-
 examples/nximage/Makefile                               |  2 +-
 examples/nxlines/Makefile                               |  2 +-
 examples/nxterm/Makefile                                |  2 +-
 examples/nxtext/Makefile                                |  2 +-
 examples/obd2/Makefile                                  |  2 +-
 examples/oneshot/Makefile                               |  2 +-
 examples/pca9635/Makefile                               |  2 +-
 examples/pdcurses/Makefile                              |  2 +-
 examples/pf_ieee802154/Makefile                         |  2 +-
 examples/pipe/Makefile                                  |  2 +-
 examples/poll/Makefile                                  |  2 +-
 examples/poll/Makefile.host                             |  2 +-
 examples/popen/Makefile                                 |  2 +-
 examples/posix_spawn/Makefile                           |  2 +-
 examples/posix_spawn/filesystem/Makefile                |  2 +-
 examples/posix_spawn/filesystem/hello/Makefile          |  2 +-
 examples/posix_spawn/filesystem/redirect/Makefile       |  2 +-
 examples/powerled/Makefile                              |  2 +-
 examples/powermonitor/Makefile                          |  2 +-
 examples/pppd/Makefile                                  |  2 +-
 examples/pty_test/Makefile                              |  2 +-
 examples/pwfb/Makefile                                  |  2 +-
 examples/pwlines/Makefile                               |  2 +-
 examples/pwm/Makefile                                   |  2 +-
 examples/qencoder/Makefile                              |  2 +-
 examples/random/Makefile                                |  2 +-
 examples/relays/Makefile                                |  2 +-
 examples/rfid_readuid/Makefile                          |  2 +-
 examples/rgbled/Makefile                                |  2 +-
 examples/romfs/Makefile                                 |  2 +-
 examples/sendmail/Makefile                              |  2 +-
 examples/serialblaster/Makefile                         |  2 +-
 examples/serialrx/Makefile                              |  2 +-
 examples/serloop/Makefile                               |  2 +-
 examples/slcd/Makefile                                  |  2 +-
 examples/smps/Makefile                                  |  2 +-
 examples/sotest/Makefile                                |  2 +-
 examples/sotest/lib/Makefile                            |  2 +-
 examples/sotest/lib/modprint/Makefile                   |  8 +-------
 examples/sotest/lib/sotest/Makefile                     |  8 +-------
 examples/stat/Makefile                                  |  2 +-
 examples/sx127x_demo/Makefile                           |  2 +-
 examples/system/Makefile                                |  2 +-
 examples/tcpblaster/Makefile                            |  2 +-
 examples/tcpecho/Makefile                               |  2 +-
 examples/telnetd/Makefile                               |  2 +-
 examples/thttpd/Makefile                                |  2 +-
 examples/thttpd/content/Makefile.binfs                  |  2 +-
 examples/thttpd/content/Makefile.nxflat                 |  2 +-
 examples/thttpd/content/hello/Makefile                  |  2 +-
 examples/thttpd/content/tasks/Makefile                  |  2 +-
 examples/tiff/Makefile                                  |  2 +-
 examples/timer/Makefile                                 |  2 +-
 examples/touchscreen/Makefile                           |  2 +-
 examples/udgram/Makefile                                |  2 +-
 examples/udp/Makefile                                   |  2 +-
 examples/udpblaster/Makefile                            |  2 +-
 examples/uid/Makefile                                   |  2 +-
 examples/unionfs/Makefile                               |  2 +-
 examples/usbserial/Makefile                             |  2 +-
 examples/usbserial/Makefile.host                        |  2 +-
 examples/userfs/Makefile                                |  2 +-
 examples/usrsocktest/Makefile                           |  2 +-
 examples/ustream/Makefile                               |  2 +-
 examples/veml6070/Makefile                              |  2 +-
 examples/watchdog/Makefile                              |  2 +-
 examples/webserver/Makefile                             |  2 +-
 examples/wget/Makefile                                  |  2 +-
 examples/wgetjson/Makefile                              |  2 +-
 examples/xbc_test/Makefile                              |  2 +-
 examples/xmlrpc/Makefile                                |  2 +-
 examples/zerocross/Makefile                             |  2 +-
 fsutils/flash_eraseall/Makefile                         |  2 +-
 fsutils/inifile/Makefile                                |  2 +-
 fsutils/inih/Makefile                                   |  2 +-
 fsutils/mkfatfs/Makefile                                |  2 +-
 fsutils/mksmartfs/Makefile                              |  2 +-
 fsutils/passwd/Makefile                                 |  2 +-
 gpsutils/minmea/Makefile                                |  2 +-
 graphics/ft80x/Makefile                                 |  2 +-
 graphics/lvgl/Makefile                                  |  2 +-
 graphics/nxglyphs/Makefile                              |  2 +-
 graphics/nxwidgets/Makefile                             |  2 +-
 graphics/nxwidgets/UnitTests/CButton/Makefile           |  2 +-
 graphics/nxwidgets/UnitTests/CButtonArray/Makefile      |  2 +-
 graphics/nxwidgets/UnitTests/CCheckBox/Makefile         |  2 +-
 graphics/nxwidgets/UnitTests/CGlyphButton/Makefile      |  2 +-
 .../nxwidgets/UnitTests/CGlyphSliderHorizontal/Makefile |  2 +-
 graphics/nxwidgets/UnitTests/CImage/Makefile            |  2 +-
 graphics/nxwidgets/UnitTests/CKeypad/Makefile           |  2 +-
 graphics/nxwidgets/UnitTests/CLabel/Makefile            |  2 +-
 graphics/nxwidgets/UnitTests/CLatchButton/Makefile      |  2 +-
 graphics/nxwidgets/UnitTests/CLatchButtonArray/Makefile |  2 +-
 graphics/nxwidgets/UnitTests/CListBox/Makefile          |  2 +-
 graphics/nxwidgets/UnitTests/CProgressBar/Makefile      |  2 +-
 graphics/nxwidgets/UnitTests/CRadioButton/Makefile      |  2 +-
 .../nxwidgets/UnitTests/CScrollbarHorizontal/Makefile   |  2 +-
 .../nxwidgets/UnitTests/CScrollbarVertical/Makefile     |  2 +-
 graphics/nxwidgets/UnitTests/CSliderHorizonal/Makefile  |  2 +-
 graphics/nxwidgets/UnitTests/CSliderVertical/Makefile   |  2 +-
 graphics/nxwidgets/UnitTests/CTextBox/Makefile          |  2 +-
 graphics/nxwm/Makefile                                  |  2 +-
 graphics/pdcurs34/Makefile                              |  2 +-
 graphics/screenshot/Makefile                            |  2 +-
 graphics/slcd/Makefile                                  |  2 +-
 graphics/tiff/Makefile                                  |  2 +-
 graphics/twm4nx/Makefile                                |  2 +-
 import/Makefile                                         |  2 +-
 industry/abnt_codi/Makefile                             |  2 +-
 interpreters/bas/Makefile                               |  2 +-
 interpreters/ficl/Makefile                              |  2 +-
 interpreters/minibasic/Makefile                         |  2 +-
 modbus/Makefile                                         |  2 +-
 netutils/chat/Makefile                                  |  2 +-
 netutils/cjson/Makefile                                 |  2 +-
 netutils/codecs/Makefile                                |  2 +-
 netutils/dhcpc/Makefile                                 |  2 +-
 netutils/dhcpd/Makefile                                 |  2 +-
 netutils/discover/Makefile                              |  2 +-
 netutils/esp8266/Makefile                               |  2 +-
 netutils/ftpc/Makefile                                  |  2 +-
 netutils/ftpd/Makefile                                  |  2 +-
 netutils/libcurl4nx/Makefile                            |  2 +-
 netutils/netinit/Makefile                               |  2 +-
 netutils/netlib/Makefile                                |  2 +-
 netutils/ntpclient/Makefile                             |  2 +-
 netutils/ping/Makefile                                  |  2 +-
 netutils/pppd/Makefile                                  |  2 +-
 netutils/smtp/Makefile                                  |  2 +-
 netutils/telnetc/Makefile                               |  2 +-
 netutils/telnetd/Makefile                               |  2 +-
 netutils/tftpc/Makefile                                 |  2 +-
 netutils/thttpd/Makefile                                |  2 +-
 netutils/thttpd/cgi-src/Makefile                        |  2 +-
 netutils/usrsock_rpmsg/Makefile                         |  2 +-
 netutils/webclient/Makefile                             |  2 +-
 netutils/webserver/Makefile                             |  2 +-
 netutils/xmlrpc/Makefile                                |  2 +-
 nshlib/Makefile                                         |  2 +-
 platform/Makefile                                       |  2 +-
 platform/bin/Makefile                                   |  2 +-
 system/cdcacm/Makefile                                  |  2 +-
 system/cfgdata/Makefile                                 |  2 +-
 system/cle/Makefile                                     |  2 +-
 system/composite/Makefile                               |  2 +-
 system/critmon/Makefile                                 |  2 +-
 system/cu/Makefile                                      |  2 +-
 system/dhcpc/Makefile                                   |  2 +-
 system/embedlog/Makefile                                |  2 +-
 system/flash_eraseall/Makefile                          |  2 +-
 system/hex2bin/Makefile                                 |  2 +-
 system/hexed/Makefile                                   |  2 +-
 system/i2c/Makefile                                     |  2 +-
 system/lm75/Makefile                                    |  2 +-
 system/lzf/Makefile                                     |  2 +-
 system/mdio/Makefile                                    |  2 +-
 system/netdb/Makefile                                   |  2 +-
 system/nsh/Makefile                                     |  2 +-
 system/ntpc/Makefile                                    |  2 +-
 system/nxplayer/Makefile                                |  2 +-
 system/nxrecorder/Makefile                              |  2 +-
 system/ping/Makefile                                    |  2 +-
 system/ping6/Makefile                                   |  2 +-
 system/popen/Makefile                                   |  2 +-
 system/psmq/Makefile                                    |  2 +-
 system/ramtest/Makefile                                 |  2 +-
 system/readline/Makefile                                |  2 +-
 system/sched_note/Makefile                              |  2 +-
 system/setlogmask/Makefile                              |  2 +-
 system/spi/Makefile                                     |  2 +-
 system/stackmonitor/Makefile                            |  2 +-
 system/system/Makefile                                  |  2 +-
 system/taskset/Makefile                                 |  2 +-
 system/tee/Makefile                                     |  2 +-
 system/telnet/Makefile                                  |  2 +-
 system/termcurses/Makefile                              |  2 +-
 system/ubloxmodem/Makefile                              |  2 +-
 system/usbmsc/Makefile                                  |  2 +-
 system/vi/Makefile                                      |  2 +-
 system/zmodem/Makefile                                  |  2 +-
 system/zmodem/Makefile.host                             |  1 -
 testing/cxxtest/Makefile                                |  2 +-
 testing/fstest/Makefile                                 |  2 +-
 testing/getprime/Makefile                               |  2 +-
 testing/mm/Makefile                                     |  2 +-
 testing/nxffs/Makefile                                  |  2 +-
 testing/ostest/Makefile                                 |  2 +-
 testing/scanftest/Makefile                              |  2 +-
 testing/smart/Makefile                                  |  2 +-
 testing/smart_test/Makefile                             |  2 +-
 testing/smp/Makefile                                    |  2 +-
 testing/unity/Makefile                                  |  2 +-
 wireless/bluetooth/btsak/Makefile                       |  2 +-
 wireless/gs2200m/Makefile                               |  2 +-
 wireless/ieee802154/i8sak/Makefile                      |  2 +-
 wireless/ieee802154/i8shark/Makefile                    |  2 +-
 wireless/ieee802154/libmac/Makefile                     |  2 +-
 wireless/ieee802154/libutils/Makefile                   |  2 +-
 wireless/iwpan/Makefile                                 |  2 +-
 wireless/wapi/Makefile                                  |  2 +-
 316 files changed, 332 insertions(+), 401 deletions(-)

diff --git a/Application.mk b/Application.mk
index 49103c3..d23492e 100644
--- a/Application.mk
+++ b/Application.mk
@@ -35,8 +35,6 @@
 #
 ############################################################################
 
-include $(APPDIR)/Make.defs
-
 # If this is an executable program (with MAINSRC), we must build it as a
 # loadable module for the KERNEL build (always) or if the tristate module
 # has the value "m"
@@ -61,6 +59,12 @@ else
 CWD = $(CURDIR)
 endif
 
+ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
+  LDLIBS += "${shell cygpath -w $(BIN)}"
+else
+  LDLIBS += $(BIN)
+endif
+
 SUFFIX = $(subst $(DELIM),.,$(CWD))
 PROGNAME := $(shell echo $(PROGNAME))
 
diff --git a/Directory.mk b/Directory.mk
index 3a148af..66fbbda 100644
--- a/Directory.mk
+++ b/Directory.mk
@@ -33,7 +33,6 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
 # Sub-directories
diff --git a/Make.defs b/Make.defs
index 8b5463a..92cae86 100644
--- a/Make.defs
+++ b/Make.defs
@@ -34,6 +34,19 @@
 #
 ############################################################################
 
+TOPDIR ?= $(APPDIR)/import
+include $(TOPDIR)/Make.defs
+
+# The GNU make CURDIR will always be a POSIX-like path with forward slashes
+# as path segment separators.  This is fine for the above inclusions but
+# will cause problems later for the native build.  If we know that this is
+# a native build, then we need to fix up the APPDIR path for subsequent
+# use
+
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+APPDIR := ${shell echo %CD%}
+endif
+
 # Application Directories
 
 # BUILDIRS is the list of top-level directories containing Make.defs files
@@ -103,7 +116,7 @@ CFLAGS   += ${shell $(INCDIR) "$(CC)" 
"$(APPDIR)$(DELIM)include"}
 CXXFLAGS += ${shell $(INCDIR) "$(CC)" "$(APPDIR)$(DELIM)include"}
 
 ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
-  LDLIBS ?= "${shell cygpath -w $(BIN)}"
+  NUTTXLIB ?= "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
 else
-  LDLIBS ?= $(BIN)
+  NUTTXLIB ?= "$(TOPDIR)$(DELIM)staging"
 endif
diff --git a/Makefile b/Makefile
index 49c6e4b..91ef3a9 100644
--- a/Makefile
+++ b/Makefile
@@ -36,20 +36,8 @@
 ############################################################################
 
 APPDIR = $(CURDIR)
-TOPDIR ?= $(APPDIR)/import
-include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-# The GNU make CURDIR will always be a POSIX-like path with forward slashes
-# as path segment separators.  This is fine for the above inclusions but
-# will cause problems later for the native build.  If we know that this is
-# a native build, then we need to fix up the APPDIR path for subsequent
-# use
-
-ifeq ($(CONFIG_WINDOWS_NATIVE),y)
-APPDIR := ${shell echo %CD%}
-endif
-
 # Symbol table for loadable apps.
 
 SYMTABSRC = symtab_apps.c
diff --git a/builtin/Makefile b/builtin/Makefile
index 6ca3a30..6448d0e 100644
--- a/builtin/Makefile
+++ b/builtin/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Source and object files
 
diff --git a/canutils/candump/Makefile b/canutils/candump/Makefile
index 97b0d09..abbccfb 100644
--- a/canutils/candump/Makefile
+++ b/canutils/candump/Makefile
@@ -18,7 +18,7 @@
 #
 ############################################################################/
 
--include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # SocketCAN userspace utilities and tools candump tool
 # https://github.com/linux-can/can-utils/blob/master/candump.c
diff --git a/canutils/canlib/Makefile b/canutils/canlib/Makefile
index 232a9d4..023d95d 100644
--- a/canutils/canlib/Makefile
+++ b/canutils/canlib/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CAN utility library
 
diff --git a/canutils/cansend/Makefile b/canutils/cansend/Makefile
index ccfca2a..8df2057 100644
--- a/canutils/cansend/Makefile
+++ b/canutils/cansend/Makefile
@@ -18,7 +18,7 @@
 #
 ############################################################################/
 
--include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # SocketCAN userspace utilities and tools cansend tool
 # https://github.com/linux-can/can-utils/blob/master/cansend.c
diff --git a/canutils/libcanard/Makefile b/canutils/libcanard/Makefile
index 984015a..b08ee45 100644
--- a/canutils/libcanard/Makefile
+++ b/canutils/libcanard/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 WGET = wget
 UNPACK = unzip
diff --git a/canutils/libcanutils/Makefile b/canutils/libcanutils/Makefile
index 01e7022..cb790c8 100644
--- a/canutils/libcanutils/Makefile
+++ b/canutils/libcanutils/Makefile
@@ -18,7 +18,7 @@
 #
 ############################################################################/
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # SocketCAN userspace utilities and tools library
 # https://github.com/linux-can/can-utils
diff --git a/canutils/libobd2/Makefile b/canutils/libobd2/Makefile
index 828325b..6f20f07 100644
--- a/canutils/libobd2/Makefile
+++ b/canutils/libobd2/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CAN utility library
 
diff --git a/examples/abntcodi/Makefile b/examples/abntcodi/Makefile
index 4bad230..d8ca7d1 100644
--- a/examples/abntcodi/Makefile
+++ b/examples/abntcodi/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # ABNTCODI built-in application info
 
diff --git a/examples/adc/Makefile b/examples/adc/Makefile
index 842a929..b49e5ac 100644
--- a/examples/adc/Makefile
+++ b/examples/adc/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # ADC example
 
diff --git a/examples/adxl372_test/Makefile b/examples/adxl372_test/Makefile
index a63bcad..b476935 100644
--- a/examples/adxl372_test/Makefile
+++ b/examples/adxl372_test/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 PROGNAME = $(CONFIG_EXAMPLES_ADXL372_TEST_PROGNAME)
 PRIORITY = $(CONFIG_EXAMPLES_ADXL372_TEST_PRIORITY)
diff --git a/examples/ajoystick/Makefile b/examples/ajoystick/Makefile
index f110a21..b2c0f56 100644
--- a/examples/ajoystick/Makefile
+++ b/examples/ajoystick/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Hello, World! Example
 
diff --git a/examples/alarm/Makefile b/examples/alarm/Makefile
index 1716fe5..ca56663 100644
--- a/examples/alarm/Makefile
+++ b/examples/alarm/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # RTC driver alarm test built-in application info
 
diff --git a/examples/apa102/Makefile b/examples/apa102/Makefile
index d5b2ef2..8628005 100644
--- a/examples/apa102/Makefile
+++ b/examples/apa102/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # APA102 built-in application info
 
diff --git a/examples/apds9960/Makefile b/examples/apds9960/Makefile
index 87abb03..dc56ea0 100644
--- a/examples/apds9960/Makefile
+++ b/examples/apds9960/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Hello, World! built-in application info
 
diff --git a/examples/audio_rttl/Makefile b/examples/audio_rttl/Makefile
index cd0bd24..a6df94f 100644
--- a/examples/audio_rttl/Makefile
+++ b/examples/audio_rttl/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 -include $(SDKDIR)/Make.defs
 
 # Audio application info
diff --git a/examples/bastest/Makefile b/examples/bastest/Makefile
index 1aebadb..f0b85ef 100644
--- a/examples/bastest/Makefile
+++ b/examples/bastest/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # BAS test volume mounter
 
diff --git a/examples/battery/Makefile b/examples/battery/Makefile
index 2b169d3..65ca086 100644
--- a/examples/battery/Makefile
+++ b/examples/battery/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Battery built-in application info
 
diff --git a/examples/bmi160/Makefile b/examples/bmi160/Makefile
index 47462c3..45132d8 100644
--- a/examples/bmi160/Makefile
+++ b/examples/bmi160/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 -include $(SDKDIR)/Make.defs
 
 # sixaxis built-in application info
diff --git a/examples/bmp180/Makefile b/examples/bmp180/Makefile
index fe5e785..a6bd2c1 100644
--- a/examples/bmp180/Makefile
+++ b/examples/bmp180/Makefile
@@ -35,7 +35,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # BMP180 Barometer sensor example built-in application info
 
diff --git a/examples/bridge/Makefile b/examples/bridge/Makefile
index 8a0190f..ed6aea3 100644
--- a/examples/bridge/Makefile
+++ b/examples/bridge/Makefile
@@ -34,7 +34,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Discover built-in application info
 
diff --git a/examples/buttons/Makefile b/examples/buttons/Makefile
index 7c97b1d..0e6cb8b 100644
--- a/examples/buttons/Makefile
+++ b/examples/buttons/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # LED driver test built-in application info
 
diff --git a/examples/calib_udelay/Makefile b/examples/calib_udelay/Makefile
index 8e98805..224b51e 100644
--- a/examples/calib_udelay/Makefile
+++ b/examples/calib_udelay/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # built-in application info
 
diff --git a/examples/camera/Makefile b/examples/camera/Makefile
index a0edeeb..a3110bd 100644
--- a/examples/camera/Makefile
+++ b/examples/camera/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # camera built-in application info
 
diff --git a/examples/can/Makefile b/examples/can/Makefile
index 85d571c..70879ce 100644
--- a/examples/can/Makefile
+++ b/examples/can/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NuttX NX Graphics Example.
 
diff --git a/examples/canard/Makefile b/examples/canard/Makefile
index cdee49d..307fc15 100644
--- a/examples/canard/Makefile
+++ b/examples/canard/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 PROGNAME = canard
 PRIORITY = SCHED_PRIORITY_DEFAULT
diff --git a/examples/cctype/Makefile b/examples/cctype/Makefile
index 1ac7488..c85936b 100644
--- a/examples/cctype/Makefile
+++ b/examples/cctype/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # cctype verification
 
diff --git a/examples/charger/Makefile b/examples/charger/Makefile
index e0295b3..052ea02 100644
--- a/examples/charger/Makefile
+++ b/examples/charger/Makefile
@@ -1,5 +1,5 @@
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 -include $(SDKDIR)/Make.defs
 
 PROGNAME = $(CONFIG_EXAMPLES_CHARGER_PROGNAME)
diff --git a/examples/chat/Makefile b/examples/chat/Makefile
index 52bdc7d..7a07e16 100644
--- a/examples/chat/Makefile
+++ b/examples/chat/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 MAINSRC = chat_main.c
 
diff --git a/examples/chrono/Makefile b/examples/chrono/Makefile
index a975902..2b6dfa4 100644
--- a/examples/chrono/Makefile
+++ b/examples/chrono/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Chronometer built-in application info
 
diff --git a/examples/configdata/Makefile b/examples/configdata/Makefile
index 9b89872..8140eba 100644
--- a/examples/configdata/Makefile
+++ b/examples/configdata/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CONFIGDATA Unit Test
 
diff --git a/examples/cpuhog/Makefile b/examples/cpuhog/Makefile
index aae6359..67cfcb5 100644
--- a/examples/cpuhog/Makefile
+++ b/examples/cpuhog/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # do nothing loop to use up cpu time
 
diff --git a/examples/cromfs/Makefile b/examples/cromfs/Makefile
index a365b61..03aea04 100644
--- a/examples/cromfs/Makefile
+++ b/examples/cromfs/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CROMFS Example
 
diff --git a/examples/dac/Makefile b/examples/dac/Makefile
index 5ee1434..7588737 100644
--- a/examples/dac/Makefile
+++ b/examples/dac/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # DAC tool
 
diff --git a/examples/dhcpd/Makefile b/examples/dhcpd/Makefile
index a628fbb..4d89b9e 100644
--- a/examples/dhcpd/Makefile
+++ b/examples/dhcpd/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # DHCP Daemon Example
 
diff --git a/examples/dhcpd/Makefile.host b/examples/dhcpd/Makefile.host
index 00051a2..19208e2 100644
--- a/examples/dhcpd/Makefile.host
+++ b/examples/dhcpd/Makefile.host
@@ -35,7 +35,7 @@
 
 # TOPDIR must be defined on the make command line
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 OBJS           = host.hobj dhcpd.hobj
 BIN            = dhcpd
diff --git a/examples/dhtxx/Makefile b/examples/dhtxx/Makefile
index 76094cf..55bbdec 100644
--- a/examples/dhtxx/Makefile
+++ b/examples/dhtxx/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Dhtxx, World! built-in application info
 
diff --git a/examples/discover/Makefile b/examples/discover/Makefile
index 5c86863..c854bcb 100644
--- a/examples/discover/Makefile
+++ b/examples/discover/Makefile
@@ -36,7 +36,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Discover built-in application info
 
diff --git a/examples/djoystick/Makefile b/examples/djoystick/Makefile
index 4be1020..0a09d92 100644
--- a/examples/djoystick/Makefile
+++ b/examples/djoystick/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Hello, World! Example
 
diff --git a/examples/dsptest/Makefile b/examples/dsptest/Makefile
index f6aa0d5..be9e98c 100644
--- a/examples/dsptest/Makefile
+++ b/examples/dsptest/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # dsptest built-in application info
 
diff --git a/examples/elf/Makefile b/examples/elf/Makefile
index 91946de..6cedf90 100644
--- a/examples/elf/Makefile
+++ b/examples/elf/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # ELF Example
 
diff --git a/examples/elf/tests/Makefile b/examples/elf/tests/Makefile
index 620b83c..619efc5 100644
--- a/examples/elf/tests/Makefile
+++ b/examples/elf/tests/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 ALL_SUBDIRS = errno hello helloxx longjmp mutex pthread signal task struct
 BUILD_SUBDIRS = errno hello struct signal
diff --git a/examples/elf/tests/errno/Makefile 
b/examples/elf/tests/errno/Makefile
index cb2b754..da3599c 100644
--- a/examples/elf/tests/errno/Makefile
+++ b/examples/elf/tests/errno/Makefile
@@ -33,13 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
-
-ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
-NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
-else
-NUTTXLIB = "$(TOPDIR)$(DELIM)staging"
-endif
+include $(APPDIR)/Make.defs
 
 ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y)
 LDELFFLAGS += -Bstatic
diff --git a/examples/elf/tests/hello/Makefile 
b/examples/elf/tests/hello/Makefile
index 106663a..e720eaf 100644
--- a/examples/elf/tests/hello/Makefile
+++ b/examples/elf/tests/hello/Makefile
@@ -33,13 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
-
-ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
-NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
-else
-NUTTXLIB = "$(TOPDIR)$(DELIM)staging"
-endif
+include $(APPDIR)/Make.defs
 
 ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y)
 LDELFFLAGS += -Bstatic
diff --git a/examples/elf/tests/helloxx/Makefile 
b/examples/elf/tests/helloxx/Makefile
index d82e28f..d32ebe8 100644
--- a/examples/elf/tests/helloxx/Makefile
+++ b/examples/elf/tests/helloxx/Makefile
@@ -33,13 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
-
-ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
-NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
-else
-NUTTXLIB = "$(TOPDIR)$(DELIM)staging"
-endif
+include $(APPDIR)/Make.defs
 
 ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y)
 LDELFFLAGS += -Bstatic
diff --git a/examples/elf/tests/longjmp/Makefile 
b/examples/elf/tests/longjmp/Makefile
index 08e2429..f87124a 100644
--- a/examples/elf/tests/longjmp/Makefile
+++ b/examples/elf/tests/longjmp/Makefile
@@ -33,13 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
-
-ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
-NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
-else
-NUTTXLIB = "$(TOPDIR)$(DELIM)staging"
-endif
+include $(APPDIR)/Make.defs
 
 ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y)
 LDELFFLAGS += -Bstatic
diff --git a/examples/elf/tests/mutex/Makefile 
b/examples/elf/tests/mutex/Makefile
index 9089b73..56105e2 100644
--- a/examples/elf/tests/mutex/Makefile
+++ b/examples/elf/tests/mutex/Makefile
@@ -33,13 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
-
-ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
-NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
-else
-NUTTXLIB = "$(TOPDIR)$(DELIM)staging"
-endif
+include $(APPDIR)/Make.defs
 
 ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y)
 LDELFFLAGS += -Bstatic
diff --git a/examples/elf/tests/pthread/Makefile 
b/examples/elf/tests/pthread/Makefile
index 7cb9399..01cf297 100644
--- a/examples/elf/tests/pthread/Makefile
+++ b/examples/elf/tests/pthread/Makefile
@@ -33,13 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
-
-ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
-NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
-else
-NUTTXLIB = "$(TOPDIR)$(DELIM)staging"
-endif
+include $(APPDIR)/Make.defs
 
 ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y)
 LDELFFLAGS += -Bstatic
diff --git a/examples/elf/tests/signal/Makefile 
b/examples/elf/tests/signal/Makefile
index 7c5ab59..d58779f 100644
--- a/examples/elf/tests/signal/Makefile
+++ b/examples/elf/tests/signal/Makefile
@@ -33,13 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
-
-ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
-NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
-else
-NUTTXLIB = "$(TOPDIR)$(DELIM)staging"
-endif
+include $(APPDIR)/Make.defs
 
 ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y)
 LDELFFLAGS += -Bstatic
diff --git a/examples/elf/tests/struct/Makefile 
b/examples/elf/tests/struct/Makefile
index d90e927..7af188b 100644
--- a/examples/elf/tests/struct/Makefile
+++ b/examples/elf/tests/struct/Makefile
@@ -33,13 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
-
-ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
-NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
-else
-NUTTXLIB = "$(TOPDIR)$(DELIM)staging"
-endif
+include $(APPDIR)/Make.defs
 
 ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y)
 LDELFFLAGS += -Bstatic
diff --git a/examples/elf/tests/task/Makefile b/examples/elf/tests/task/Makefile
index ee64f3d..8973f10 100644
--- a/examples/elf/tests/task/Makefile
+++ b/examples/elf/tests/task/Makefile
@@ -33,13 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
-
-ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
-NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
-else
-NUTTXLIB = "$(TOPDIR)$(DELIM)staging"
-endif
+include $(APPDIR)/Make.defs
 
 ifeq ($(CONFIG_EXAMPLES_ELF_SYSCALL),y)
 LDELFFLAGS += -Bstatic
diff --git a/examples/embedlog/Makefile b/examples/embedlog/Makefile
index 027c574..1f7d627 100644
--- a/examples/embedlog/Makefile
+++ b/examples/embedlog/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # embedlog example built-in application info
 
diff --git a/examples/fb/Makefile b/examples/fb/Makefile
index d0e9f72..f0b0904 100644
--- a/examples/fb/Makefile
+++ b/examples/fb/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # FB, World! built-in application info
 
diff --git a/examples/fboverlay/Makefile b/examples/fboverlay/Makefile
index 6a490b0..55cd632 100644
--- a/examples/fboverlay/Makefile
+++ b/examples/fboverlay/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # fboverlay built-in application info
 
diff --git a/examples/flash_test/Makefile b/examples/flash_test/Makefile
index 51c71d5..ebc2afb 100644
--- a/examples/flash_test/Makefile
+++ b/examples/flash_test/Makefile
@@ -34,7 +34,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # SMART FLASH block device test
 
diff --git a/examples/flowc/Makefile b/examples/flowc/Makefile
index 6b7a9c2..aa28086 100644
--- a/examples/flowc/Makefile
+++ b/examples/flowc/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # FLOWC Test
 
diff --git a/examples/ft80x/Makefile b/examples/ft80x/Makefile
index 82bc27e..3730bf3 100644
--- a/examples/ft80x/Makefile
+++ b/examples/ft80x/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # FT80X example built-in application info
 
diff --git a/examples/ftpc/Makefile b/examples/ftpc/Makefile
index 7ef7087..8b687e2 100644
--- a/examples/ftpc/Makefile
+++ b/examples/ftpc/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # FTPC Client Application
 
diff --git a/examples/ftpd/Makefile b/examples/ftpd/Makefile
index d529a13..e023107 100644
--- a/examples/ftpd/Makefile
+++ b/examples/ftpd/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 MAINSRC = ftpd_main.c
 
diff --git a/examples/gpio/Makefile b/examples/gpio/Makefile
index 572fd53..c0f2d10 100644
--- a/examples/gpio/Makefile
+++ b/examples/gpio/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # GPIO, World! built-in application info
 
diff --git a/examples/gps/Makefile b/examples/gps/Makefile
index 882d711..0d1ee9b 100644
--- a/examples/gps/Makefile
+++ b/examples/gps/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # GPS built-in application info
 
diff --git a/examples/hdc1008_demo/Makefile b/examples/hdc1008_demo/Makefile
index 9067ac8..6f691ea 100644
--- a/examples/hdc1008_demo/Makefile
+++ b/examples/hdc1008_demo/Makefile
@@ -18,7 +18,7 @@
 #
 ############################################################################/
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # hdc1008 example built-in application info
 
diff --git a/examples/hello/Makefile b/examples/hello/Makefile
index 96ba358..ecef741 100644
--- a/examples/hello/Makefile
+++ b/examples/hello/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Hello, World! built-in application info
 
diff --git a/examples/helloxx/Makefile b/examples/helloxx/Makefile
index 649dec5..fbc3493 100644
--- a/examples/helloxx/Makefile
+++ b/examples/helloxx/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Hello, World! C++ Example
 
diff --git a/examples/hidkbd/Makefile b/examples/hidkbd/Makefile
index b9c1457..61dae39 100644
--- a/examples/hidkbd/Makefile
+++ b/examples/hidkbd/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # USB Host HID keyboard Example
 
diff --git a/examples/hts221_reader/Makefile b/examples/hts221_reader/Makefile
index 74da41e..63c1b7d 100644
--- a/examples/hts221_reader/Makefile
+++ b/examples/hts221_reader/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # hts221_reader example
 
diff --git a/examples/i2schar/Makefile b/examples/i2schar/Makefile
index e108e0e..ee4f284 100644
--- a/examples/i2schar/Makefile
+++ b/examples/i2schar/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # I2S character driver test
 
diff --git a/examples/i2sloop/Makefile b/examples/i2sloop/Makefile
index e57d4bf..0968b31 100644
--- a/examples/i2sloop/Makefile
+++ b/examples/i2sloop/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # I2S character driver test
 
diff --git a/examples/igmp/Makefile b/examples/igmp/Makefile
index d4e455d..8dd443e 100644
--- a/examples/igmp/Makefile
+++ b/examples/igmp/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 PROGNAME = igmp
 PRIORITY = SCHED_PRIORITY_DEFAULT
diff --git a/examples/ina219/Makefile b/examples/ina219/Makefile
index 67b142f..fb20aed 100644
--- a/examples/ina219/Makefile
+++ b/examples/ina219/Makefile
@@ -35,7 +35,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Hello, World! built-in application info
 
diff --git a/examples/ina226/Makefile b/examples/ina226/Makefile
index 9ef60d0..9e65763 100644
--- a/examples/ina226/Makefile
+++ b/examples/ina226/Makefile
@@ -35,7 +35,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # INA226 built-in application info
 
diff --git a/examples/ini_dumper/Makefile b/examples/ini_dumper/Makefile
index b95c223..b8fffbb 100644
--- a/examples/ini_dumper/Makefile
+++ b/examples/ini_dumper/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # ini_dumper example built-in application info
 
diff --git a/examples/ipforward/Makefile b/examples/ipforward/Makefile
index b816105..5d33e0e 100644
--- a/examples/ipforward/Makefile
+++ b/examples/ipforward/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Hello, World! built-in application info
 
diff --git a/examples/json/Makefile b/examples/json/Makefile
index d5c4cd2..11fd71d 100644
--- a/examples/json/Makefile
+++ b/examples/json/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # cJSON built-in application info
 
diff --git a/examples/leds/Makefile b/examples/leds/Makefile
index 72ae721..30a8246 100644
--- a/examples/leds/Makefile
+++ b/examples/leds/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # LED driver test built-in application info
 
diff --git a/examples/lis3dsh_reader/Makefile b/examples/lis3dsh_reader/Makefile
index a8f1200..3b00f28 100644
--- a/examples/lis3dsh_reader/Makefile
+++ b/examples/lis3dsh_reader/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 PROGNAME = $(CONFIG_EXAMPLES_LIS3DSH_READER_PROGNAME)
 PRIORITY = SCHED_PRIORITY_DEFAULT
diff --git a/examples/lsm303_reader/Makefile b/examples/lsm303_reader/Makefile
index cec31d7..1ea2a63 100644
--- a/examples/lsm303_reader/Makefile
+++ b/examples/lsm303_reader/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # lsm303_reader example
 
diff --git a/examples/lsm330spi_test/Makefile b/examples/lsm330spi_test/Makefile
index 42bcbb5..51e1363 100644
--- a/examples/lsm330spi_test/Makefile
+++ b/examples/lsm330spi_test/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 PROGNAME = $(CONFIG_EXAMPLES_LSM330SPI_TEST_PROGNAME)
 PRIORITY = $(CONFIG_EXAMPLES_LSM330SPI_TEST_PRIORITY)
diff --git a/examples/lsm6dsl_reader/Makefile b/examples/lsm6dsl_reader/Makefile
index ecdb8b1..0beacde 100644
--- a/examples/lsm6dsl_reader/Makefile
+++ b/examples/lsm6dsl_reader/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # lsm6dsl_reader example
 
diff --git a/examples/lvgldemo/Makefile b/examples/lvgldemo/Makefile
index f784d1c..d39ee01 100644
--- a/examples/lvgldemo/Makefile
+++ b/examples/lvgldemo/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # LittleVGL demo built-in application info
 
diff --git a/examples/max31855/Makefile b/examples/max31855/Makefile
index 2843887..0edbf74 100644
--- a/examples/max31855/Makefile
+++ b/examples/max31855/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # max31855 built-in application info
 
diff --git a/examples/media/Makefile b/examples/media/Makefile
index 4911824..3486329 100644
--- a/examples/media/Makefile
+++ b/examples/media/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Media test application info
 
diff --git a/examples/mld/Makefile b/examples/mld/Makefile
index de7f126..441a9bd 100644
--- a/examples/mld/Makefile
+++ b/examples/mld/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # MLD Networking Example
 
diff --git a/examples/mlx90614/Makefile b/examples/mlx90614/Makefile
index 5573ec6..0cd815c 100644
--- a/examples/mlx90614/Makefile
+++ b/examples/mlx90614/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # MLX90614 built-in application info
 
diff --git a/examples/modbus/Makefile b/examples/modbus/Makefile
index f6cc454..0812dc0 100644
--- a/examples/modbus/Makefile
+++ b/examples/modbus/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # FreeModBus demo built-in application info
 
diff --git a/examples/modbusmaster/Makefile b/examples/modbusmaster/Makefile
index d9d7df6..54bfa26 100644
--- a/examples/modbusmaster/Makefile
+++ b/examples/modbusmaster/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Modbus Master built-in application info
 
diff --git a/examples/module/Makefile b/examples/module/Makefile
index ad1e2e8..5267c9f 100644
--- a/examples/module/Makefile
+++ b/examples/module/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Module example built-in application info
 
diff --git a/examples/module/drivers/Makefile b/examples/module/drivers/Makefile
index 756eaba..0eaefc7 100644
--- a/examples/module/drivers/Makefile
+++ b/examples/module/drivers/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 ALL_SUBDIRS = chardev
 BUILD_SUBDIRS = chardev
diff --git a/examples/module/drivers/chardev/Makefile 
b/examples/module/drivers/chardev/Makefile
index faba8f7..d6c9650 100644
--- a/examples/module/drivers/chardev/Makefile
+++ b/examples/module/drivers/chardev/Makefile
@@ -33,13 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
-
-ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
-NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
-else
-NUTTXLIB = "$(TOPDIR)$(DELIM)staging"
-endif
+include $(APPDIR)/Make.defs
 
 CMODULEFLAGS += $(KDEFINE)
 
diff --git a/examples/mount/Makefile b/examples/mount/Makefile
index 365c9e9..8ae58ad 100644
--- a/examples/mount/Makefile
+++ b/examples/mount/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # mount() test
 
diff --git a/examples/mtdpart/Makefile b/examples/mtdpart/Makefile
index b41e0e5..359a57d 100644
--- a/examples/mtdpart/Makefile
+++ b/examples/mtdpart/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # MTD Partition Example
 
diff --git a/examples/mtdrwb/Makefile b/examples/mtdrwb/Makefile
index d83782a..b0bca4c 100644
--- a/examples/mtdrwb/Makefile
+++ b/examples/mtdrwb/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # MTD R/W buffer test Example
 
diff --git a/examples/netlink_route/Makefile b/examples/netlink_route/Makefile
index 6e217c5..2fb5910 100644
--- a/examples/netlink_route/Makefile
+++ b/examples/netlink_route/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Netlink NETLINK_ROUTE built-in application info
 
diff --git a/examples/netloop/Makefile b/examples/netloop/Makefile
index 70c191b..6542397 100644
--- a/examples/netloop/Makefile
+++ b/examples/netloop/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Network loopback Example
 
diff --git a/examples/netpkt/Makefile b/examples/netpkt/Makefile
index 56de89a..a7580c8 100644
--- a/examples/netpkt/Makefile
+++ b/examples/netpkt/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Network packet socket example
 
diff --git a/examples/nettest/Makefile b/examples/nettest/Makefile
index 54ce298..dbffb86 100644
--- a/examples/nettest/Makefile
+++ b/examples/nettest/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Basic TCP networking test
 
diff --git a/examples/nrf24l01_term/Makefile b/examples/nrf24l01_term/Makefile
index b73c00a..7f98891 100644
--- a/examples/nrf24l01_term/Makefile
+++ b/examples/nrf24l01_term/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Basic nRF24L01+ terminal demonstration
 
diff --git a/examples/null/Makefile b/examples/null/Makefile
index 46ceb8b..7149bd2 100644
--- a/examples/null/Makefile
+++ b/examples/null/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # The NULL example built-in application info
 
diff --git a/examples/nunchuck/Makefile b/examples/nunchuck/Makefile
index 68f8c39..78e1151 100644
--- a/examples/nunchuck/Makefile
+++ b/examples/nunchuck/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Nunchuck Example
 
diff --git a/examples/nx/Makefile b/examples/nx/Makefile
index a5d7aa7..161830f 100644
--- a/examples/nx/Makefile
+++ b/examples/nx/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NuttX NX Graphics Example.
 
diff --git a/examples/nxdemo/Makefile b/examples/nxdemo/Makefile
index 59663c4..9beb01a 100644
--- a/examples/nxdemo/Makefile
+++ b/examples/nxdemo/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NuttX NX Graphics Example.
 
diff --git a/examples/nxflat/Makefile b/examples/nxflat/Makefile
index 4ec5a8e..3ecf369 100644
--- a/examples/nxflat/Makefile
+++ b/examples/nxflat/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NXFLAT Example
 
diff --git a/examples/nxflat/tests/Makefile b/examples/nxflat/tests/Makefile
index 0a8aac5..7640a5d 100644
--- a/examples/nxflat/tests/Makefile
+++ b/examples/nxflat/tests/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Most of these do no build yet
 #SUBDIRS       = errno hello hello++ longjmp mutex pthread signal task struct
diff --git a/examples/nxflat/tests/errno/Makefile 
b/examples/nxflat/tests/errno/Makefile
index aae1ef2..a2c488f 100644
--- a/examples/nxflat/tests/errno/Makefile
+++ b/examples/nxflat/tests/errno/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 BIN                    = errno
 
diff --git a/examples/nxflat/tests/hello++/Makefile 
b/examples/nxflat/tests/hello++/Makefile
index 9a1992a..2cbc616 100644
--- a/examples/nxflat/tests/hello++/Makefile
+++ b/examples/nxflat/tests/hello++/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 BIN1                   = hello++1
 BIN2                   = hello++2
diff --git a/examples/nxflat/tests/hello/Makefile 
b/examples/nxflat/tests/hello/Makefile
index f78ebff..85c7bb5 100644
--- a/examples/nxflat/tests/hello/Makefile
+++ b/examples/nxflat/tests/hello/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 BIN                    = hello
 
diff --git a/examples/nxflat/tests/longjmp/Makefile 
b/examples/nxflat/tests/longjmp/Makefile
index 4e94401..f0af746 100644
--- a/examples/nxflat/tests/longjmp/Makefile
+++ b/examples/nxflat/tests/longjmp/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 BIN                    = longjmp
 
diff --git a/examples/nxflat/tests/mutex/Makefile 
b/examples/nxflat/tests/mutex/Makefile
index 63163ac..2afde6d 100644
--- a/examples/nxflat/tests/mutex/Makefile
+++ b/examples/nxflat/tests/mutex/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 BIN                    = mutex
 
diff --git a/examples/nxflat/tests/pthread/Makefile 
b/examples/nxflat/tests/pthread/Makefile
index 08f6140..471df94 100644
--- a/examples/nxflat/tests/pthread/Makefile
+++ b/examples/nxflat/tests/pthread/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs    # Basic make _info
+include $(APPDIR)/Make.defs    # Basic make _info
 
 BIN                    = pthread
 
diff --git a/examples/nxflat/tests/signal/Makefile 
b/examples/nxflat/tests/signal/Makefile
index 8273be7..91b57ec 100644
--- a/examples/nxflat/tests/signal/Makefile
+++ b/examples/nxflat/tests/signal/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 BIN                    = signal
 
diff --git a/examples/nxflat/tests/struct/Makefile 
b/examples/nxflat/tests/struct/Makefile
index b657cff..560d621 100644
--- a/examples/nxflat/tests/struct/Makefile
+++ b/examples/nxflat/tests/struct/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 BIN                    = struct
 
diff --git a/examples/nxflat/tests/task/Makefile 
b/examples/nxflat/tests/task/Makefile
index 8dfb2e1..146aac2 100644
--- a/examples/nxflat/tests/task/Makefile
+++ b/examples/nxflat/tests/task/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 BIN                    = task
 
diff --git a/examples/nxhello/Makefile b/examples/nxhello/Makefile
index 8a69456..faae645 100644
--- a/examples/nxhello/Makefile
+++ b/examples/nxhello/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NuttX NX Graphics Example.
 
diff --git a/examples/nximage/Makefile b/examples/nximage/Makefile
index b51a268..67447ed 100644
--- a/examples/nximage/Makefile
+++ b/examples/nximage/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NuttX NX Graphics Example.
 
diff --git a/examples/nxlines/Makefile b/examples/nxlines/Makefile
index 69e69ca..a374ffa 100644
--- a/examples/nxlines/Makefile
+++ b/examples/nxlines/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NuttX NX Graphics Example.
 
diff --git a/examples/nxterm/Makefile b/examples/nxterm/Makefile
index a0325bc..88ed7ec 100644
--- a/examples/nxterm/Makefile
+++ b/examples/nxterm/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NuttX NX Console Example.
 
diff --git a/examples/nxtext/Makefile b/examples/nxtext/Makefile
index c26dad2..7def5dd 100644
--- a/examples/nxtext/Makefile
+++ b/examples/nxtext/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NuttX NX Graphics Example.
 
diff --git a/examples/obd2/Makefile b/examples/obd2/Makefile
index deaf0f7..34f1a8a 100644
--- a/examples/obd2/Makefile
+++ b/examples/obd2/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # OBD2 application info
 
diff --git a/examples/oneshot/Makefile b/examples/oneshot/Makefile
index 008a6a4..7f80529 100644
--- a/examples/oneshot/Makefile
+++ b/examples/oneshot/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Oneshot timer built-in application info
 
diff --git a/examples/pca9635/Makefile b/examples/pca9635/Makefile
index 047399d..215facb 100644
--- a/examples/pca9635/Makefile
+++ b/examples/pca9635/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # PCA9635 built-in application info
 
diff --git a/examples/pdcurses/Makefile b/examples/pdcurses/Makefile
index e3f2ce1..663015f 100644
--- a/examples/pdcurses/Makefile
+++ b/examples/pdcurses/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # pdcurses demo programs
 
diff --git a/examples/pf_ieee802154/Makefile b/examples/pf_ieee802154/Makefile
index c1e6a1d..005b424 100644
--- a/examples/pf_ieee802154/Makefile
+++ b/examples/pf_ieee802154/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # PF_IEEE802154 Socket Test
 
diff --git a/examples/pipe/Makefile b/examples/pipe/Makefile
index 4c3b73e..e1e0b0a 100644
--- a/examples/pipe/Makefile
+++ b/examples/pipe/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Pipe Example
 
diff --git a/examples/poll/Makefile b/examples/poll/Makefile
index 11057a9..ae08ebd 100644
--- a/examples/poll/Makefile
+++ b/examples/poll/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 CSRCS = poll_listener.c select_listener.c net_listener.c net_reader.c
 MAINSRC = poll_main.c
diff --git a/examples/poll/Makefile.host b/examples/poll/Makefile.host
index 89c01e1..e1d5ed0 100644
--- a/examples/poll/Makefile.host
+++ b/examples/poll/Makefile.host
@@ -35,7 +35,7 @@
 
 # TOPDIR must be defined on the make command line
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 SRC    = host.c
 BIN    = host
diff --git a/examples/popen/Makefile b/examples/popen/Makefile
index 935a3a7..ba3faa9 100644
--- a/examples/popen/Makefile
+++ b/examples/popen/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # popen() built-in application info
 
diff --git a/examples/posix_spawn/Makefile b/examples/posix_spawn/Makefile
index f69d874..eb76777 100644
--- a/examples/posix_spawn/Makefile
+++ b/examples/posix_spawn/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # ELF Example
 
diff --git a/examples/posix_spawn/filesystem/Makefile 
b/examples/posix_spawn/filesystem/Makefile
index 088b373..f07a774 100644
--- a/examples/posix_spawn/filesystem/Makefile
+++ b/examples/posix_spawn/filesystem/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 SPAWN_DIR = $(APPDIR)$(DELIM)examples$(DELIM)posix_spawn
 FILESYSTEM_DIR = $(SPAWN_DIR)$(DELIM)filesystem
diff --git a/examples/posix_spawn/filesystem/hello/Makefile 
b/examples/posix_spawn/filesystem/hello/Makefile
index 2a01bdb..f7a5de3 100644
--- a/examples/posix_spawn/filesystem/hello/Makefile
+++ b/examples/posix_spawn/filesystem/hello/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 BIN = hello
 
diff --git a/examples/posix_spawn/filesystem/redirect/Makefile 
b/examples/posix_spawn/filesystem/redirect/Makefile
index 9862c23..40b8866 100644
--- a/examples/posix_spawn/filesystem/redirect/Makefile
+++ b/examples/posix_spawn/filesystem/redirect/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 BIN = redirect
 
diff --git a/examples/powerled/Makefile b/examples/powerled/Makefile
index 475094d..803a4dc 100644
--- a/examples/powerled/Makefile
+++ b/examples/powerled/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Powerled Example
 
diff --git a/examples/powermonitor/Makefile b/examples/powermonitor/Makefile
index 9203430..fa041d6 100644
--- a/examples/powermonitor/Makefile
+++ b/examples/powermonitor/Makefile
@@ -32,7 +32,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 PROGNAME = powermonitor
 PRIORITY = SCHED_PRIORITY_DEFAULT
diff --git a/examples/pppd/Makefile b/examples/pppd/Makefile
index 8d29476..f1e6949 100644
--- a/examples/pppd/Makefile
+++ b/examples/pppd/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # pppd Example
 
diff --git a/examples/pty_test/Makefile b/examples/pty_test/Makefile
index 1c66823..f3c5252 100644
--- a/examples/pty_test/Makefile
+++ b/examples/pty_test/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Hello, World! built-in application info
 
diff --git a/examples/pwfb/Makefile b/examples/pwfb/Makefile
index 53b47c6..8f96a39 100644
--- a/examples/pwfb/Makefile
+++ b/examples/pwfb/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NuttX per-window frame buffer graphics example.
 
diff --git a/examples/pwlines/Makefile b/examples/pwlines/Makefile
index ff7b4c4..1c5de6d 100644
--- a/examples/pwlines/Makefile
+++ b/examples/pwlines/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NuttX NX Graphics Example.
 
diff --git a/examples/pwm/Makefile b/examples/pwm/Makefile
index 9da2da6..e06171c 100644
--- a/examples/pwm/Makefile
+++ b/examples/pwm/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # PWM Example.
 
diff --git a/examples/qencoder/Makefile b/examples/qencoder/Makefile
index 1575ef3..38fc538 100644
--- a/examples/qencoder/Makefile
+++ b/examples/qencoder/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NuttX NX Graphics Example.
 
diff --git a/examples/random/Makefile b/examples/random/Makefile
index 16888de..04ef1b7 100644
--- a/examples/random/Makefile
+++ b/examples/random/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # /dev/random test
 
diff --git a/examples/relays/Makefile b/examples/relays/Makefile
index ada6d49..befdca4 100644
--- a/examples/relays/Makefile
+++ b/examples/relays/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # relays Example
 
diff --git a/examples/rfid_readuid/Makefile b/examples/rfid_readuid/Makefile
index 069e6c4..1c9d425 100644
--- a/examples/rfid_readuid/Makefile
+++ b/examples/rfid_readuid/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # RFID Read UID built-in application info
 
diff --git a/examples/rgbled/Makefile b/examples/rgbled/Makefile
index 95c3cf3..1ce0440 100644
--- a/examples/rgbled/Makefile
+++ b/examples/rgbled/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # RGBLED built-in application info
 
diff --git a/examples/romfs/Makefile b/examples/romfs/Makefile
index b534ae1..675aed5 100644
--- a/examples/romfs/Makefile
+++ b/examples/romfs/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # ROMFS built-in application info
 
diff --git a/examples/sendmail/Makefile b/examples/sendmail/Makefile
index a3513c1..d305ee3 100644
--- a/examples/sendmail/Makefile
+++ b/examples/sendmail/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Sendmail SMTP Example
 
diff --git a/examples/serialblaster/Makefile b/examples/serialblaster/Makefile
index a4c2a8b..e5ff2c6 100644
--- a/examples/serialblaster/Makefile
+++ b/examples/serialblaster/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # For testing: Blast canned characters at a designated serial port
 
diff --git a/examples/serialrx/Makefile b/examples/serialrx/Makefile
index a332b54..0c7224c 100644
--- a/examples/serialrx/Makefile
+++ b/examples/serialrx/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # For testing: Blast canned characters at a designated serial port
 
diff --git a/examples/serloop/Makefile b/examples/serloop/Makefile
index 121074f..ce3bd7c 100644
--- a/examples/serloop/Makefile
+++ b/examples/serloop/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Mindlessly simple console loopack test
 
diff --git a/examples/slcd/Makefile b/examples/slcd/Makefile
index 98a6b60..b8dabca 100644
--- a/examples/slcd/Makefile
+++ b/examples/slcd/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Hello, World! built-in application info
 
diff --git a/examples/smps/Makefile b/examples/smps/Makefile
index 30ed0e5..785cb30 100644
--- a/examples/smps/Makefile
+++ b/examples/smps/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Smps Example
 
diff --git a/examples/sotest/Makefile b/examples/sotest/Makefile
index cdb46fa..08802a8 100644
--- a/examples/sotest/Makefile
+++ b/examples/sotest/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Shared library example built-in application info
 
diff --git a/examples/sotest/lib/Makefile b/examples/sotest/lib/Makefile
index 8a0117c..4787138 100644
--- a/examples/sotest/lib/Makefile
+++ b/examples/sotest/lib/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 ALL_SUBDIRS = sotest
 BUILD_SUBDIRS = sotest
diff --git a/examples/sotest/lib/modprint/Makefile 
b/examples/sotest/lib/modprint/Makefile
index 000faa0..c4d1d32 100644
--- a/examples/sotest/lib/modprint/Makefile
+++ b/examples/sotest/lib/modprint/Makefile
@@ -33,13 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
-
-ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
-NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
-else
-NUTTXLIB = "$(TOPDIR)$(DELIM)staging"
-endif
+include $(APPDIR)/Make.defs
 
 LDLIBPATH =
 LDLIBS =
diff --git a/examples/sotest/lib/sotest/Makefile 
b/examples/sotest/lib/sotest/Makefile
index d41e14b..31e0208 100644
--- a/examples/sotest/lib/sotest/Makefile
+++ b/examples/sotest/lib/sotest/Makefile
@@ -33,13 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
-
-ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
-NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}"
-else
-NUTTXLIB = "$(TOPDIR)$(DELIM)staging"
-endif
+include $(APPDIR)/Make.defs
 
 LDLIBPATH =
 LDLIBS =
diff --git a/examples/stat/Makefile b/examples/stat/Makefile
index 3101302..e651cce 100644
--- a/examples/stat/Makefile
+++ b/examples/stat/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Stat built-in application info
 
diff --git a/examples/sx127x_demo/Makefile b/examples/sx127x_demo/Makefile
index 43bf5a1..3f843da 100644
--- a/examples/sx127x_demo/Makefile
+++ b/examples/sx127x_demo/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Basic sx127x+  demonstration
 
diff --git a/examples/system/Makefile b/examples/system/Makefile
index b8737eb..9601810 100644
--- a/examples/system/Makefile
+++ b/examples/system/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # system() built-in application info
 
diff --git a/examples/tcpblaster/Makefile b/examples/tcpblaster/Makefile
index f92440a..9419d0c 100644
--- a/examples/tcpblaster/Makefile
+++ b/examples/tcpblaster/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Basic TCP networking test
 
diff --git a/examples/tcpecho/Makefile b/examples/tcpecho/Makefile
index ccf83da..3461ec7 100644
--- a/examples/tcpecho/Makefile
+++ b/examples/tcpecho/Makefile
@@ -36,7 +36,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Discover built-in application info
 
diff --git a/examples/telnetd/Makefile b/examples/telnetd/Makefile
index d868780..81e7467 100644
--- a/examples/telnetd/Makefile
+++ b/examples/telnetd/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Telnetd Example
 
diff --git a/examples/thttpd/Makefile b/examples/thttpd/Makefile
index 46bef17..61faf42 100644
--- a/examples/thttpd/Makefile
+++ b/examples/thttpd/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # THTTPD Web Server Example
 
diff --git a/examples/thttpd/content/Makefile.binfs 
b/examples/thttpd/content/Makefile.binfs
index 7c3d9cd..161751e 100644
--- a/examples/thttpd/content/Makefile.binfs
+++ b/examples/thttpd/content/Makefile.binfs
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 PROGNAME = hello tasks
 PRIORITY = $(CONFIG_THTTPD_CGI_PRIORITY)
diff --git a/examples/thttpd/content/Makefile.nxflat 
b/examples/thttpd/content/Makefile.nxflat
index fc793da..7c23aff 100644
--- a/examples/thttpd/content/Makefile.nxflat
+++ b/examples/thttpd/content/Makefile.nxflat
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 SUBDIRS = hello tasks
 INSTALL_FILES = index.html style.css
diff --git a/examples/thttpd/content/hello/Makefile 
b/examples/thttpd/content/hello/Makefile
index 163b5fa..8f7c18e 100644
--- a/examples/thttpd/content/hello/Makefile
+++ b/examples/thttpd/content/hello/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 BIN = hello
 
diff --git a/examples/thttpd/content/tasks/Makefile 
b/examples/thttpd/content/tasks/Makefile
index b7c7caf..119fe16 100644
--- a/examples/thttpd/content/tasks/Makefile
+++ b/examples/thttpd/content/tasks/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 BIN = tasks
 
diff --git a/examples/tiff/Makefile b/examples/tiff/Makefile
index 6f2ac3e..be27469 100644
--- a/examples/tiff/Makefile
+++ b/examples/tiff/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # TIFF Unit Test
 
diff --git a/examples/timer/Makefile b/examples/timer/Makefile
index a161ff0..cb2b757 100644
--- a/examples/timer/Makefile
+++ b/examples/timer/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Timer built-in application info
 
diff --git a/examples/touchscreen/Makefile b/examples/touchscreen/Makefile
index 60ea21c..f08cf79 100644
--- a/examples/touchscreen/Makefile
+++ b/examples/touchscreen/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NuttX NX Graphics Example.
 
diff --git a/examples/udgram/Makefile b/examples/udgram/Makefile
index 5b97fcc..f0e97f8 100644
--- a/examples/udgram/Makefile
+++ b/examples/udgram/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Basic Unix domain networking test
 
diff --git a/examples/udp/Makefile b/examples/udp/Makefile
index 13ef411..98d0409 100644
--- a/examples/udp/Makefile
+++ b/examples/udp/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # UDP Test
 
diff --git a/examples/udpblaster/Makefile b/examples/udpblaster/Makefile
index 02722d7..d938f2e 100644
--- a/examples/udpblaster/Makefile
+++ b/examples/udpblaster/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Basic TCP networking test
 
diff --git a/examples/uid/Makefile b/examples/uid/Makefile
index e50e8a0..acad1c8 100644
--- a/examples/uid/Makefile
+++ b/examples/uid/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # UID/GID built-in application info
 
diff --git a/examples/unionfs/Makefile b/examples/unionfs/Makefile
index 7a62886..92037a2 100644
--- a/examples/unionfs/Makefile
+++ b/examples/unionfs/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # UNIONFS built-in application info
 
diff --git a/examples/usbserial/Makefile b/examples/usbserial/Makefile
index cbc89bf..c3fc9b1 100644
--- a/examples/usbserial/Makefile
+++ b/examples/usbserial/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # USB serial device example
 # Built-in application info
diff --git a/examples/usbserial/Makefile.host b/examples/usbserial/Makefile.host
index f1603d8..1811741 100644
--- a/examples/usbserial/Makefile.host
+++ b/examples/usbserial/Makefile.host
@@ -35,7 +35,7 @@
 
 # TOPDIR must be defined on the make command line
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 SRC = host.c
 BIN = host$(HOSTEXEEXT)
diff --git a/examples/userfs/Makefile b/examples/userfs/Makefile
index d7e5baf..0e0b9ce 100644
--- a/examples/userfs/Makefile
+++ b/examples/userfs/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # UserFS test application info
 
diff --git a/examples/usrsocktest/Makefile b/examples/usrsocktest/Makefile
index 4aed0d0..aafadf2 100644
--- a/examples/usrsocktest/Makefile
+++ b/examples/usrsocktest/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # USRSOCK Test built-in application info
 
diff --git a/examples/ustream/Makefile b/examples/ustream/Makefile
index eeb2957..e7fa178 100644
--- a/examples/ustream/Makefile
+++ b/examples/ustream/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Basic Unix domain networking test
 
diff --git a/examples/veml6070/Makefile b/examples/veml6070/Makefile
index 7d02749..9f71bc7 100644
--- a/examples/veml6070/Makefile
+++ b/examples/veml6070/Makefile
@@ -35,7 +35,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # VEML6070 UltraViolet sensor example built-in application info
 
diff --git a/examples/watchdog/Makefile b/examples/watchdog/Makefile
index 75ff4ed..367c4ad 100644
--- a/examples/watchdog/Makefile
+++ b/examples/watchdog/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Watchdog Timer Example.
 
diff --git a/examples/webserver/Makefile b/examples/webserver/Makefile
index ab26d1e..a83d01a 100644
--- a/examples/webserver/Makefile
+++ b/examples/webserver/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # uIP very tiny web server example
 
diff --git a/examples/wget/Makefile b/examples/wget/Makefile
index bfd33b0..cc3e241 100644
--- a/examples/wget/Makefile
+++ b/examples/wget/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # wget webclient example
 
diff --git a/examples/wgetjson/Makefile b/examples/wgetjson/Makefile
index b9e5dff..76bf444 100644
--- a/examples/wgetjson/Makefile
+++ b/examples/wgetjson/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Hello, World! Example
 
diff --git a/examples/xbc_test/Makefile b/examples/xbc_test/Makefile
index 035f4fa..651ed8d 100644
--- a/examples/xbc_test/Makefile
+++ b/examples/xbc_test/Makefile
@@ -36,7 +36,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # XBox controller driver test built-in application info
 
diff --git a/examples/xmlrpc/Makefile b/examples/xmlrpc/Makefile
index 4fcc008..7bc5e97 100644
--- a/examples/xmlrpc/Makefile
+++ b/examples/xmlrpc/Makefile
@@ -36,7 +36,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # XML RPC built-in application info
 
diff --git a/examples/zerocross/Makefile b/examples/zerocross/Makefile
index c95dacc..2d325fa 100644
--- a/examples/zerocross/Makefile
+++ b/examples/zerocross/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Zero Cross Example
 
diff --git a/fsutils/flash_eraseall/Makefile b/fsutils/flash_eraseall/Makefile
index 693b6da..0b306cf 100644
--- a/fsutils/flash_eraseall/Makefile
+++ b/fsutils/flash_eraseall/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Password file access library
 
diff --git a/fsutils/inifile/Makefile b/fsutils/inifile/Makefile
index ee55e6d..628c814 100644
--- a/fsutils/inifile/Makefile
+++ b/fsutils/inifile/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # I2C tool
 CSRCS = inifile.c
diff --git a/fsutils/inih/Makefile b/fsutils/inih/Makefile
index 51ddbfa..ac0cfbf 100644
--- a/fsutils/inih/Makefile
+++ b/fsutils/inih/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 WGET = wget
 CP = cp -R
diff --git a/fsutils/mkfatfs/Makefile b/fsutils/mkfatfs/Makefile
index 1f5e5a1..e7029b4 100644
--- a/fsutils/mkfatfs/Makefile
+++ b/fsutils/mkfatfs/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # mkfatfs utility
 
diff --git a/fsutils/mksmartfs/Makefile b/fsutils/mksmartfs/Makefile
index aec927f..ffc337a 100644
--- a/fsutils/mksmartfs/Makefile
+++ b/fsutils/mksmartfs/Makefile
@@ -35,7 +35,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # SmartFS file utility
 
diff --git a/fsutils/passwd/Makefile b/fsutils/passwd/Makefile
index 358ea7e..0efe36c 100644
--- a/fsutils/passwd/Makefile
+++ b/fsutils/passwd/Makefile
@@ -18,7 +18,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Password file access library
 
diff --git a/gpsutils/minmea/Makefile b/gpsutils/minmea/Makefile
index db71a2b..20160b2 100644
--- a/gpsutils/minmea/Makefile
+++ b/gpsutils/minmea/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NSH Library
 
diff --git a/graphics/ft80x/Makefile b/graphics/ft80x/Makefile
index 45a37b8..4a12344 100644
--- a/graphics/ft80x/Makefile
+++ b/graphics/ft80x/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # FTDI/BridgeTek FT80x library
 CSRCS  = ft80x_dl.c ft80x_ramg.c ft80x_ramdl.c ft80x_ramcmd.c
diff --git a/graphics/lvgl/Makefile b/graphics/lvgl/Makefile
index e918f4d..ed6cc8c 100644
--- a/graphics/lvgl/Makefile
+++ b/graphics/lvgl/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # LVGL graphic library
 
diff --git a/graphics/nxglyphs/Makefile b/graphics/nxglyphs/Makefile
index 67c7a98..4613c3c 100644
--- a/graphics/nxglyphs/Makefile
+++ b/graphics/nxglyphs/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 ifeq ($(CONFIG_NXWIDGETS),y)
 # Glyphs used by NxWidgets
diff --git a/graphics/nxwidgets/Makefile b/graphics/nxwidgets/Makefile
index 6df3bbe..a6f3f3a 100644
--- a/graphics/nxwidgets/Makefile
+++ b/graphics/nxwidgets/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Infrastructure
 
diff --git a/graphics/nxwidgets/UnitTests/CButton/Makefile 
b/graphics/nxwidgets/UnitTests/CButton/Makefile
index 7a41d6c..d36fb39 100644
--- a/graphics/nxwidgets/UnitTests/CButton/Makefile
+++ b/graphics/nxwidgets/UnitTests/CButton/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CButton unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CButtonArray/Makefile 
b/graphics/nxwidgets/UnitTests/CButtonArray/Makefile
index 1a78282..adb61a5 100644
--- a/graphics/nxwidgets/UnitTests/CButtonArray/Makefile
+++ b/graphics/nxwidgets/UnitTests/CButtonArray/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CButtonArray unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CCheckBox/Makefile 
b/graphics/nxwidgets/UnitTests/CCheckBox/Makefile
index feaacd4..f798f56 100644
--- a/graphics/nxwidgets/UnitTests/CCheckBox/Makefile
+++ b/graphics/nxwidgets/UnitTests/CCheckBox/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CCheckBox unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CGlyphButton/Makefile 
b/graphics/nxwidgets/UnitTests/CGlyphButton/Makefile
index 18bb25b..ee053f1 100644
--- a/graphics/nxwidgets/UnitTests/CGlyphButton/Makefile
+++ b/graphics/nxwidgets/UnitTests/CGlyphButton/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CGlyphButton unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Makefile 
b/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Makefile
index c7d8519..410d27f 100644
--- a/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Makefile
+++ b/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CGlyphSliderHorizontal unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CImage/Makefile 
b/graphics/nxwidgets/UnitTests/CImage/Makefile
index df33b49..f3a62b3 100644
--- a/graphics/nxwidgets/UnitTests/CImage/Makefile
+++ b/graphics/nxwidgets/UnitTests/CImage/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CImage unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CKeypad/Makefile 
b/graphics/nxwidgets/UnitTests/CKeypad/Makefile
index 65dc71f..7f4b95a 100644
--- a/graphics/nxwidgets/UnitTests/CKeypad/Makefile
+++ b/graphics/nxwidgets/UnitTests/CKeypad/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CKeyPad unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CLabel/Makefile 
b/graphics/nxwidgets/UnitTests/CLabel/Makefile
index 9e3192a..0863420 100644
--- a/graphics/nxwidgets/UnitTests/CLabel/Makefile
+++ b/graphics/nxwidgets/UnitTests/CLabel/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CLabel unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CLatchButton/Makefile 
b/graphics/nxwidgets/UnitTests/CLatchButton/Makefile
index 2dbffc6..d67579f 100644
--- a/graphics/nxwidgets/UnitTests/CLatchButton/Makefile
+++ b/graphics/nxwidgets/UnitTests/CLatchButton/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CLatchButton unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CLatchButtonArray/Makefile 
b/graphics/nxwidgets/UnitTests/CLatchButtonArray/Makefile
index e03da54..b9f843b 100644
--- a/graphics/nxwidgets/UnitTests/CLatchButtonArray/Makefile
+++ b/graphics/nxwidgets/UnitTests/CLatchButtonArray/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CLatchButtonArray unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CListBox/Makefile 
b/graphics/nxwidgets/UnitTests/CListBox/Makefile
index bd9cb32..0b61c29 100644
--- a/graphics/nxwidgets/UnitTests/CListBox/Makefile
+++ b/graphics/nxwidgets/UnitTests/CListBox/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CListBox unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CProgressBar/Makefile 
b/graphics/nxwidgets/UnitTests/CProgressBar/Makefile
index e60eee1..d716ed2 100644
--- a/graphics/nxwidgets/UnitTests/CProgressBar/Makefile
+++ b/graphics/nxwidgets/UnitTests/CProgressBar/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CProgressBar unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CRadioButton/Makefile 
b/graphics/nxwidgets/UnitTests/CRadioButton/Makefile
index bff0308..84d97ab 100644
--- a/graphics/nxwidgets/UnitTests/CRadioButton/Makefile
+++ b/graphics/nxwidgets/UnitTests/CRadioButton/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CRadioButton unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Makefile 
b/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Makefile
index 8e1d6c4..0ca95dd 100644
--- a/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Makefile
+++ b/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CScrollbarHorizontal unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CScrollbarVertical/Makefile 
b/graphics/nxwidgets/UnitTests/CScrollbarVertical/Makefile
index 3b32da8..ad5e765 100644
--- a/graphics/nxwidgets/UnitTests/CScrollbarVertical/Makefile
+++ b/graphics/nxwidgets/UnitTests/CScrollbarVertical/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CScrollbarVertical unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CSliderHorizonal/Makefile 
b/graphics/nxwidgets/UnitTests/CSliderHorizonal/Makefile
index f89c08e..5867191 100644
--- a/graphics/nxwidgets/UnitTests/CSliderHorizonal/Makefile
+++ b/graphics/nxwidgets/UnitTests/CSliderHorizonal/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CSliderHorizontal unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CSliderVertical/Makefile 
b/graphics/nxwidgets/UnitTests/CSliderVertical/Makefile
index f440718..33511a8 100644
--- a/graphics/nxwidgets/UnitTests/CSliderVertical/Makefile
+++ b/graphics/nxwidgets/UnitTests/CSliderVertical/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CSliderVertical unit test
 
diff --git a/graphics/nxwidgets/UnitTests/CTextBox/Makefile 
b/graphics/nxwidgets/UnitTests/CTextBox/Makefile
index b643260..cfa899f 100644
--- a/graphics/nxwidgets/UnitTests/CTextBox/Makefile
+++ b/graphics/nxwidgets/UnitTests/CTextBox/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CTextBox unit test
 
diff --git a/graphics/nxwm/Makefile b/graphics/nxwm/Makefile
index 8826452..3ff6b64 100644
--- a/graphics/nxwm/Makefile
+++ b/graphics/nxwm/Makefile
@@ -33,7 +33,7 @@
 #
 
#################################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 PROGNAME = nxwm
 PRIORITY = SCHED_PRIORITY_DEFAULT
diff --git a/graphics/pdcurs34/Makefile b/graphics/pdcurs34/Makefile
index 7088c03..eee7bde 100644
--- a/graphics/pdcurs34/Makefile
+++ b/graphics/pdcurs34/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # pdcurses Text User Interface
 include pdcurses/Make.defs
diff --git a/graphics/screenshot/Makefile b/graphics/screenshot/Makefile
index bdd7c0e..ef2362d 100644
--- a/graphics/screenshot/Makefile
+++ b/graphics/screenshot/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # TIFF Screenshot utility
 
diff --git a/graphics/slcd/Makefile b/graphics/slcd/Makefile
index 47d688e..72d61c5 100644
--- a/graphics/slcd/Makefile
+++ b/graphics/slcd/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # SLcd
 
diff --git a/graphics/tiff/Makefile b/graphics/tiff/Makefile
index 8a45a59..ec34a83 100644
--- a/graphics/tiff/Makefile
+++ b/graphics/tiff/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NuttX TIFF Creation Tool
 CSRCS = tiff_addstrip.c tiff_finalize.c tiff_initialize.c tiff_utils.c
diff --git a/graphics/twm4nx/Makefile b/graphics/twm4nx/Makefile
index 8458db1..fcd0822 100644
--- a/graphics/twm4nx/Makefile
+++ b/graphics/twm4nx/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Add path to cursor images to CXXFLAGS
 
diff --git a/import/Makefile b/import/Makefile
index 63eb4be..89e115b 100644
--- a/import/Makefile
+++ b/import/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Sub-directories from the NuttX export package
 
diff --git a/industry/abnt_codi/Makefile b/industry/abnt_codi/Makefile
index 8b3a42b..01c803c 100644
--- a/industry/abnt_codi/Makefile
+++ b/industry/abnt_codi/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NSH Library
 
diff --git a/interpreters/bas/Makefile b/interpreters/bas/Makefile
index 2f65019..ac25401 100644
--- a/interpreters/bas/Makefile
+++ b/interpreters/bas/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # BAS Library
 
diff --git a/interpreters/ficl/Makefile b/interpreters/ficl/Makefile
index e9b7926..0dd1fe3 100644
--- a/interpreters/ficl/Makefile
+++ b/interpreters/ficl/Makefile
@@ -35,7 +35,7 @@
 
 BUILDDIR := ${shell echo $(CURDIR) | sed -e 's/ /\\ /g'}
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Tools
 
diff --git a/interpreters/minibasic/Makefile b/interpreters/minibasic/Makefile
index 13c721e..0b848cb 100644
--- a/interpreters/minibasic/Makefile
+++ b/interpreters/minibasic/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Mini Basic Library
 
diff --git a/modbus/Makefile b/modbus/Makefile
index 85e47d9..7fbd02b 100644
--- a/modbus/Makefile
+++ b/modbus/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # FreeModBus Library
 
diff --git a/netutils/chat/Makefile b/netutils/chat/Makefile
index c58ff5c..90a38b7 100644
--- a/netutils/chat/Makefile
+++ b/netutils/chat/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 CSRCS = chat.c
 
diff --git a/netutils/cjson/Makefile b/netutils/cjson/Makefile
index 755f411..68a2ec1 100644
--- a/netutils/cjson/Makefile
+++ b/netutils/cjson/Makefile
@@ -35,7 +35,7 @@
 
 # Standard includes
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Set up build configuration and environment
 
diff --git a/netutils/codecs/Makefile b/netutils/codecs/Makefile
index 551b5b6..e7dac6b 100644
--- a/netutils/codecs/Makefile
+++ b/netutils/codecs/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 CSRCS = urldecode.c base64.c md5.c
 
diff --git a/netutils/dhcpc/Makefile b/netutils/dhcpc/Makefile
index 675e068..66e8ba0 100644
--- a/netutils/dhcpc/Makefile
+++ b/netutils/dhcpc/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # DHCP Client Library
 
diff --git a/netutils/dhcpd/Makefile b/netutils/dhcpd/Makefile
index d88e8d2..b393b32 100644
--- a/netutils/dhcpd/Makefile
+++ b/netutils/dhcpd/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # DHCP Daemn Library
 
diff --git a/netutils/discover/Makefile b/netutils/discover/Makefile
index ccc7a5b..13e07b9 100644
--- a/netutils/discover/Makefile
+++ b/netutils/discover/Makefile
@@ -36,7 +36,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Telnet daemon
 
diff --git a/netutils/esp8266/Makefile b/netutils/esp8266/Makefile
index 2a61fd5..82e531c 100644
--- a/netutils/esp8266/Makefile
+++ b/netutils/esp8266/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # ESP8266 Library
 CSRCS = esp8266.c
diff --git a/netutils/ftpc/Makefile b/netutils/ftpc/Makefile
index 90cf333..2396a35 100644
--- a/netutils/ftpc/Makefile
+++ b/netutils/ftpc/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # DHCP Daemn Library
 
diff --git a/netutils/ftpd/Makefile b/netutils/ftpd/Makefile
index a9e1163..4fa0b6a 100644
--- a/netutils/ftpd/Makefile
+++ b/netutils/ftpd/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Telnet daemon
 
diff --git a/netutils/libcurl4nx/Makefile b/netutils/libcurl4nx/Makefile
index a508e54..448a921 100644
--- a/netutils/libcurl4nx/Makefile
+++ b/netutils/libcurl4nx/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Web client library
 
diff --git a/netutils/netinit/Makefile b/netutils/netinit/Makefile
index 7735e7e..3aa7fcf 100644
--- a/netutils/netinit/Makefile
+++ b/netutils/netinit/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 CSRCS = netinit.c
 
diff --git a/netutils/netlib/Makefile b/netutils/netlib/Makefile
index ee7770d..1bf6bda 100644
--- a/netutils/netlib/Makefile
+++ b/netutils/netlib/Makefile
@@ -34,7 +34,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Network Library
 
diff --git a/netutils/ntpclient/Makefile b/netutils/ntpclient/Makefile
index 72055a7..dc60eb8 100644
--- a/netutils/ntpclient/Makefile
+++ b/netutils/ntpclient/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NTP client daemon Library
 
diff --git a/netutils/ping/Makefile b/netutils/ping/Makefile
index d3d1d25..e4e911d 100644
--- a/netutils/ping/Makefile
+++ b/netutils/ping/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 ifeq ($(CONFIG_NETUTILS_PING),y)
   CSRCS += icmp_ping.c
diff --git a/netutils/pppd/Makefile b/netutils/pppd/Makefile
index 1c93948..cac581d 100644
--- a/netutils/pppd/Makefile
+++ b/netutils/pppd/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 CSRCS = pppd.c ppp.c ahdlc.c lcp.c ipcp.c
 ifeq ($(CONFIG_NETUTILS_PPPD_PAP),y)
diff --git a/netutils/smtp/Makefile b/netutils/smtp/Makefile
index 2a3119f..21e68dc 100644
--- a/netutils/smtp/Makefile
+++ b/netutils/smtp/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # SMTP Library
 
diff --git a/netutils/telnetc/Makefile b/netutils/telnetc/Makefile
index b22709d..71d19f9 100644
--- a/netutils/telnetc/Makefile
+++ b/netutils/telnetc/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Telnet daemon
 
diff --git a/netutils/telnetd/Makefile b/netutils/telnetd/Makefile
index 93aaf8a..8436251 100644
--- a/netutils/telnetd/Makefile
+++ b/netutils/telnetd/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Telnet daemon
 
diff --git a/netutils/tftpc/Makefile b/netutils/tftpc/Makefile
index cf5c209..8d460c5 100644
--- a/netutils/tftpc/Makefile
+++ b/netutils/tftpc/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # TFTP Client Library
 
diff --git a/netutils/thttpd/Makefile b/netutils/thttpd/Makefile
index 998a514..5ae32fb 100644
--- a/netutils/thttpd/Makefile
+++ b/netutils/thttpd/Makefile
@@ -33,7 +33,7 @@
 #
 #############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # THTTPD Library
 
diff --git a/netutils/thttpd/cgi-src/Makefile b/netutils/thttpd/cgi-src/Makefile
index ee5c23e..0f00324 100644
--- a/netutils/thttpd/cgi-src/Makefile
+++ b/netutils/thttpd/cgi-src/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 CFLAGS         += ${shell $(INCDIR) "$(CC)" 
"$(APPDIR)$(DELIM)netutils$(DELIM)thttpd"}
 CGIBINDIR      = $(APPDIR)/netutils/thttpd/cgi-bin
diff --git a/netutils/usrsock_rpmsg/Makefile b/netutils/usrsock_rpmsg/Makefile
index c9d6325..43c76bd 100644
--- a/netutils/usrsock_rpmsg/Makefile
+++ b/netutils/usrsock_rpmsg/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 PROGNAME = usrsock
 PRIORITY = CONFIG_NETUTILS_USRSOCK_RPMSG_PRIORITY
diff --git a/netutils/webclient/Makefile b/netutils/webclient/Makefile
index 38af45d..3d0144a 100644
--- a/netutils/webclient/Makefile
+++ b/netutils/webclient/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Web client library
 
diff --git a/netutils/webserver/Makefile b/netutils/webserver/Makefile
index 00ca847..20153c9 100644
--- a/netutils/webserver/Makefile
+++ b/netutils/webserver/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Web server library
 
diff --git a/netutils/xmlrpc/Makefile b/netutils/xmlrpc/Makefile
index 3a2af53..2df88ad 100644
--- a/netutils/xmlrpc/Makefile
+++ b/netutils/xmlrpc/Makefile
@@ -36,7 +36,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 ifeq ($(CONFIG_NET_TCP),y)
 CSRCS = xmlparser.c response.c
diff --git a/nshlib/Makefile b/nshlib/Makefile
index d310650..9dcaf4f 100644
--- a/nshlib/Makefile
+++ b/nshlib/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NSH Library
 
diff --git a/platform/Makefile b/platform/Makefile
index a0d2a9a..ee692f1 100644
--- a/platform/Makefile
+++ b/platform/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 CONFIG_ARCH_BOARD ?= dummy
 
diff --git a/platform/bin/Makefile b/platform/bin/Makefile
index 79114a0..9500672 100644
--- a/platform/bin/Makefile
+++ b/platform/bin/Makefile
@@ -33,7 +33,7 @@
 #
 ###########################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 all:
 .PHONY: clean distclean
diff --git a/system/cdcacm/Makefile b/system/cdcacm/Makefile
index ee5a894..fdae7de 100644
--- a/system/cdcacm/Makefile
+++ b/system/cdcacm/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # USB CDC/ACM serial mass storage add-on
 
diff --git a/system/cfgdata/Makefile b/system/cfgdata/Makefile
index 37ab3d8..91bb959 100644
--- a/system/cfgdata/Makefile
+++ b/system/cfgdata/Makefile
@@ -38,7 +38,7 @@
 # TODO, this makefile should run make under the app dirs, instead of
 # sourcing the Make.defs!
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # config Application
 
diff --git a/system/cle/Makefile b/system/cle/Makefile
index 6558e26..36ded7e 100644
--- a/system/cle/Makefile
+++ b/system/cle/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # EMACS-like Command Line Editor (CLE)
 CSRCS = cle.c
diff --git a/system/composite/Makefile b/system/composite/Makefile
index d622cf7..4e1289f 100644
--- a/system/composite/Makefile
+++ b/system/composite/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # USB device mass storage add-on
 
diff --git a/system/critmon/Makefile b/system/critmon/Makefile
index f6eac26..c938519 100644
--- a/system/critmon/Makefile
+++ b/system/critmon/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Stack Monitor Application
 
diff --git a/system/cu/Makefile b/system/cu/Makefile
index 6a88cfe..d9d3ace 100644
--- a/system/cu/Makefile
+++ b/system/cu/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 MAINSRC = cu_main.c
 
diff --git a/system/dhcpc/Makefile b/system/dhcpc/Makefile
index 6281f63..66f7145 100644
--- a/system/dhcpc/Makefile
+++ b/system/dhcpc/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # DHCPC address renewal built-in application info
 
diff --git a/system/embedlog/Makefile b/system/embedlog/Makefile
index ad9eefe..ea19905 100644
--- a/system/embedlog/Makefile
+++ b/system/embedlog/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 WGET = wget
 CP = cp -R
diff --git a/system/flash_eraseall/Makefile b/system/flash_eraseall/Makefile
index 3d969b1..cb8a14f 100644
--- a/system/flash_eraseall/Makefile
+++ b/system/flash_eraseall/Makefile
@@ -35,7 +35,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # flash_eraseall Application
 
diff --git a/system/hex2bin/Makefile b/system/hex2bin/Makefile
index 05a91bb..ed98296 100644
--- a/system/hex2bin/Makefile
+++ b/system/hex2bin/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Hex2bin utility
 
diff --git a/system/hexed/Makefile b/system/hexed/Makefile
index 539fb7d..42cadc2 100644
--- a/system/hexed/Makefile
+++ b/system/hexed/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # hexed Application
 
diff --git a/system/i2c/Makefile b/system/i2c/Makefile
index 34cf4b0..2ea5198 100644
--- a/system/i2c/Makefile
+++ b/system/i2c/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # I2C tool
 CSRCS   = i2c_bus.c i2c_common.c i2c_dev.c i2c_get.c i2c_set.c i2c_verf.c
diff --git a/system/lm75/Makefile b/system/lm75/Makefile
index 14138f2..d2e1bf2 100644
--- a/system/lm75/Makefile
+++ b/system/lm75/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # LM-75 Temperature Sensor Application
 
diff --git a/system/lzf/Makefile b/system/lzf/Makefile
index 296a459..7d2c1e5 100644
--- a/system/lzf/Makefile
+++ b/system/lzf/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # LZF built-in application info
 
diff --git a/system/mdio/Makefile b/system/mdio/Makefile
index b4954a4..0b7a8a3 100644
--- a/system/mdio/Makefile
+++ b/system/mdio/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # MDIO tool built-in application info
 
diff --git a/system/netdb/Makefile b/system/netdb/Makefile
index 8507a79..4d9ac5b 100644
--- a/system/netdb/Makefile
+++ b/system/netdb/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # netdb Application
 
diff --git a/system/nsh/Makefile b/system/nsh/Makefile
index 3279b3c..e757be5 100644
--- a/system/nsh/Makefile
+++ b/system/nsh/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NuttShell (NSH) Example
 
diff --git a/system/ntpc/Makefile b/system/ntpc/Makefile
index c64123a..4660204 100644
--- a/system/ntpc/Makefile
+++ b/system/ntpc/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NTPC address renewal built-in application info
 
diff --git a/system/nxplayer/Makefile b/system/nxplayer/Makefile
index 1e4f753..48f93d5 100644
--- a/system/nxplayer/Makefile
+++ b/system/nxplayer/Makefile
@@ -35,7 +35,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NxPlayer Library
 
diff --git a/system/nxrecorder/Makefile b/system/nxrecorder/Makefile
index 5988e66..8fc8850 100644
--- a/system/nxrecorder/Makefile
+++ b/system/nxrecorder/Makefile
@@ -32,7 +32,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NxRecorder Library
 
diff --git a/system/ping/Makefile b/system/ping/Makefile
index 3009b73..ac0f450 100644
--- a/system/ping/Makefile
+++ b/system/ping/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # ICMP ping command
 
diff --git a/system/ping6/Makefile b/system/ping6/Makefile
index 448b56d..7bfe8c2 100644
--- a/system/ping6/Makefile
+++ b/system/ping6/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # ICMP ping6 command
 
diff --git a/system/popen/Makefile b/system/popen/Makefile
index 4b185d6..a845ea0 100644
--- a/system/popen/Makefile
+++ b/system/popen/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # popen()/pclose functions
 
diff --git a/system/psmq/Makefile b/system/psmq/Makefile
index bae3c3d..a104bd4 100644
--- a/system/psmq/Makefile
+++ b/system/psmq/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 WGET = wget
 CP = cp -R
diff --git a/system/ramtest/Makefile b/system/ramtest/Makefile
index 002d6b2..36101b2 100644
--- a/system/ramtest/Makefile
+++ b/system/ramtest/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # RAM test
 
diff --git a/system/readline/Makefile b/system/readline/Makefile
index 824b4aa..e7b7cf0 100644
--- a/system/readline/Makefile
+++ b/system/readline/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # The Readline Library
 
diff --git a/system/sched_note/Makefile b/system/sched_note/Makefile
index 680f24d..60678b6 100644
--- a/system/sched_note/Makefile
+++ b/system/sched_note/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # LED driver test built-in application info
 
diff --git a/system/setlogmask/Makefile b/system/setlogmask/Makefile
index f8eba32..a0b0c13 100644
--- a/system/setlogmask/Makefile
+++ b/system/setlogmask/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # setlogmask command
 
diff --git a/system/spi/Makefile b/system/spi/Makefile
index c352e80..fb2bfc6 100644
--- a/system/spi/Makefile
+++ b/system/spi/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # SPI tool
 
diff --git a/system/stackmonitor/Makefile b/system/stackmonitor/Makefile
index 599aeb1..6b0e370 100644
--- a/system/stackmonitor/Makefile
+++ b/system/stackmonitor/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Stack Monitor Application
 
diff --git a/system/system/Makefile b/system/system/Makefile
index 53e0185..79eda54 100644
--- a/system/system/Makefile
+++ b/system/system/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # system command
 
diff --git a/system/taskset/Makefile b/system/taskset/Makefile
index 94d5ff0..346d444 100644
--- a/system/taskset/Makefile
+++ b/system/taskset/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # taskset command
 
diff --git a/system/tee/Makefile b/system/tee/Makefile
index d03099d..f8153fe 100644
--- a/system/tee/Makefile
+++ b/system/tee/Makefile
@@ -35,7 +35,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # tee command
 
diff --git a/system/telnet/Makefile b/system/telnet/Makefile
index 57398fa..792f0cd 100644
--- a/system/telnet/Makefile
+++ b/system/telnet/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 ifneq ($(CONFIG_SYSTEM_TELNET_CHATD),)
 
diff --git a/system/termcurses/Makefile b/system/termcurses/Makefile
index ed2d61c..45035d6 100644
--- a/system/termcurses/Makefile
+++ b/system/termcurses/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Termcurses terminal emulation library
 
diff --git a/system/ubloxmodem/Makefile b/system/ubloxmodem/Makefile
index 1ae77d6..f254dcb 100644
--- a/system/ubloxmodem/Makefile
+++ b/system/ubloxmodem/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # u-blox modem tool
 
diff --git a/system/usbmsc/Makefile b/system/usbmsc/Makefile
index e24966e..49df8fb 100644
--- a/system/usbmsc/Makefile
+++ b/system/usbmsc/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 PROGNAME = msconn msdis
 PRIORITY = $(CONFIG_SYSTEM_USBMSC_CMD_PRIORITY)
diff --git a/system/vi/Makefile b/system/vi/Makefile
index d9d036a..220f89f 100644
--- a/system/vi/Makefile
+++ b/system/vi/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # VI-Workalike Editor
 
diff --git a/system/zmodem/Makefile b/system/zmodem/Makefile
index 88abdd9..147ec90 100644
--- a/system/zmodem/Makefile
+++ b/system/zmodem/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 PROGNAME = sz rz
 PRIORITY = $(CONFIG_SYSTEM_ZMODEM_PRIORITY)
diff --git a/system/zmodem/Makefile.host b/system/zmodem/Makefile.host
index 3701e18..2f62e32 100644
--- a/system/zmodem/Makefile.host
+++ b/system/zmodem/Makefile.host
@@ -49,7 +49,6 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
 NUTTXINC = $(TOPDIR)/include
diff --git a/testing/cxxtest/Makefile b/testing/cxxtest/Makefile
index a4ebf64..ea2af76 100644
--- a/testing/cxxtest/Makefile
+++ b/testing/cxxtest/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # CXX test program
 
diff --git a/testing/fstest/Makefile b/testing/fstest/Makefile
index cd805e9..87ee7de 100644
--- a/testing/fstest/Makefile
+++ b/testing/fstest/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Generic file system stress test application info
 
diff --git a/testing/getprime/Makefile b/testing/getprime/Makefile
index 0d0a519..ae2e416 100644
--- a/testing/getprime/Makefile
+++ b/testing/getprime/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # getprime built-in application info
 
diff --git a/testing/mm/Makefile b/testing/mm/Makefile
index c416bea..dcc4833 100644
--- a/testing/mm/Makefile
+++ b/testing/mm/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Memory Management Test
 
diff --git a/testing/nxffs/Makefile b/testing/nxffs/Makefile
index 72ecbed..6677721 100644
--- a/testing/nxffs/Makefile
+++ b/testing/nxffs/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # NXFFS file system example
 
diff --git a/testing/ostest/Makefile b/testing/ostest/Makefile
index 8fc1349..32c89ab 100644
--- a/testing/ostest/Makefile
+++ b/testing/ostest/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # ostest built-in application info
 
diff --git a/testing/scanftest/Makefile b/testing/scanftest/Makefile
index 744e5f9..518f7c9 100644
--- a/testing/scanftest/Makefile
+++ b/testing/scanftest/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # scanf() test built-in application info
 
diff --git a/testing/smart/Makefile b/testing/smart/Makefile
index 0bb6928..cdcfbe3 100644
--- a/testing/smart/Makefile
+++ b/testing/smart/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # SMART file system stress test
 
diff --git a/testing/smart_test/Makefile b/testing/smart_test/Makefile
index f13fd21..745d8de 100644
--- a/testing/smart_test/Makefile
+++ b/testing/smart_test/Makefile
@@ -34,7 +34,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # SMART filesystem test tool
 
diff --git a/testing/smp/Makefile b/testing/smp/Makefile
index 58232c3..624442d 100644
--- a/testing/smp/Makefile
+++ b/testing/smp/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # SMP built-in application info
 
diff --git a/testing/unity/Makefile b/testing/unity/Makefile
index a7c4209..964ec4e 100644
--- a/testing/unity/Makefile
+++ b/testing/unity/Makefile
@@ -35,7 +35,7 @@
 
 # Standard includes
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Set up build configuration and environment
 
diff --git a/wireless/bluetooth/btsak/Makefile 
b/wireless/bluetooth/btsak/Makefile
index 302685b..9fef323 100644
--- a/wireless/bluetooth/btsak/Makefile
+++ b/wireless/bluetooth/btsak/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # Bluetooth SAK (swiss army knife )
 
diff --git a/wireless/gs2200m/Makefile b/wireless/gs2200m/Makefile
index 07b515e..258b4f7 100644
--- a/wireless/gs2200m/Makefile
+++ b/wireless/gs2200m/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # gs2200m command
 
diff --git a/wireless/ieee802154/i8sak/Makefile 
b/wireless/ieee802154/i8sak/Makefile
index e8a9e5d..d59e079 100644
--- a/wireless/ieee802154/i8sak/Makefile
+++ b/wireless/ieee802154/i8sak/Makefile
@@ -34,7 +34,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # IEEE 802.15.4  SAK (swiss army knife )
 
diff --git a/wireless/ieee802154/i8shark/Makefile 
b/wireless/ieee802154/i8shark/Makefile
index 8e6036b..76ea4b1 100644
--- a/wireless/ieee802154/i8shark/Makefile
+++ b/wireless/ieee802154/i8shark/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 MAINSRC = i8shark_main.c
 
diff --git a/wireless/ieee802154/libmac/Makefile 
b/wireless/ieee802154/libmac/Makefile
index 63c6e1c..3b01d25 100644
--- a/wireless/ieee802154/libmac/Makefile
+++ b/wireless/ieee802154/libmac/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # libmac source files
 
diff --git a/wireless/ieee802154/libutils/Makefile 
b/wireless/ieee802154/libutils/Makefile
index 3ac7baf..3a2009f 100644
--- a/wireless/ieee802154/libutils/Makefile
+++ b/wireless/ieee802154/libutils/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # libutils source files
 CSRCS += ieee802154_addrtostr.c
diff --git a/wireless/iwpan/Makefile b/wireless/iwpan/Makefile
index e25c211..583c659 100644
--- a/wireless/iwpan/Makefile
+++ b/wireless/iwpan/Makefile
@@ -34,7 +34,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # IEEE802.11 Wapi Application
 
diff --git a/wireless/wapi/Makefile b/wireless/wapi/Makefile
index cc2210e..7ffe65c 100644
--- a/wireless/wapi/Makefile
+++ b/wireless/wapi/Makefile
@@ -33,7 +33,7 @@
 #
 ############################################################################
 
-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
 
 # IEEE802.11 Wapi Application
 

Reply via email to