diff --git a/canutils/libcanard/Makefile b/canutils/libcanard/Makefile index 40ab4036c..984015a87 100644 --- a/canutils/libcanard/Makefile +++ b/canutils/libcanard/Makefile @@ -48,7 +48,8 @@ LIBCANARD_DRVDIR = $(LIBCANARD_SRCDIR)$(DELIM)drivers$(DELIM)nuttx APPS_INCDIR = $(APPDIR)$(DELIM)include$(DELIM)canutils -CFLAGS += -std=c99 -I$(APPS_INCDIR) -DCANARD_ASSERT=DEBUGASSERT +CFLAGS += -std=c99 -DCANARD_ASSERT=DEBUGASSERT +CFLAGS += ${shell $(INCDIR) "$(CC)" $(APPS_INCDIR)} CSRCS = $(LIBCANARD_SRCDIR)$(DELIM)canard.c $(LIBCANARD_DRVDIR)$(DELIM)canard_nuttx.c diff --git a/examples/canard/Makefile b/examples/canard/Makefile index d46a85f54..cdee49d6c 100644 --- a/examples/canard/Makefile +++ b/examples/canard/Makefile @@ -40,7 +40,7 @@ PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = $(CONFIG_EXAMPLES_LIBCANARD_STACKSIZE) MODULE = $(CONFIG_EXAMPLES_LIBCANARD) -CFLAGS += -I$(APPDIR)/include/canutils +CFLAGS += ${shell $(INCDIR) "$(CC)" $(APPDIR)/include/canutils} MAINSRC = canard_main.c include $(APPDIR)/Application.mk diff --git a/examples/elf/tests/struct/Makefile b/examples/elf/tests/struct/Makefile index 3d398c5c2..d90e927f6 100644 --- a/examples/elf/tests/struct/Makefile +++ b/examples/elf/tests/struct/Makefile @@ -35,8 +35,6 @@ include $(TOPDIR)/Make.defs -CELFFLAGS += -I. - ifeq ($(CONFIG_CYGWIN_WINTOOL),y) NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)staging}" else diff --git a/examples/embedlog/Makefile b/examples/embedlog/Makefile index c9a41234e..027c574b9 100644 --- a/examples/embedlog/Makefile +++ b/examples/embedlog/Makefile @@ -45,6 +45,5 @@ MODULE = $(CONFIG_EXAMPLES_EMBEDLOG) # embedlog Example MAINSRC = embedlog_main.c -CFLAGS += -I$(APPDIR)/include/system include $(APPDIR)/Application.mk diff --git a/examples/embedlog/embedlog_main.c b/examples/embedlog/embedlog_main.c index 53d730a3b..28511513d 100644 --- a/examples/embedlog/embedlog_main.c +++ b/examples/embedlog/embedlog_main.c @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include +#include #include #include #include @@ -80,7 +80,7 @@ static struct el_options g_el; * * Description: * Presents how to use options and how it's rendered. This assumes all - * options are enabled in compile time. If any of the options is not enabled + * options are enabled in compile time. If any of the options isn't enabled * in compile time, setting it will have no effect and logs will vary. * * Input Parameters: @@ -284,7 +284,7 @@ static void el_print_file(const char *workdir) { if (errno == ENAMETOOLONG || errno == EINVAL) { - /* These are the only unrecoverable errors that embedlog may return, + /* These are the only unrecoverable errors embedlog may return, * any other error it actually a warning, telling user that file * could not have been opened now, but every el_print function with * output to file enabled, will try to reopen file. This of course @@ -305,9 +305,9 @@ static void el_print_file(const char *workdir) el_oprint(OELI, "Now we enabled log rotation"); el_oprint(OELI, "If log cannot fit in current file"); - el_oprint(OELI, "it will be stored in new file"); - el_oprint(OELI, "and if library creates EL_FROTATE_NUMBER files"); - el_oprint(OELI, "oldest file will be deleted and new file will be created"); + el_oprint(OELI, "it will be stored in new file and"); + el_oprint(OELI, "if library creates EL_FROTATE_NUMBER files oldest"); + el_oprint(OELI, "file will be deleted and new file will be created"); el_oprint(OELI, "run this program multiple times and see how it works"); } @@ -331,8 +331,8 @@ int main(int argc, FAR char *argv[]) el_oinit(&g_el); - el_oprint(OELI, "Right after init, embedlog will print to stderr with just " - "log level information - these are default settings."); + el_oprint(OELI, "Right after init, embedlog will print to stderr with " + "just log level information - these are default settings."); el_print_options(); el_print_memory(); diff --git a/examples/ini_dumper/Makefile b/examples/ini_dumper/Makefile index 877feff25..b95c223b1 100644 --- a/examples/ini_dumper/Makefile +++ b/examples/ini_dumper/Makefile @@ -45,7 +45,6 @@ MODULE = $(CONFIG_EXAMPLES_INI_DUMPER) # ini_dumper Example MAINSRC = ini_dumper_main.c -CFLAGS += -I$(APPDIR)/include/fsutils # needed to make compiler happy about wrong function pointers # different function pointer is used depending on that define diff --git a/examples/ini_dumper/ini_dumper_main.c b/examples/ini_dumper/ini_dumper_main.c index db90100b9..b1e9fc5a9 100644 --- a/examples/ini_dumper/ini_dumper_main.c +++ b/examples/ini_dumper/ini_dumper_main.c @@ -41,7 +41,7 @@ #include -#include "fsutils/ini.h" +#include /**************************************************************************** * Private Functions @@ -83,12 +83,12 @@ int main(int argc, FAR char *argv[]) return 1; } - printf("\n------ --------------- ------------- ---------------------------\n"); + printf("------ --------------- ------------- -------------------------\n"); printf(" line section key value\n"); - printf("------ --------------- ------------- ---------------------------\n"); + printf("------ --------------- ------------- -------------------------\n"); ret = ini_parse(argv[1], ini_dump, NULL); - printf("------ --------------- ------------- ---------------------------\n"); + printf("------ --------------- ------------- -------------------------\n"); fprintf(stderr, "ini_parse() exited with %d\n", ret); return 0; } diff --git a/examples/nxflat/tests/struct/Makefile b/examples/nxflat/tests/struct/Makefile index 8188af734..b657cfff8 100644 --- a/examples/nxflat/tests/struct/Makefile +++ b/examples/nxflat/tests/struct/Makefile @@ -35,8 +35,6 @@ include $(TOPDIR)/Make.defs -CFLAGS += -I. - BIN = struct R1SRCS = struct_main.c struct_dummy.c diff --git a/examples/powermonitor/Makefile b/examples/powermonitor/Makefile index 68dc4175a..92034300e 100644 --- a/examples/powermonitor/Makefile +++ b/examples/powermonitor/Makefile @@ -41,6 +41,4 @@ MODULE = $(CONFIG_EXAMPLES_POWERMONITOR) MAINSRC = powermonitor_main.c -CFLAGS += -I../../../nuttx/arch/arm/src -I../../../nuttx/arch/arm/src/common - include $(APPDIR)/Application.mk diff --git a/examples/pty_test/Makefile b/examples/pty_test/Makefile index a0e5a2fd1..1c66823b7 100644 --- a/examples/pty_test/Makefile +++ b/examples/pty_test/Makefile @@ -44,7 +44,6 @@ MODULE = $(CONFIG_EXAMPLES_PTYTEST) # PTY Test! Example -CFLAGS += -I$(APPDIR)/include MAINSRC = pty_test.c include $(APPDIR)/Application.mk diff --git a/import/Make.defs b/import/Make.defs index 7764b0aca..4a87383a4 100644 --- a/import/Make.defs +++ b/import/Make.defs @@ -41,17 +41,16 @@ include $(TOPDIR)/scripts/Make.defs # Compiler ifeq ($(CONFIG_CYGWIN_WINTOOL),y) - # Windows-native toolchains - ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)$(DELIM)include}" - ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)$(DELIM)include}" -isystem "${shell cygpath -w $(TOPDIR)$(DELIM)include$(DELIM)cxx}" ARCHCRT0OBJ = "${shell cygpath -w $(TOPDIR)$(DELIM)startup$(DELIM)crt0$(OBJEXT)}" else - # Linux/Cygwin-native toolchain - ARCHINCLUDES = -I. -isystem $(TOPDIR)$(DELIM)include - ARCHXXINCLUDES = -I. -isystem $(TOPDIR)$(DELIM)include -isystem $(TOPDIR)$(DELIM)include$(DELIM)cxx ARCHCRT0OBJ = $(TOPDIR)$(DELIM)startup$(DELIM)crt0$(OBJEXT) endif +ARCHINCLUDES += ${shell $(INCDIR) -s "$(CC)" $(TOPDIR)$(DELIM)include} + +ARCHXXINCLUDES += ${shell $(INCDIR) -s "$(CC)" $(TOPDIR)$(DELIM)include} +ARCHXXINCLUDES += ${shell $(INCDIR) -s "$(CC)" $(TOPDIR)$(DELIM)include$(DELIM)cxx} + ARCHCFLAGS += -fno-common -pipe ARCHCXXFLAGS += -fno-common -pipe diff --git a/netutils/cjson/Makefile b/netutils/cjson/Makefile index 9f68f46f0..755f411c2 100644 --- a/netutils/cjson/Makefile +++ b/netutils/cjson/Makefile @@ -56,7 +56,8 @@ CJSON_SRCDIR = $(CJSON_UNPACKNAME) APPS_INCDIR = $(APPDIR)$(DELIM)include$(DELIM)netutils -CFLAGS += -I$(APPS_INCDIR) -DCJSON_INCLUDE_CONFIG_H +CFLAGS += ${shell $(INCDIR) "$(CC)" $(APPS_INCDIR)} +CFLAGS += -DCJSON_INCLUDE_CONFIG_H CSRCS = $(CJSON_SRCDIR)$(DELIM)cJSON.c CSRCS += $(CJSON_SRCDIR)$(DELIM)cJSON_Utils.c diff --git a/system/embedlog/Makefile b/system/embedlog/Makefile index b2aae520a..ad9eefec0 100644 --- a/system/embedlog/Makefile +++ b/system/embedlog/Makefile @@ -48,7 +48,7 @@ EMBEDLOG_EXT = tar.gz EMBEDLOG_SOURCES = embedlog-$(EMBEDLOG_VERSION) EMBEDLOG_TARBALL = $(EMBEDLOG_SOURCES).$(EMBEDLOG_EXT) -CFLAGS += -I$(APPDIR)/include/system +CFLAGS += ${shell $(INCDIR) "$(CC)" $(APPDIR)$(DELIM)include$(DELIM)system} CSRCS = embedlog/src/el-options.c \ embedlog/src/el-perror.c \ diff --git a/system/psmq/Makefile b/system/psmq/Makefile index 280443981..bae3c3d01 100644 --- a/system/psmq/Makefile +++ b/system/psmq/Makefile @@ -48,8 +48,8 @@ PSMQ_EXT = tar.gz PSMQ_SOURCES = psmq-$(PSMQ_VERSION) PSMQ_TARBALL = $(PSMQ_SOURCES).$(PSMQ_EXT) -CFLAGS += -I$(APPDIR)/include/system -CFLAGS += -I$(APPDIR)/system/psmq/$(PSMQ_SOURCES) +CFLAGS += ${shell $(INCDIR) "$(CC)" $(APPDIR)$(DELIM)include$(DELIM)system} +CFLAGS += ${shell $(INCDIR) "$(CC)" $(APPDIR)$(DELIM)system$(DELIM)psmq$(DELIM)$(PSMQ_SOURCES)} # mandatory source files to compile CSRCS = $(PSMQ_SOURCES)/lib/psmq.c \ diff --git a/testing/unity/Makefile b/testing/unity/Makefile index 2bd0d2d10..a7c42097f 100644 --- a/testing/unity/Makefile +++ b/testing/unity/Makefile @@ -56,7 +56,8 @@ UNITY_SRCDIR = $(UNITY_UNPACKNAME)$(DELIM)src APPS_INCDIR = $(APPDIR)$(DELIM)include$(DELIM)testing -CFLAGS += -I$(APPS_INCDIR) -DUNITY_INCLUDE_CONFIG_H +CFLAGS += ${shell $(INCDIR) "$(CC)" $(APPS_INCDIR)} +CFLAGS += -DUNITY_INCLUDE_CONFIG_H CSRCS = $(UNITY_SRCDIR)$(DELIM)unity.c