summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-09-29 15:03:10 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-09-29 15:03:10 -0600
commit35c0ffc36e4ea2cdfdd9e105637b23033ea6df69 (patch)
tree5fc15933966c90a5e70ed8d95af3c37557da93a8
parentbcfbb7a3974dbd00ffb99d146e69eb3e3dc99d57 (diff)
downloadnuttx-35c0ffc36e4ea2cdfdd9e105637b23033ea6df69.tar.gz
nuttx-35c0ffc36e4ea2cdfdd9e105637b23033ea6df69.tar.bz2
nuttx-35c0ffc36e4ea2cdfdd9e105637b23033ea6df69.zip
When creating kernel dependencies, need to define __KERNEL__
-rw-r--r--nuttx/libc/Makefile14
-rw-r--r--nuttx/mm/Makefile12
2 files changed, 24 insertions, 2 deletions
diff --git a/nuttx/libc/Makefile b/nuttx/libc/Makefile
index 72c12863b..2ced86e8c 100644
--- a/nuttx/libc/Makefile
+++ b/nuttx/libc/Makefile
@@ -35,6 +35,18 @@
-include $(TOPDIR)/Make.defs
+# CFLAGS
+
+ifeq ($(CONFIG_NUTTX_KERNEL),y)
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+ KDEFINE = ${shell $(TOPDIR)\tools\define.bat "$(CC)" __KERNEL__}
+else
+ KDEFINE = ${shell $(TOPDIR)/tools/define.sh "$(CC)" __KERNEL__}
+endif
+endif
+
+# Sources and paths
+
ASRCS =
CSRCS =
@@ -107,7 +119,7 @@ endif
.depend: Makefile $(SRCS)
ifeq ($(CONFIG_NUTTX_KERNEL),y)
$(Q) $(MKDEP) --obj-path ubin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make_ubin.dep
- $(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make_kbin.dep
+ $(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) $(KDEFINE) -- $(SRCS) >Make_kbin.dep
else
$(Q) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make_bin.dep
endif
diff --git a/nuttx/mm/Makefile b/nuttx/mm/Makefile
index e47ac183f..efde7a79c 100644
--- a/nuttx/mm/Makefile
+++ b/nuttx/mm/Makefile
@@ -35,6 +35,16 @@
-include $(TOPDIR)/Make.defs
+# CFLAGS
+
+ifeq ($(CONFIG_NUTTX_KERNEL),y)
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+ KDEFINE = ${shell $(TOPDIR)\tools\define.bat "$(CC)" __KERNEL__}
+else
+ KDEFINE = ${shell $(TOPDIR)/tools/define.sh "$(CC)" __KERNEL__}
+endif
+endif
+
# Core allocator logic
ASRCS =
@@ -102,7 +112,7 @@ endif
.depend: Makefile $(SRCS)
ifeq ($(CONFIG_NUTTX_KERNEL),y)
$(Q) $(MKDEP) --obj-path ubin --obj-suffix $(OBJEXT) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make_ubin.dep
- $(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make_kbin.dep
+ $(Q) $(MKDEP) --obj-path kbin --obj-suffix $(OBJEXT) "$(CC)" -- $(CFLAGS) $(KDEFINE) -- $(SRCS) >Make_kbin.dep
else
$(Q) $(MKDEP) --obj-path bin --obj-suffix $(OBJEXT) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make_bin.dep
endif