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
This commit is contained in:
patacongo 2013-01-05 14:57:43 +00:00
parent 3e52f2eb38
commit ce77c566f8
4 changed files with 27 additions and 14 deletions

View File

@ -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

View File

@ -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);

View File

@ -93,7 +93,6 @@ configure.exe %debug% %fmt% %appdir% %config%
if errorlevel 1 echo configure.exe failed
goto End
:NoConfig
echo Missing ^<board-name^>/^<config-name^> argument

View File

@ -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;
}