summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-09-07 07:05:54 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-09-07 07:05:54 -0600
commit5a874f322600b650145dcb55bdf51e66fbf4acef (patch)
tree53ca82ce060bf7a9a219eed794be1c2b4f608340
parent6ba90d01b2bc73b9ffd9a0ca8305f97ed34efb68 (diff)
downloadnuttx-5a874f322600b650145dcb55bdf51e66fbf4acef.tar.gz
nuttx-5a874f322600b650145dcb55bdf51e66fbf4acef.tar.bz2
nuttx-5a874f322600b650145dcb55bdf51e66fbf4acef.zip
If now a kernel build, then add the main object in with all of the rest
-rw-r--r--apps/examples/adc/Makefile4
-rw-r--r--apps/examples/buttons/Makefile4
-rw-r--r--apps/examples/can/Makefile4
-rw-r--r--apps/examples/cc3000/Makefile4
-rw-r--r--apps/examples/configdata/Makefile4
-rw-r--r--apps/examples/cpuhog/Makefile4
-rw-r--r--apps/examples/dhcpd/Makefile4
-rw-r--r--apps/examples/discover/Makefile4
-rw-r--r--apps/examples/elf/Makefile4
-rw-r--r--apps/examples/flash_test/Makefile4
-rw-r--r--apps/examples/ftpc/Makefile4
-rw-r--r--apps/examples/ftpd/Makefile4
-rw-r--r--apps/examples/hidkbd/Makefile4
-rw-r--r--apps/examples/i2schar/Makefile4
-rw-r--r--apps/examples/igmp/Makefile4
-rw-r--r--apps/examples/json/Makefile4
-rw-r--r--apps/examples/keypadtest/Makefile4
-rw-r--r--apps/examples/lcdrw/Makefile4
-rw-r--r--apps/examples/mm/Makefile4
-rw-r--r--apps/examples/modbus/Makefile4
-rw-r--r--apps/examples/mount/Makefile4
-rwxr-xr-xapps/examples/mtdpart/Makefile4
-rw-r--r--apps/examples/netpkt/Makefile4
-rw-r--r--apps/examples/nrf24l01_term/Makefile4
-rw-r--r--apps/examples/nsh/Makefile4
-rw-r--r--apps/examples/null/Makefile4
-rw-r--r--apps/examples/nx/Makefile4
-rw-r--r--apps/examples/nxconsole/Makefile4
-rw-r--r--apps/examples/nxffs/Makefile4
-rw-r--r--apps/examples/nxflat/Makefile4
-rw-r--r--apps/examples/nxhello/Makefile4
-rw-r--r--apps/examples/nximage/Makefile4
-rw-r--r--apps/examples/nxlines/Makefile4
-rw-r--r--apps/examples/nxtext/Makefile4
-rw-r--r--apps/examples/ostest/Makefile4
-rw-r--r--apps/examples/pashello/Makefile4
-rw-r--r--apps/examples/pipe/Makefile4
-rw-r--r--apps/examples/poll/Makefile4
-rw-r--r--apps/examples/posix_spawn/Makefile4
-rw-r--r--apps/examples/pwm/Makefile4
-rw-r--r--apps/examples/qencoder/Makefile4
-rw-r--r--apps/examples/random/Makefile4
-rw-r--r--apps/examples/relays/Makefile4
-rw-r--r--apps/examples/rgmp/Makefile4
-rw-r--r--apps/examples/romfs/Makefile4
-rw-r--r--apps/examples/sendmail/Makefile4
-rw-r--r--apps/examples/serialblaster/Makefile4
-rw-r--r--apps/examples/serialrx/Makefile4
-rw-r--r--apps/examples/serloop/Makefile4
-rw-r--r--apps/examples/slcd/Makefile4
-rw-r--r--apps/examples/smart/Makefile4
-rw-r--r--apps/examples/smart_test/Makefile4
-rw-r--r--apps/examples/tcpecho/Makefile4
-rw-r--r--apps/examples/telnetd/Makefile4
-rw-r--r--apps/examples/thttpd/Makefile4
-rw-r--r--apps/examples/tiff/Makefile4
-rw-r--r--apps/examples/touchscreen/Makefile4
-rw-r--r--apps/examples/usbserial/Makefile4
-rw-r--r--apps/examples/usbterm/Makefile4
-rw-r--r--apps/examples/watchdog/Makefile4
-rw-r--r--apps/examples/webserver/Makefile4
-rw-r--r--apps/examples/wget/Makefile4
-rw-r--r--apps/examples/wgetjson/Makefile4
-rw-r--r--apps/examples/xmlrpc/Makefile4
-rw-r--r--apps/graphics/screenshot/Makefile4
-rw-r--r--apps/netutils/thttpd/Makefile4
-rw-r--r--apps/system/cdcacm/Makefile4
-rw-r--r--apps/system/composite/Makefile4
-rw-r--r--apps/system/flash_eraseall/Makefile4
-rw-r--r--apps/system/free/Makefile4
-rw-r--r--apps/system/hex2bin/Makefile4
-rw-r--r--apps/system/i2c/Makefile4
-rw-r--r--apps/system/install/Makefile4
-rw-r--r--apps/system/mdio/Makefile4
-rw-r--r--apps/system/nxplayer/Makefile4
-rw-r--r--apps/system/poweroff/Makefile4
-rw-r--r--apps/system/prun/Makefile4
-rw-r--r--apps/system/ramtest/Makefile4
-rw-r--r--apps/system/ramtron/Makefile4
-rw-r--r--apps/system/sdcard/Makefile4
-rw-r--r--apps/system/sudoku/Makefile4
-rw-r--r--apps/system/sysinfo/Makefile4
-rw-r--r--apps/system/usbmsc/Makefile4
-rw-r--r--apps/system/vi/Makefile4
-rw-r--r--apps/system/zmodem/Makefile4
85 files changed, 340 insertions, 0 deletions
diff --git a/apps/examples/adc/Makefile b/apps/examples/adc/Makefile
index 475d94be9..78339fc3b 100644
--- a/apps/examples/adc/Makefile
+++ b/apps/examples/adc/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/buttons/Makefile b/apps/examples/buttons/Makefile
index 9af24472a..48be3f412 100644
--- a/apps/examples/buttons/Makefile
+++ b/apps/examples/buttons/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/can/Makefile b/apps/examples/can/Makefile
index 59e9e4359..16431147e 100644
--- a/apps/examples/can/Makefile
+++ b/apps/examples/can/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/cc3000/Makefile b/apps/examples/cc3000/Makefile
index c98f14894..b70a78566 100644
--- a/apps/examples/cc3000/Makefile
+++ b/apps/examples/cc3000/Makefile
@@ -58,6 +58,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/configdata/Makefile b/apps/examples/configdata/Makefile
index a2083657b..3d87b6a77 100644
--- a/apps/examples/configdata/Makefile
+++ b/apps/examples/configdata/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/cpuhog/Makefile b/apps/examples/cpuhog/Makefile
index 429a9b3e6..9d62b031a 100644
--- a/apps/examples/cpuhog/Makefile
+++ b/apps/examples/cpuhog/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/dhcpd/Makefile b/apps/examples/dhcpd/Makefile
index e7fe4fa3e..459472f95 100644
--- a/apps/examples/dhcpd/Makefile
+++ b/apps/examples/dhcpd/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/discover/Makefile b/apps/examples/discover/Makefile
index 8d355e6cf..fdc16793d 100644
--- a/apps/examples/discover/Makefile
+++ b/apps/examples/discover/Makefile
@@ -55,6 +55,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/elf/Makefile b/apps/examples/elf/Makefile
index ed64e72df..e06b000d4 100644
--- a/apps/examples/elf/Makefile
+++ b/apps/examples/elf/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/flash_test/Makefile b/apps/examples/flash_test/Makefile
index 22fa1c1ce..aa4d79cc9 100644
--- a/apps/examples/flash_test/Makefile
+++ b/apps/examples/flash_test/Makefile
@@ -57,6 +57,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/ftpc/Makefile b/apps/examples/ftpc/Makefile
index 0a53098f8..48355cbca 100644
--- a/apps/examples/ftpc/Makefile
+++ b/apps/examples/ftpc/Makefile
@@ -52,6 +52,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/ftpd/Makefile b/apps/examples/ftpd/Makefile
index d98d5960b..89fe250f4 100644
--- a/apps/examples/ftpd/Makefile
+++ b/apps/examples/ftpd/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/hidkbd/Makefile b/apps/examples/hidkbd/Makefile
index b677ee12a..14572e491 100644
--- a/apps/examples/hidkbd/Makefile
+++ b/apps/examples/hidkbd/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/i2schar/Makefile b/apps/examples/i2schar/Makefile
index 246afb34b..bc074140c 100644
--- a/apps/examples/i2schar/Makefile
+++ b/apps/examples/i2schar/Makefile
@@ -54,6 +54,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/igmp/Makefile b/apps/examples/igmp/Makefile
index 39c24b4b2..06a64b58b 100644
--- a/apps/examples/igmp/Makefile
+++ b/apps/examples/igmp/Makefile
@@ -52,6 +52,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/json/Makefile b/apps/examples/json/Makefile
index 107e988c4..694996822 100644
--- a/apps/examples/json/Makefile
+++ b/apps/examples/json/Makefile
@@ -52,6 +52,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/keypadtest/Makefile b/apps/examples/keypadtest/Makefile
index 71616bab1..2be10a295 100644
--- a/apps/examples/keypadtest/Makefile
+++ b/apps/examples/keypadtest/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/lcdrw/Makefile b/apps/examples/lcdrw/Makefile
index c5d3cd455..76f0e44aa 100644
--- a/apps/examples/lcdrw/Makefile
+++ b/apps/examples/lcdrw/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/mm/Makefile b/apps/examples/mm/Makefile
index dc06e6d14..15f0aa476 100644
--- a/apps/examples/mm/Makefile
+++ b/apps/examples/mm/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/modbus/Makefile b/apps/examples/modbus/Makefile
index 93e39f2e0..79a5b2724 100644
--- a/apps/examples/modbus/Makefile
+++ b/apps/examples/modbus/Makefile
@@ -54,6 +54,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/mount/Makefile b/apps/examples/mount/Makefile
index 3c6e553e4..4b7a3cab4 100644
--- a/apps/examples/mount/Makefile
+++ b/apps/examples/mount/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/mtdpart/Makefile b/apps/examples/mtdpart/Makefile
index 62427c77d..d285aa03e 100755
--- a/apps/examples/mtdpart/Makefile
+++ b/apps/examples/mtdpart/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/netpkt/Makefile b/apps/examples/netpkt/Makefile
index 86602a22f..3f5e6f484 100644
--- a/apps/examples/netpkt/Makefile
+++ b/apps/examples/netpkt/Makefile
@@ -54,6 +54,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/nrf24l01_term/Makefile b/apps/examples/nrf24l01_term/Makefile
index 2dc0fe4a0..2650ca853 100644
--- a/apps/examples/nrf24l01_term/Makefile
+++ b/apps/examples/nrf24l01_term/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/nsh/Makefile b/apps/examples/nsh/Makefile
index e5aac3037..2a2b028b4 100644
--- a/apps/examples/nsh/Makefile
+++ b/apps/examples/nsh/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/null/Makefile b/apps/examples/null/Makefile
index 20db85711..49c8b8ae8 100644
--- a/apps/examples/null/Makefile
+++ b/apps/examples/null/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/nx/Makefile b/apps/examples/nx/Makefile
index 124336d95..0141bd477 100644
--- a/apps/examples/nx/Makefile
+++ b/apps/examples/nx/Makefile
@@ -51,6 +51,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/nxconsole/Makefile b/apps/examples/nxconsole/Makefile
index 1107e3a87..d5da3ef59 100644
--- a/apps/examples/nxconsole/Makefile
+++ b/apps/examples/nxconsole/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/nxffs/Makefile b/apps/examples/nxffs/Makefile
index 2ed244f6b..fd26a020c 100644
--- a/apps/examples/nxffs/Makefile
+++ b/apps/examples/nxffs/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/nxflat/Makefile b/apps/examples/nxflat/Makefile
index 003865051..fd7dbdb31 100644
--- a/apps/examples/nxflat/Makefile
+++ b/apps/examples/nxflat/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/nxhello/Makefile b/apps/examples/nxhello/Makefile
index 4792e301e..cc9ae4218 100644
--- a/apps/examples/nxhello/Makefile
+++ b/apps/examples/nxhello/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/nximage/Makefile b/apps/examples/nximage/Makefile
index c31ed1954..e2cffcd4b 100644
--- a/apps/examples/nximage/Makefile
+++ b/apps/examples/nximage/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/nxlines/Makefile b/apps/examples/nxlines/Makefile
index 58271ccf4..ed8d12867 100644
--- a/apps/examples/nxlines/Makefile
+++ b/apps/examples/nxlines/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/nxtext/Makefile b/apps/examples/nxtext/Makefile
index 596254bbf..4fba1e576 100644
--- a/apps/examples/nxtext/Makefile
+++ b/apps/examples/nxtext/Makefile
@@ -52,6 +52,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/ostest/Makefile b/apps/examples/ostest/Makefile
index c3d4d474c..b35baf5a0 100644
--- a/apps/examples/ostest/Makefile
+++ b/apps/examples/ostest/Makefile
@@ -103,6 +103,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/pashello/Makefile b/apps/examples/pashello/Makefile
index 9cddd5709..95e61671e 100644
--- a/apps/examples/pashello/Makefile
+++ b/apps/examples/pashello/Makefile
@@ -56,6 +56,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/pipe/Makefile b/apps/examples/pipe/Makefile
index 611babf84..773c08e08 100644
--- a/apps/examples/pipe/Makefile
+++ b/apps/examples/pipe/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/poll/Makefile b/apps/examples/poll/Makefile
index 4d7b600b4..f27607c58 100644
--- a/apps/examples/poll/Makefile
+++ b/apps/examples/poll/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/posix_spawn/Makefile b/apps/examples/posix_spawn/Makefile
index fe671ea63..1a88a19e4 100644
--- a/apps/examples/posix_spawn/Makefile
+++ b/apps/examples/posix_spawn/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/pwm/Makefile b/apps/examples/pwm/Makefile
index bb209689c..7a18a2a5c 100644
--- a/apps/examples/pwm/Makefile
+++ b/apps/examples/pwm/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/qencoder/Makefile b/apps/examples/qencoder/Makefile
index 371c13938..7b3ca9be8 100644
--- a/apps/examples/qencoder/Makefile
+++ b/apps/examples/qencoder/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/random/Makefile b/apps/examples/random/Makefile
index 01a8171ae..8cad5fd5a 100644
--- a/apps/examples/random/Makefile
+++ b/apps/examples/random/Makefile
@@ -52,6 +52,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/relays/Makefile b/apps/examples/relays/Makefile
index 2fb6d71a2..3a3049f67 100644
--- a/apps/examples/relays/Makefile
+++ b/apps/examples/relays/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/rgmp/Makefile b/apps/examples/rgmp/Makefile
index a58849b4a..007625df1 100644
--- a/apps/examples/rgmp/Makefile
+++ b/apps/examples/rgmp/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/romfs/Makefile b/apps/examples/romfs/Makefile
index b7934312e..20fb60d11 100644
--- a/apps/examples/romfs/Makefile
+++ b/apps/examples/romfs/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/sendmail/Makefile b/apps/examples/sendmail/Makefile
index 6bc702763..03e536927 100644
--- a/apps/examples/sendmail/Makefile
+++ b/apps/examples/sendmail/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/serialblaster/Makefile b/apps/examples/serialblaster/Makefile
index ecb9f7376..2324035f8 100644
--- a/apps/examples/serialblaster/Makefile
+++ b/apps/examples/serialblaster/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/serialrx/Makefile b/apps/examples/serialrx/Makefile
index 9d2026ad8..c4f1d33f5 100644
--- a/apps/examples/serialrx/Makefile
+++ b/apps/examples/serialrx/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/serloop/Makefile b/apps/examples/serloop/Makefile
index 6ef6b5605..d0a527cba 100644
--- a/apps/examples/serloop/Makefile
+++ b/apps/examples/serloop/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/slcd/Makefile b/apps/examples/slcd/Makefile
index 4a633c8ea..17e7fbd79 100644
--- a/apps/examples/slcd/Makefile
+++ b/apps/examples/slcd/Makefile
@@ -54,6 +54,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/smart/Makefile b/apps/examples/smart/Makefile
index 250d0066e..84c57d66a 100644
--- a/apps/examples/smart/Makefile
+++ b/apps/examples/smart/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/smart_test/Makefile b/apps/examples/smart_test/Makefile
index a821948df..ab31ff0ef 100644
--- a/apps/examples/smart_test/Makefile
+++ b/apps/examples/smart_test/Makefile
@@ -57,6 +57,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/tcpecho/Makefile b/apps/examples/tcpecho/Makefile
index 01975fd02..065d24ef3 100644
--- a/apps/examples/tcpecho/Makefile
+++ b/apps/examples/tcpecho/Makefile
@@ -55,6 +55,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/telnetd/Makefile b/apps/examples/telnetd/Makefile
index e54f163f6..b8fc6f364 100644
--- a/apps/examples/telnetd/Makefile
+++ b/apps/examples/telnetd/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/thttpd/Makefile b/apps/examples/thttpd/Makefile
index af6bf5378..31cd824eb 100644
--- a/apps/examples/thttpd/Makefile
+++ b/apps/examples/thttpd/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/tiff/Makefile b/apps/examples/tiff/Makefile
index e31883c13..197b6f3cb 100644
--- a/apps/examples/tiff/Makefile
+++ b/apps/examples/tiff/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/touchscreen/Makefile b/apps/examples/touchscreen/Makefile
index 5f0aa49e2..f21de8636 100644
--- a/apps/examples/touchscreen/Makefile
+++ b/apps/examples/touchscreen/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/usbserial/Makefile b/apps/examples/usbserial/Makefile
index 84ec60ea5..247e9235c 100644
--- a/apps/examples/usbserial/Makefile
+++ b/apps/examples/usbserial/Makefile
@@ -47,6 +47,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/usbterm/Makefile b/apps/examples/usbterm/Makefile
index 07b1f1f8a..1c68a4377 100644
--- a/apps/examples/usbterm/Makefile
+++ b/apps/examples/usbterm/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/watchdog/Makefile b/apps/examples/watchdog/Makefile
index 97ebdb8fc..1d6a7c853 100644
--- a/apps/examples/watchdog/Makefile
+++ b/apps/examples/watchdog/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/webserver/Makefile b/apps/examples/webserver/Makefile
index 87217f38f..3026f4c18 100644
--- a/apps/examples/webserver/Makefile
+++ b/apps/examples/webserver/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/wget/Makefile b/apps/examples/wget/Makefile
index 9636b6e5a..d49e7547c 100644
--- a/apps/examples/wget/Makefile
+++ b/apps/examples/wget/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/wgetjson/Makefile b/apps/examples/wgetjson/Makefile
index 46c457aa5..b0716c679 100644
--- a/apps/examples/wgetjson/Makefile
+++ b/apps/examples/wgetjson/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/examples/xmlrpc/Makefile b/apps/examples/xmlrpc/Makefile
index 57fd3552f..c9e116a90 100644
--- a/apps/examples/xmlrpc/Makefile
+++ b/apps/examples/xmlrpc/Makefile
@@ -55,6 +55,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/graphics/screenshot/Makefile b/apps/graphics/screenshot/Makefile
index 4786df1e4..7b1aaa551 100644
--- a/apps/graphics/screenshot/Makefile
+++ b/apps/graphics/screenshot/Makefile
@@ -52,6 +52,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/netutils/thttpd/Makefile b/apps/netutils/thttpd/Makefile
index 62d0c83b4..9d2337aea 100644
--- a/apps/netutils/thttpd/Makefile
+++ b/apps/netutils/thttpd/Makefile
@@ -52,6 +52,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/cdcacm/Makefile b/apps/system/cdcacm/Makefile
index 8084c4880..c76dc278b 100644
--- a/apps/system/cdcacm/Makefile
+++ b/apps/system/cdcacm/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/composite/Makefile b/apps/system/composite/Makefile
index 6edc5f403..093416b8a 100644
--- a/apps/system/composite/Makefile
+++ b/apps/system/composite/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/flash_eraseall/Makefile b/apps/system/flash_eraseall/Makefile
index 40d0dc43b..5234d8c30 100644
--- a/apps/system/flash_eraseall/Makefile
+++ b/apps/system/flash_eraseall/Makefile
@@ -62,6 +62,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/free/Makefile b/apps/system/free/Makefile
index 9f1edf527..7697e6c3d 100644
--- a/apps/system/free/Makefile
+++ b/apps/system/free/Makefile
@@ -58,6 +58,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/hex2bin/Makefile b/apps/system/hex2bin/Makefile
index d77768778..674434fd1 100644
--- a/apps/system/hex2bin/Makefile
+++ b/apps/system/hex2bin/Makefile
@@ -56,6 +56,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/i2c/Makefile b/apps/system/i2c/Makefile
index a72713298..520248789 100644
--- a/apps/system/i2c/Makefile
+++ b/apps/system/i2c/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/install/Makefile b/apps/system/install/Makefile
index f664f21a1..ccf241f1e 100644
--- a/apps/system/install/Makefile
+++ b/apps/system/install/Makefile
@@ -62,6 +62,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/mdio/Makefile b/apps/system/mdio/Makefile
index 4352a5b57..b22abf159 100644
--- a/apps/system/mdio/Makefile
+++ b/apps/system/mdio/Makefile
@@ -54,6 +54,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/nxplayer/Makefile b/apps/system/nxplayer/Makefile
index 110319a78..8bbb0523e 100644
--- a/apps/system/nxplayer/Makefile
+++ b/apps/system/nxplayer/Makefile
@@ -64,6 +64,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/poweroff/Makefile b/apps/system/poweroff/Makefile
index cd1dc7d81..f1aca05c5 100644
--- a/apps/system/poweroff/Makefile
+++ b/apps/system/poweroff/Makefile
@@ -62,6 +62,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/prun/Makefile b/apps/system/prun/Makefile
index 48ba233f4..34bf1eec3 100644
--- a/apps/system/prun/Makefile
+++ b/apps/system/prun/Makefile
@@ -68,6 +68,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/ramtest/Makefile b/apps/system/ramtest/Makefile
index b7ef04b39..01f2a96f4 100644
--- a/apps/system/ramtest/Makefile
+++ b/apps/system/ramtest/Makefile
@@ -55,6 +55,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/ramtron/Makefile b/apps/system/ramtron/Makefile
index ad0579138..1ae263a48 100644
--- a/apps/system/ramtron/Makefile
+++ b/apps/system/ramtron/Makefile
@@ -62,6 +62,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/sdcard/Makefile b/apps/system/sdcard/Makefile
index 961cd54a5..c5e0da4fa 100644
--- a/apps/system/sdcard/Makefile
+++ b/apps/system/sdcard/Makefile
@@ -62,6 +62,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/sudoku/Makefile b/apps/system/sudoku/Makefile
index 6cca9af4d..f1bd2cafc 100644
--- a/apps/system/sudoku/Makefile
+++ b/apps/system/sudoku/Makefile
@@ -58,6 +58,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/sysinfo/Makefile b/apps/system/sysinfo/Makefile
index ef5c6ca34..fbac32a7c 100644
--- a/apps/system/sysinfo/Makefile
+++ b/apps/system/sysinfo/Makefile
@@ -63,6 +63,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/usbmsc/Makefile b/apps/system/usbmsc/Makefile
index 2f62907cf..86ad32fd7 100644
--- a/apps/system/usbmsc/Makefile
+++ b/apps/system/usbmsc/Makefile
@@ -48,6 +48,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/vi/Makefile b/apps/system/vi/Makefile
index eb1b10c69..8e4c7c146 100644
--- a/apps/system/vi/Makefile
+++ b/apps/system/vi/Makefile
@@ -59,6 +59,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
diff --git a/apps/system/zmodem/Makefile b/apps/system/zmodem/Makefile
index f544bf309..297f91b48 100644
--- a/apps/system/zmodem/Makefile
+++ b/apps/system/zmodem/Makefile
@@ -58,6 +58,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ OBJS += $(MAINOBJ)
+endif
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else