diff --git a/tools/Makefile.host b/tools/Makefile.host index 73352aae3a..998d389160 100644 --- a/tools/Makefile.host +++ b/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/tools/cmpconfig.c b/tools/cmpconfig.c index 08b7dab3f0..a5a5394017 100644 --- a/tools/cmpconfig.c +++ b/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/tools/configure.bat b/tools/configure.bat index c28558fbbd..7dc9ca116c 100644 --- a/tools/configure.bat +++ b/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/tools/mksyscall.c b/tools/mksyscall.c index a75e82d280..1d172a2a11 100644 --- a/tools/mksyscall.c +++ b/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; }