summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-11-13 20:24:30 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-11-13 20:24:30 +0000
commita0ebf07c2fc6e680fc440d52a0e477682cd641b7 (patch)
tree5cb43aa040cf2be867ecc2af6614546eeebdde66 /nuttx
parentc2325703f1ba2889eff8ad2ef43fb38c958931d7 (diff)
downloadpx4-nuttx-a0ebf07c2fc6e680fc440d52a0e477682cd641b7.tar.gz
px4-nuttx-a0ebf07c2fc6e680fc440d52a0e477682cd641b7.tar.bz2
px4-nuttx-a0ebf07c2fc6e680fc440d52a0e477682cd641b7.zip
Centralized the definition of the INCDIR script in tools/Config.mk
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5346 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/ChangeLog3
-rw-r--r--nuttx/binfmt/Makefile2
-rw-r--r--nuttx/configs/stm32f4discovery/winbuild/Make.defs2
-rw-r--r--nuttx/drivers/analog/Make.defs6
-rw-r--r--nuttx/drivers/bch/Make.defs4
-rw-r--r--nuttx/drivers/input/Make.defs4
-rw-r--r--nuttx/drivers/lcd/Make.defs2
-rw-r--r--nuttx/drivers/mmcsd/Make.defs4
-rw-r--r--nuttx/drivers/power/Make.defs4
-rw-r--r--nuttx/drivers/sensors/Make.defs4
-rw-r--r--nuttx/drivers/usbdev/Make.defs2
-rw-r--r--nuttx/drivers/usbhost/Make.defs4
-rw-r--r--nuttx/drivers/wireless/Make.defs4
-rw-r--r--nuttx/graphics/Makefile14
-rw-r--r--nuttx/tools/Config.mk81
-rw-r--r--nuttx/tools/Makefile.host7
-rw-r--r--nuttx/tools/README.txt39
-rw-r--r--nuttx/tools/mkdeps.c69
18 files changed, 223 insertions, 32 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 0f92fdf7a..31700214f 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -3613,3 +3613,6 @@
critical CFLAG values that cannot be passed on the CMD.exe command line
(line '='). mkdeps.c is a work in progress that will, hopefully,
replace both mkdeps.sh and mkdeps.bat.
+ * tools/Config.mk: Centralize the definition of the scrpt that will be
+ used to generated header file include paths for the compiler. This
+ needs to be centralized in order to support the Windows native build.
diff --git a/nuttx/binfmt/Makefile b/nuttx/binfmt/Makefile
index 365997be8..378a737f6 100644
--- a/nuttx/binfmt/Makefile
+++ b/nuttx/binfmt/Makefile
@@ -38,7 +38,7 @@
ifeq ($(WINTOOL),y)
INCDIROPT = -w
endif
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/sched}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/sched}
# Basic BINFMT source files
diff --git a/nuttx/configs/stm32f4discovery/winbuild/Make.defs b/nuttx/configs/stm32f4discovery/winbuild/Make.defs
index 75051da51..28cf8a561 100644
--- a/nuttx/configs/stm32f4discovery/winbuild/Make.defs
+++ b/nuttx/configs/stm32f4discovery/winbuild/Make.defs
@@ -130,7 +130,7 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
endif
-HOSTCC = mingw-gcc.exe
+HOSTCC = mingw32-gcc.exe
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
diff --git a/nuttx/drivers/analog/Make.defs b/nuttx/drivers/analog/Make.defs
index d94e39758..425193f7e 100644
--- a/nuttx/drivers/analog/Make.defs
+++ b/nuttx/drivers/analog/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# drivers/analog/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -76,12 +76,12 @@ endif
ifeq ($(CONFIG_DAC),y)
DEPPATH += --dep-path analog
VPATH += :analog
- CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/analog}
+ CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/analog}
else
ifeq ($(CONFIG_ADC),y)
DEPPATH += --dep-path analog
VPATH += :analog
- CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/analog}
+ CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/analog}
endif
endif
diff --git a/nuttx/drivers/bch/Make.defs b/nuttx/drivers/bch/Make.defs
index bc22df8e2..2745fcfff 100644
--- a/nuttx/drivers/bch/Make.defs
+++ b/nuttx/drivers/bch/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# drivers/bch/Make.defs
#
-# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,7 @@ CSRCS += bchlib_setup.c bchlib_teardown.c bchlib_read.c bchlib_write.c \
DEPPATH += --dep-path bch
VPATH += :bch
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/bch}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/bch}
endif
endif
diff --git a/nuttx/drivers/input/Make.defs b/nuttx/drivers/input/Make.defs
index 8b009760c..8afd76f89 100644
--- a/nuttx/drivers/input/Make.defs
+++ b/nuttx/drivers/input/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# drivers/input/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -71,6 +71,6 @@ endif
DEPPATH += --dep-path input
VPATH += :input
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/input}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/input}
endif
diff --git a/nuttx/drivers/lcd/Make.defs b/nuttx/drivers/lcd/Make.defs
index 575751d39..8b6d30052 100644
--- a/nuttx/drivers/lcd/Make.defs
+++ b/nuttx/drivers/lcd/Make.defs
@@ -67,6 +67,6 @@ endif
DEPPATH += --dep-path lcd
VPATH += :lcd
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/lcd}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/lcd}
endif
diff --git a/nuttx/drivers/mmcsd/Make.defs b/nuttx/drivers/mmcsd/Make.defs
index 410da741b..0ba5efb7f 100644
--- a/nuttx/drivers/mmcsd/Make.defs
+++ b/nuttx/drivers/mmcsd/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# drivers/mmcsd/Make.defs
#
-# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,7 @@ endif
DEPPATH += --dep-path mmcsd
VPATH += :mmcsd
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/mmcsd}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/mmcsd}
endif
diff --git a/nuttx/drivers/power/Make.defs b/nuttx/drivers/power/Make.defs
index 45c6aebc3..9e6307ae2 100644
--- a/nuttx/drivers/power/Make.defs
+++ b/nuttx/drivers/power/Make.defs
@@ -47,7 +47,7 @@ CSRCS += pm_activity.c pm_changestate.c pm_checkstate.c pm_initialize.c pm_regis
POWER_DEPPATH := --dep-path power
POWER_VPATH := :power
-POWER_CFLAGS := ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/power}
+POWER_CFLAGS := ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/power}
endif
@@ -73,7 +73,7 @@ endif
POWER_DEPPATH := --dep-path power
POWER_VPATH := :power
-POWER_CFLAGS := ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/power}
+POWER_CFLAGS := ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/power}
endif
diff --git a/nuttx/drivers/sensors/Make.defs b/nuttx/drivers/sensors/Make.defs
index 866ccb053..17750831e 100644
--- a/nuttx/drivers/sensors/Make.defs
+++ b/nuttx/drivers/sensors/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# drivers/sensors/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -57,4 +57,4 @@ endif
DEPPATH += --dep-path sensors
VPATH += :sensors
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/sensors}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/sensors}
diff --git a/nuttx/drivers/usbdev/Make.defs b/nuttx/drivers/usbdev/Make.defs
index f1b3c405a..782c18545 100644
--- a/nuttx/drivers/usbdev/Make.defs
+++ b/nuttx/drivers/usbdev/Make.defs
@@ -59,5 +59,5 @@ CSRCS += usbdev_trace.c usbdev_trprintf.c
DEPPATH += --dep-path usbdev
VPATH += :usbdev
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/usbdev}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/usbdev}
endif
diff --git a/nuttx/drivers/usbhost/Make.defs b/nuttx/drivers/usbhost/Make.defs
index fd54ab53e..91753ef31 100644
--- a/nuttx/drivers/usbhost/Make.defs
+++ b/nuttx/drivers/usbhost/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# drivers/usbhost/Make.defs
#
-# Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2010-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -54,4 +54,4 @@ endif
DEPPATH += --dep-path usbhost
VPATH += :usbhost
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/usbhost}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/usbhost}
diff --git a/nuttx/drivers/wireless/Make.defs b/nuttx/drivers/wireless/Make.defs
index f47f7666a..86ea90e25 100644
--- a/nuttx/drivers/wireless/Make.defs
+++ b/nuttx/drivers/wireless/Make.defs
@@ -1,7 +1,7 @@
############################################################################
# drivers/wireless/Make.defs
#
-# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -43,5 +43,5 @@ CSRCS += cc1101.c ISM1_868MHzGFSK100kbps.c ISM2_905MHzGFSK250kbps.c
DEPPATH += --dep-path wireless/cc1101
VPATH += :wireless/cc1101
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/wireless/cc1101}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/drivers/wireless/cc1101}
endif
diff --git a/nuttx/graphics/Makefile b/nuttx/graphics/Makefile
index f638587ba..09d7cfa26 100644
--- a/nuttx/graphics/Makefile
+++ b/nuttx/graphics/Makefile
@@ -44,34 +44,34 @@ endif
include nxglib/Make.defs
DEPPATH += --dep-path nxglib
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxglib}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxglib}
include nxbe/Make.defs
DEPPATH += --dep-path nxbe
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxbe}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxbe}
ifeq ($(CONFIG_NX_MULTIUSER),y)
include nxmu/Make.defs
DEPPATH += --dep-path nxmu
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxmu}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxmu}
else
include nxsu/Make.defs
DEPPATH += --dep-path nxsu
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxsu}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxsu}
endif
include nxtk/Make.defs
DEPPATH += --dep-path nxtk
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxtk}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxtk}
include nxfonts/Make.defs
DEPPATH += --dep-path nxfonts
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxfonts}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxfonts}
ifeq ($(CONFIG_NXCONSOLE),y)
include nxconsole/Make.defs
DEPPATH += --dep-path nxconsole
-CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxconsole}
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)/graphics/nxconsole}
endif
ASRCS = $(NXGLIB_ASRCS) $(NXBE_ASRCS) $(NX_ASRCS) $(NXTK_ASRCS) $(NXFONTS_ASRCS) $(NXCON_ASRCS)
diff --git a/nuttx/tools/Config.mk b/nuttx/tools/Config.mk
index 06a312fc5..3a0714c10 100644
--- a/nuttx/tools/Config.mk
+++ b/nuttx/tools/Config.mk
@@ -4,6 +4,9 @@
#
# Author: Richard Cochran
#
+# This file (along with $(TOPDIR)/.config) must be included by every
+# configuration-specific Make.defs file.
+#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
@@ -40,28 +43,104 @@ CONFIG_ARCH := $(patsubst "%",%,$(strip $(CONFIG_ARCH)))
CONFIG_ARCH_CHIP := $(patsubst "%",%,$(strip $(CONFIG_ARCH_CHIP)))
CONFIG_ARCH_BOARD := $(patsubst "%",%,$(strip $(CONFIG_ARCH_BOARD)))
-# Default build rules.
+# INCDIR - Convert a list of directory paths to a list of compiler include
+# directirves
+# Example: CFFLAGS += ${shell $(INCDIR) [options] "compiler" "dir1" "dir2" "dir2" ...}
+#
+# Note that the compiler string and each directory path string must quoted if
+# they contain spaces or any other characters that might get mangled by the
+# shell
+#
+# Depends on this setting passed as a make commaond line definition from the
+# toplevel Makefile:
+#
+# TOPDIR - The path to the the top level NuttX directory in the form
+# appropriate for the current build environment
+#
+# Depends on this settings defined in board-specific defconfig file installed
+# at $(TOPDIR)/.config:
+#
+# CONFIG_WINDOWS_NATIVE - Defined for a Windows native build
+
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+ INCDIR = "$(TOPDIR)\tools\incdir.bat"
+else
+ INCDIR = "$(TOPDIR)/tools/incdir.sh"
+endif
+
+# PREPROCESS - Default macro to run the C pre-processor
+# Example: $(call PREPROCESS, in-file, out-file)
+#
+# Depends on these settings defined in board-specific Make.defs file
+# installed at $(TOPDIR)/Make.defs:
+#
+# CPP - The command to invoke the C pre-processor
+# CPPFLAGS - Options to pass to the C pre-processor
define PREPROCESS
@echo "CPP: $1->$2"
$(Q) $(CPP) $(CPPFLAGS) $1 -o $2
endef
+# COMPILE - Default macro to compile one C file
+# Example: $(call COMPILE, in-file, out-file)
+#
+# Depends on these settings defined in board-specific Make.defs file
+# installed at $(TOPDIR)/Make.defs:
+#
+# CC - The command to invoke the C compiler
+# CFLAGS - Options to pass to the C compiler
+
define COMPILE
@echo "CC: $1"
$(Q) $(CC) -c $(CFLAGS) $1 -o $2
endef
+# COMPILEXX - Default macro to compile one C++ file
+# Example: $(call COMPILEXX, in-file, out-file)
+#
+# Depends on these settings defined in board-specific Make.defs file
+# installed at $(TOPDIR)/Make.defs:
+#
+# CXX - The command to invoke the C++ compiler
+# CXXFLAGS - Options to pass to the C++ compiler
+
define COMPILEXX
@echo "CXX: $1"
$(Q) $(CXX) -c $(CXXFLAGS) $1 -o $2
endef
+# ASSEMBLE - Default macro to assemble one assembly language file
+# Example: $(call ASSEMBLE, in-file, out-file)
+#
+# Depends on these settings defined in board-specific Make.defs file
+# installed at $(TOPDIR)/Make.defs:
+#
+# CC - By default, the C compiler is used to compile assembly lagnuage
+# files
+# AFLAGS - Options to pass to the C+compiler
+
define ASSEMBLE
@echo "AS: $1"
$(Q) $(CC) -c $(AFLAGS) $1 -o $2
endef
+# ARCHIVE - Add a list of files to an archive
+# Example: $(call ARCHIVE, archive-file, "file1 file2 file3 ...")
+#
+# Note: The fileN strings may not contain spaces or characters that may be
+# interpreted strangely by the shell
+#
+# Depends on these settings defined in board-specific Make.defs file
+# installed at $(TOPDIR)/Make.defs:
+#
+# AR - The command to invoke the archiver (includes any options)
+#
+# Depends on this settings defined in board-specific defconfig file installed
+# at $(TOPDIR)/.config:
+#
+# CONFIG_WINDOWS_NATIVE - Defined for a Windows native build
+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define ARCHIVE
@echo "AR: $2"
diff --git a/nuttx/tools/Makefile.host b/nuttx/tools/Makefile.host
index 882a3c0ae..478625008 100644
--- a/nuttx/tools/Makefile.host
+++ b/nuttx/tools/Makefile.host
@@ -37,6 +37,13 @@ TOPDIR ?= ${shell pwd}/..
-include $(TOPDIR)/Make.defs
include ${TOPDIR}/tools/Config.mk
+# strtok_r is used in some tools, but does not seem to be available in
+# the MinGW environment.
+
+ifneq ($(CONFIG_WINDOWS_NATIVE),y)
+ HOSTCFLAGS += -D HAVE_STRTOK_C
+endif
+
all: mkconfig$(HOSTEXEEXT) mkversion$(HOSTEXEEXT) mksyscall$(HOSTEXEEXT) bdf-converter$(HOSTEXEEXT) mksymtab$(HOSTEXEEXT) mkdeps$(HOSTEXEEXT)
default: mkconfig$(HOSTEXEEXT) mksyscall$(HOSTEXEEXT) mkdeps$(HOSTEXEEXT)
diff --git a/nuttx/tools/README.txt b/nuttx/tools/README.txt
index 3c9730d00..38efc7a3f 100644
--- a/nuttx/tools/README.txt
+++ b/nuttx/tools/README.txt
@@ -1,5 +1,5 @@
tools/README.txt
-^^^^^^^^^^^^^^^^
+================
This README file addresses the contents of the NuttX tools/ directory.
@@ -8,22 +8,38 @@ that are necessary parts of the the NuttX build system. These files
include:
README.txt
+----------
- This file
+ This file!
+
+Config.mk
+---------
+
+ This file contains common definitions used by many configureation files.
+ This file (along with <nuttx>/.config) must be included at the top of
+ each configuration-specific Make.defs file like:
+
+ -include $(TOPDIR)/.config
+ include $(TOPDIR)/tools/Config.mk
+
+ Subsequent logic within the configuration-specific Make.defs file may then
+ override these default definitions as necessary.
configure.sh
+------------
This is a bash script that is used to configure NuttX for a given
target board. See configs/README.txt or Documentation/NuttxPortingGuide.html
for a description of how to configure NuttX with this script.
discover.py
+-----------
Example script for discovering devices in the local network.
It is the counter part to apps/netutils/discover
-
mkconfig.c, cfgparser.c, and cfgparser.h
+----------------------------------------
These are Cs file that are used to build mkconfig program. The mkconfig
program is used during the initial NuttX build.
@@ -38,11 +54,13 @@ mkconfig.c, cfgparser.c, and cfgparser.h
NuttX configuration that can be included by C files.
cmdconfig.c
+-----------
This C file can be used to build a utility for comparing two NuttX
configuration files.
mkexport.sh and Makefile.export
+-------------------------------
These implement part of the top-level Makefile's 'export' target. That
target will bundle up all of the NuttX libraries, header files, and the
@@ -51,6 +69,7 @@ mkexport.sh and Makefile.export
options from the top-level Make.defs file.
mkfsdata.pl
+-----------
This perl script is used to build the "fake" file system and CGI support
as needed for the apps/netutils/webserver. It is currently used only
@@ -61,6 +80,7 @@ mkfsdata.pl
by Adam Dunkels. uIP has a license that is compatible with NuttX.
mkversion.c, cfgparser.c, and cfgparser.h
+-----------------------------------------
This is C file that is used to build mkversion program. The mkversion
program is used during the initial NuttX build.
@@ -74,6 +94,7 @@ mkversion.c, cfgparser.c, and cfgparser.h
version.h provides version information that can be included by C files.
mksyscall.c, cvsparser.c, and cvsparser.h
+-----------------------------------------
This is a C file that is used to build mksyscall program. The mksyscall
program is used during the initial NuttX build by the logic in the top-
@@ -96,6 +117,7 @@ mksyscall.c, cvsparser.c, and cvsparser.h
stub files as output. See syscall/README.txt for additonal information.
mksymtab.c, cvsparser.c, and cvsparser.h
+----------------------------------------
This is a C file that is used to build symbol tables from common-separated
value (CSV) files. This tool is not used during the NuttX build, but
@@ -116,10 +138,12 @@ mksymtab.c, cvsparser.c, and cvsparser.h
./mksymtab.exe tmp.csv tmp.c
pic32mx
+-------
This directory contains build tools used only for PIC32MX platforms
bdf-convert.c
+-------------
This C file is used to build the bdf-converter program. The bdf-converter
program be used to convert fonts in Bitmap Distribution Format (BDF)
@@ -255,6 +279,7 @@ bdf-convert.c
};
Makefile.host
+-------------
This is the makefile that is used to make the mkconfig program from
the mkconfig.c C file, the cmpconfig program from cmpconfig.c C file
@@ -265,6 +290,7 @@ Makefile.host
make -f Makefile.host <program>
mkromfsimg.sh
+-------------
This script may be used to automate the generate of a ROMFS file system
image. It accepts an rcS script "template" and generates and image that
@@ -274,6 +300,7 @@ mkdeps.sh
mkdeps.bat
mkdeps.c
mknulldeps.sh
+-------------
NuttX uses the GCC compilers capabilities to create Makefile dependencies.
The bash script mkdeps.sh is used to run GCC in order to create the
@@ -317,6 +344,7 @@ mknulldeps.sh
that mixed environment.
define.sh
+---------
Different compilers have different conventions for specifying pre-
processor definitions on the compiler command line. This bash
@@ -324,6 +352,7 @@ define.sh
without concern for the particular compiler in use.
incdir.sh
+---------
Different compilers have different conventions for specifying lists
of include file paths on the the compiler command line. This bash
@@ -333,6 +362,7 @@ incdir.sh
link.sh
winlink.sh
unlink.sh
+----------
Different file system have different capabilities for symbolic links.
Some windows file systems have no native support for symbolic links.
@@ -365,16 +395,19 @@ unlink.sh
tried that
mkimage.sh
+----------
The creates a downloadable image as needed with the rrload bootloader.
indent.sh
+---------
This script can be used to indent .c and .h files in a manner similar
to my coding NuttX coding style. It doesn't do a really good job,
however (see the comments at the top of the indent.sh file).
zipme.sh
+--------
I use this script to create the nuttx-xx.yy.tar.gz tarballs for
release on SourceForge. It is handy because it also does the
diff --git a/nuttx/tools/mkdeps.c b/nuttx/tools/mkdeps.c
index a90595c98..c688b2b75 100644
--- a/nuttx/tools/mkdeps.c
+++ b/nuttx/tools/mkdeps.c
@@ -87,6 +87,75 @@ static char *g_topdir = NULL;
* Private Functions
****************************************************************************/
+ /* MinGW does not seem to provide strtok_r */
+
+#ifndef HAVE_STRTOK_R
+static char *strtok_r(char *str, const char *delim, char **saveptr)
+{
+ char *pbegin;
+ char *pend = NULL;
+
+ /* Decide if we are starting a new string or continuing from
+ * the point we left off.
+ */
+
+ if (str)
+ {
+ pbegin = str;
+ }
+ else if (saveptr && *saveptr)
+ {
+ pbegin = *saveptr;
+ }
+ else
+ {
+ return NULL;
+ }
+
+ /* Find the beginning of the next token */
+
+ for (;
+ *pbegin && strchr(delim, *pbegin) != NULL;
+ pbegin++);
+
+ /* If we are at the end of the string with nothing
+ * but delimiters found, then return NULL.
+ */
+
+ if (!*pbegin)
+ {
+ return NULL;
+ }
+
+ /* Find the end of the token */
+
+ for (pend = pbegin + 1;
+ *pend && strchr(delim, *pend) == NULL;
+ pend++);
+
+ /* pend either points to the end of the string or to
+ * the first delimiter after the string.
+ */
+
+ if (*pend)
+ {
+ /* Turn the delimiter into a null terminator */
+
+ *pend++ = '\0';
+ }
+
+ /* Save the pointer where we left off and return the
+ * beginning of the token.
+ */
+
+ if (saveptr)
+ {
+ *saveptr = pend;
+ }
+ return pbegin;
+}
+#endif
+
static void append(char **base, char *str)
{
char *oldbase;