From 3e83aa73887f447ba5b4606fb49aad62bedbe869 Mon Sep 17 00:00:00 2001
From: Gregory Nutt <gnutt@nuttx.org>
Date: Mon, 11 Jul 2016 10:45:17 -0600
Subject: [PATCH] Add apps/include to include path in top-level Make.defs file.
  Remove multiple definitions of INCDIR opt.

---
 Make.defs                      | 12 +++++++++++-
 graphics/screenshot/Makefile   |  6 +-----
 graphics/traveler/Makefile     |  6 +-----
 interpreters/bas/Makefile      |  6 +-----
 interpreters/ficl/Makefile     |  6 +-----
 modbus/Makefile                |  6 +-----
 system/cle/Makefile            |  6 +-----
 system/flash_eraseall/Makefile |  6 +-----
 system/free/Makefile           |  5 +----
 system/hexed/Makefile          |  6 +-----
 system/install/Makefile        |  8 ++------
 system/lm75/Makefile           |  6 +-----
 system/netdb/Makefile          |  6 +-----
 system/nxplayer/Makefile       |  6 +-----
 system/prun/Makefile           |  6 +-----
 system/prun/prun.c             | 12 ------------
 system/ramtest/Makefile        |  4 ----
 system/readline/Makefile       |  6 +-----
 system/stackmonitor/Makefile   |  6 +-----
 system/sudoku/Makefile         |  6 +-----
 system/symtab/Makefile         |  6 +-----
 system/vi/Makefile             |  6 +-----
 system/zmodem/Makefile         |  6 +-----
 23 files changed, 32 insertions(+), 117 deletions(-)

diff --git a/Make.defs b/Make.defs
index ab9f3fe6c..866d1eb46 100644
--- a/Make.defs
+++ b/Make.defs
@@ -2,7 +2,7 @@
 # apps/Make.defs
 # Common make definitions provided to all applications
 #
-#   Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2011, 2014, 2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,8 @@
 #
 ############################################################################
 
+# Builtin Registration
+
 BUILTIN_REGISTRY = $(APPDIR)$(DELIM)builtin$(DELIM)registry
 
 DEPCONFIG = $(TOPDIR)$(DELIM).config
@@ -61,3 +63,11 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y)
 else
   MKKCONFIG = $(APPDIR)/tools/mkkconfig.sh
 endif
+
+ifeq ($(WINTOOL),y)
+  INCDIROPT = -w
+endif
+
+# Standard include path
+
+CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"}
diff --git a/graphics/screenshot/Makefile b/graphics/screenshot/Makefile
index 1c2789b06..0cf2bdc0c 100644
--- a/graphics/screenshot/Makefile
+++ b/graphics/screenshot/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/examples/screenshot/Makefile
 #
-#   Copyright (C) 2013 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -37,10 +37,6 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 # TIFF Screenshot utility
 
 ASRCS =
diff --git a/graphics/traveler/Makefile b/graphics/traveler/Makefile
index ecbd0e54a..84f6396c0 100644
--- a/graphics/traveler/Makefile
+++ b/graphics/traveler/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/graphics/traveler/Makefile
 #
-#   Copyright (C) 2014 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -109,10 +109,6 @@ endif
 CONFIG_EXAMPLES_HELLO_PROGNAME ?= hello$(EXEEXT)
 PROGNAME = $(CONFIG_EXAMPLES_HELLO_PROGNAME)
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TRAVELER_INC)}
 
 DEPPATH = --dep-path . --dep-path src
diff --git a/interpreters/bas/Makefile b/interpreters/bas/Makefile
index f20c311cd..f25b52521 100644
--- a/interpreters/bas/Makefile
+++ b/interpreters/bas/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/bas/Makefile
 #
-#   Copyright (C) 2014 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -50,10 +50,6 @@ endif
 DEPPATH = --dep-path .
 VPATH = .
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 AOBJS		= $(ASRCS:.S=$(OBJEXT))
 COBJS		= $(CSRCS:.c=$(OBJEXT))
 
diff --git a/interpreters/ficl/Makefile b/interpreters/ficl/Makefile
index a97bf1b89..bc3ae7c43 100644
--- a/interpreters/ficl/Makefile
+++ b/interpreters/ficl/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/interpreters/ficl/Makefile
 #
-#   Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2011-2012, 2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -40,10 +40,6 @@ include $(APPDIR)/Make.defs
 
 # Tools
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 # Include paths
 
 CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(BUILDDIR)/$(FICL_SUBDIR) $(BUILDDIR)/src}
diff --git a/modbus/Makefile b/modbus/Makefile
index 78b8d60e9..de49fe403 100644
--- a/modbus/Makefile
+++ b/modbus/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/modbus/Makefile
 #
-#   Copyright (C) 2012 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -48,10 +48,6 @@ CSRCS += mb.c
 DEPPATH = --dep-path .
 VPATH = .
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 include ascii/Make.defs
 include functions/Make.defs
 include nuttx/Make.defs
diff --git a/system/cle/Makefile b/system/cle/Makefile
index 1d6cd90ee..000db17f3 100644
--- a/system/cle/Makefile
+++ b/system/cle/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/system/cle/Makefile
 #
-#   Copyright (C) 2014 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -37,10 +37,6 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT	= -w
-endif
-
 # EMACS-like Command Line Editor (CLE)
 
 ASRCS		=
diff --git a/system/flash_eraseall/Makefile b/system/flash_eraseall/Makefile
index cad71b307..c7aa2f73c 100644
--- a/system/flash_eraseall/Makefile
+++ b/system/flash_eraseall/Makefile
@@ -42,11 +42,7 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
-# Hello Application
+# flash_eraseall Application
 # TODO: appname can be automatically extracted from the directory name
 
 APPNAME = flash_eraseall
diff --git a/system/free/Makefile b/system/free/Makefile
index 5f777b763..1cb8199e7 100644
--- a/system/free/Makefile
+++ b/system/free/Makefile
@@ -2,6 +2,7 @@
 # apps/system/free/Makefile
 #
 #   Copyright (C) 2011-2012 Uros Platise. All rights reserved.
+#   Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
 #   Author: Uros Platise <uros.platise@isotel.eu>
 #           Gregory Nutt <gnutt@nuttx.org>
 #
@@ -38,10 +39,6 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 # Replacement free command
 
 APPNAME = free
diff --git a/system/hexed/Makefile b/system/hexed/Makefile
index fc115d076..6cc907d5b 100644
--- a/system/hexed/Makefile
+++ b/system/hexed/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/system/hexed/Makefile
 #
-#   Copyright (C) 2015 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -37,10 +37,6 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 # hexed Application
 
 CONFIG_SYSTEM_HEXED_PRIORITY ?= SCHED_PRIORITY_DEFAULT
diff --git a/system/install/Makefile b/system/install/Makefile
index 7053f5307..09700af3b 100644
--- a/system/install/Makefile
+++ b/system/install/Makefile
@@ -2,7 +2,7 @@
 # apps/system/install/Makefile
 #
 #   Copyright (C) 2011 Uros Platise. All rights reserved.
-#   Copyright (C) 2012 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
 #   Author: Uros Platise <uros.platise@isotel.eu>
 #           Gregory Nutt <gnutt@nuttx.org>
 #
@@ -42,11 +42,7 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
-# Hello Application
+# Install Application
 # TODO: appname can be automatically extracted from the directory name
 
 APPNAME = install
diff --git a/system/lm75/Makefile b/system/lm75/Makefile
index dd08d7c6b..5ac2a238d 100644
--- a/system/lm75/Makefile
+++ b/system/lm75/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/system/lm75/Makefile
 #
-#   Copyright (C) 2015 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -40,10 +40,6 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 # LM-75 Temperature Sensor Application
 
 CONFIG_SYSTEM_LM75_PRIORITY ?= 100
diff --git a/system/netdb/Makefile b/system/netdb/Makefile
index 3cc74eaf7..40553e010 100644
--- a/system/netdb/Makefile
+++ b/system/netdb/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/system/netdb/Makefile
 #
-#   Copyright (C) 2015 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -37,10 +37,6 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 # netdb Application
 
 CONFIG_SYSTEM_NETDB_STACKSIZE ?= 2048
diff --git a/system/nxplayer/Makefile b/system/nxplayer/Makefile
index 411833515..6872f857e 100644
--- a/system/nxplayer/Makefile
+++ b/system/nxplayer/Makefile
@@ -2,7 +2,7 @@
 # apps/system/nxplayer/Makefile
 #
 #   Copyright (C) 2013 Ken Pettit. All rights reserved.
-#   Copyright (C) 2012-2013 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved.
 #   Author: Ken Pettit <pettitkd@gmail.com>
 #           Gregory Nutt <gnutt@nuttx.org>
 #
@@ -39,10 +39,6 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 # NxPlayer Library
 
 ASRCS =
diff --git a/system/prun/Makefile b/system/prun/Makefile
index 61e6d10a7..88f800f97 100644
--- a/system/prun/Makefile
+++ b/system/prun/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/system/prun/Makefile
 #
-#   Copyright (C) 2014 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -39,10 +39,6 @@ include $(APPDIR)/Make.defs
 
 # Pascal P-Code interpreter / Virtual machine
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" \
   "." \
   "$(APPDIR)$(DELIM)interpreters$(DELIM)pcode$(DELIM)include" \
diff --git a/system/prun/prun.c b/system/prun/prun.c
index 6e9babb99..68bdd35be 100644
--- a/system/prun/prun.c
+++ b/system/prun/prun.c
@@ -50,18 +50,6 @@
 #include "pedefs.h"
 #include "prun.h"
 
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
diff --git a/system/ramtest/Makefile b/system/ramtest/Makefile
index 5f097956a..a771e57bc 100644
--- a/system/ramtest/Makefile
+++ b/system/ramtest/Makefile
@@ -37,10 +37,6 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 # RAM test
 
 PRIORITY = SCHED_PRIORITY_DEFAULT
diff --git a/system/readline/Makefile b/system/readline/Makefile
index 0466f914f..b6aafbe09 100644
--- a/system/readline/Makefile
+++ b/system/readline/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/system/readline/Makefile
 #
-#   Copyright (C) 2012-2013 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -37,10 +37,6 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 # The Readline Library
 
 ASRCS =
diff --git a/system/stackmonitor/Makefile b/system/stackmonitor/Makefile
index 576b74949..88a390fca 100644
--- a/system/stackmonitor/Makefile
+++ b/system/stackmonitor/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/system/stackmonitor/Makefile
 #
-#   Copyright (C) 2013 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -37,10 +37,6 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 # Stack Monitor Application
 
 PRIORITY = SCHED_PRIORITY_DEFAULT
diff --git a/system/sudoku/Makefile b/system/sudoku/Makefile
index 6543639c4..6603059ce 100644
--- a/system/sudoku/Makefile
+++ b/system/sudoku/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/system/sudoku/Makefile
 #
-#   Copyright (C) 2014 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -37,10 +37,6 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 # Sudoku Application
 
 CONFIG_SYSTEM_SUDOKU_STACKSIZE ?= 1536
diff --git a/system/symtab/Makefile b/system/symtab/Makefile
index 1f9946f38..4589bc4f8 100644
--- a/system/symtab/Makefile
+++ b/system/symtab/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/system/symtab/Makefile
 #
-#   Copyright (C) 2015 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -37,10 +37,6 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 # Symbol table support
 
 ASRCS =
diff --git a/system/vi/Makefile b/system/vi/Makefile
index 83f39253b..467f8b791 100644
--- a/system/vi/Makefile
+++ b/system/vi/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/system/vi/Makefile
 #
-#   Copyright (C) 2014 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -37,10 +37,6 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 # VI-Workalike Editor
 
 CONFIG_SYSTEM_VI_STACKSIZE ?= 2048
diff --git a/system/zmodem/Makefile b/system/zmodem/Makefile
index e1bdff5bd..d03868527 100644
--- a/system/zmodem/Makefile
+++ b/system/zmodem/Makefile
@@ -1,7 +1,7 @@
 ############################################################################
 # apps/system/zmodem/Makefile
 #
-#   Copyright (C) 2013 Gregory Nutt. All rights reserved.
+#   Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
 #   Author: Gregory Nutt <gnutt@nuttx.org>
 #
 # Redistribution and use in source and binary forms, with or without
@@ -37,10 +37,6 @@
 -include $(TOPDIR)/Make.defs
 include $(APPDIR)/Make.defs
 
-ifeq ($(WINTOOL),y)
-INCDIROPT = -w
-endif
-
 # Zmodem sz and rz commands
 
 PRIORITY = SCHED_PRIORITY_DEFAULT