From d010ac80c21ce2cae58d21c3e909a7c000ecdc3f Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 5 Jan 2013 14:57:43 +0000 Subject: Clean up a few tools/ build issues git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5480 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/tools/Makefile.host | 27 +++++++++++++++++++-------- nuttx/tools/cmpconfig.c | 7 ++++--- nuttx/tools/configure.bat | 1 - nuttx/tools/mksyscall.c | 6 ++++-- 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/nuttx/tools/Makefile.host b/nuttx/tools/Makefile.host index 73352aae3..998d38916 100644 --- a/nuttx/tools/Makefile.host +++ b/nuttx/tools/Makefile.host @@ -37,13 +37,29 @@ TOPDIR ?= ${shell pwd}/.. -include $(TOPDIR)/Make.defs include ${TOPDIR}/tools/Config.mk +# Define HOSTCC on the make command line if it differs from these defaults +# Define HOSTCFLAGS with -g on the make command line to build debug versions + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + +# In the Windows native environment, the MinGW GCC compiler is assumed + +HOSTCC ?= mingw-gcc.exe +HOSTCFLAGS ?= -O2 -Wall -Wstrict-prototypes -Wshadow -I. -DCONFIG_WINDOWS_NATIVE=y + +else + +# GCC is assumed in the POSIX environment. # 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 +HOSTCC ?= gcc +HOSTCFLAGS ?= -O2 -Wall -Wstrict-prototypes -Wshadow -I. -DHAVE_STRTOK_C + endif +# Targets + all: b16$(HOSTEXEEXT) bdf-converter$(HOSTEXEEXT) cmpconfig$(HOSTEXEEXT) \ configure$(HOSTEXEEXT) mkconfig$(HOSTEXEEXT) mkdeps$(HOSTEXEEXT) mksymtab$(HOSTEXEEXT) \ mksyscall$(HOSTEXEEXT) mkversion$(HOSTEXEEXT) @@ -55,12 +71,7 @@ else .PHONY: clean endif -# Add HOSTCFLAGS=-g on the make command line build debug versions - -HOSTCFLAGS ?= -O2 -Wall -I. -HOSTCC ?= gcc - -# b16 - Fixed precision math converstion tool +# b16 - Fixed precision math conversion tool b16$(HOSTEXEEXT): b16.c $(Q) $(HOSTCC) $(HOSTCFLAGS) -o b16$(HOSTEXEEXT) b16.c diff --git a/nuttx/tools/cmpconfig.c b/nuttx/tools/cmpconfig.c index 08b7dab3f..a5a539401 100644 --- a/nuttx/tools/cmpconfig.c +++ b/nuttx/tools/cmpconfig.c @@ -67,6 +67,7 @@ static void compare_variables(struct variable_s *list1, struct variable_s *list2 { char *varval1; char *varval2; + int result; while (list1 || list2) { @@ -102,7 +103,7 @@ static void compare_variables(struct variable_s *list1, struct variable_s *list2 } else { - int result = strcmp(list1->var, list2->var); + result = strcmp(list1->var, list2->var); if (result < 0) { printf("file1: %s=%s\n", list1->var, varval1); @@ -115,9 +116,9 @@ static void compare_variables(struct variable_s *list1, struct variable_s *list2 printf("file2: %s=%s\n\n", list2->var, varval2); list2 = list2->flink; } - else + else /* if (result == 0) */ { - int result = strcmp(varval1, varval2); + result = strcmp(varval1, varval2); if (result != 0) { printf("file1: %s=%s\n", list1->var, varval1); diff --git a/nuttx/tools/configure.bat b/nuttx/tools/configure.bat index c28558fbb..7dc9ca116 100644 --- a/nuttx/tools/configure.bat +++ b/nuttx/tools/configure.bat @@ -93,7 +93,6 @@ configure.exe %debug% %fmt% %appdir% %config% if errorlevel 1 echo configure.exe failed goto End - :NoConfig echo Missing ^/^ argument diff --git a/nuttx/tools/mksyscall.c b/nuttx/tools/mksyscall.c index a75e82d28..1d172a2a1 100644 --- a/nuttx/tools/mksyscall.c +++ b/nuttx/tools/mksyscall.c @@ -61,11 +61,11 @@ static FILE *g_stubstream; * Private Functions ****************************************************************************/ -static bool is_vararg(const char *type, int index, int nparms) +static bool is_vararg(const char *type, int ndx, int nparms) { if (strcmp(type,"...") == 0) { - if (index != (nparms-1)) + if (ndx != (nparms-1)) { fprintf(stderr, "%d: ... is not the last in the argument list\n", g_lineno); exit(11); @@ -75,8 +75,10 @@ static bool is_vararg(const char *type, int index, int nparms) fprintf(stderr, "%d: Need one parameter before ...\n", g_lineno); exit(14); } + return true; } + return false; } -- cgit v1.2.3