Skip to content

Commit

Permalink
Update tools/mkkconfig.bat; silence some Makefile output
Browse files Browse the repository at this point in the history
  • Loading branch information
gregory-nutt committed Jun 6, 2016
1 parent e725f5e commit 807e51a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Directory.mk
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ nothing:
install:

preconfig: $(foreach SDIR, $(SUBDIRS), $(SDIR)_preconfig)
$(MKKCONFIG) -m "$(shell cat Kmenu)"
$(Q) $(MKKCONFIG) -m "$(shell cat Kmenu)"

context: $(foreach SDIR, $(SUBDIRS), $(SDIR)_context)

Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ context_serialize:
context: context_serialize

preconfig:$(foreach SDIR, $(BUILDIRS), $(SDIR)_preconfig)
echo subdirs done
$(MKKCONFIG)
$(Q) $(MKKCONFIG)

.depdirs: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_depend)

Expand Down
59 changes: 22 additions & 37 deletions tools/mkkconfig.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

REM apps/tools/mkkconfig.bat
REM
REM Copyright (C) 2015 Gregory Nutt. All rights reserved.
REM Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
REM Author: Gregory Nutt <gnutt@nuttx.org>
REM
REM Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -35,12 +35,12 @@ REM

REM Parse command line arguments

SET topdir=
SET menu=
SET kconfig=Kconfig

:ArgLoop
IF "%1"=="" GOTO :EndOfLoop
IF "%1"=="-t" GOTO :SetTopDir
IF "%1"=="-m" GOTO :SetMenu
IF "%1"=="-o" GOTO :SetKconfig
IF "%1"=="-h" GOTO :ShowUsage

Expand All @@ -51,9 +51,9 @@ GOTO :ShowUsage
SET debug=-d
GOTO :NextArg

:SetTopDir
:SetMenu
SHIFT
SET topdir=%1
SET menu=%1
GOTO :NextArg

:SetKconfig
Expand All @@ -67,34 +67,6 @@ GOTO :ArgLoop
REM Check input Parameters

:EndOfLoop
IF "%topdir%"=="" (
IF EXIST tools\mkkconfig.bat (
SET topdir=%cd%
) ELSE (
cd ..
IF %ERRORLEVEL% GTR 0 (
Echo ERROR: failed cd ..
GOTO :End
)
IF EXIST tools\mkkconfig.bat (
SET topdir=%cd%
) ELSE (
Echo ERROR: Cannot find top directory
GOTO :End
)
)
) ELSE (
IF NOT EXIST "%topdir%" (
Echo ERROR: %topdir% does not EXIST
GOTO :End
)
Cd %topdir%
IF %ERRORLEVEL% GTR 0 (
Echo ERROR: failed cd %topdir%
GOTO :End
)
)

IF EXIST %kconfig% (
Del /f /q %kconfig%
REM IF %ERRORLEVEL% GTR 0 (
Expand All @@ -107,27 +79,40 @@ Echo # > %kconfig%
Echo # For a description of the syntax of this configuration file, >> %kconfig%
Echo # see the file kconfig-language.txt in the NuttX tools repository. >> %kconfig%
Echo # >> %kconfig%
Echo # This file is autogenerated, do not edit. >> %kconfig%
Echo # >> %kconfig%
Echo >> %kconfig%

IF %menu% NEQ "" (
Echo menu "%menu%" >> %kconfig%
)

DIR /B /A:D >_tmp_.dat

Echo source "$APPSDIR/builtin/Kconfig" >> %kconfig%
FOR /F "tokens=*" %%s IN (_tmp_.dat) do (
if "%%s" NEQ "builtin" Echo source "$APPSDIR/%%s/Kconfig" >> %kconfig%
IF EXIST %%s\Kconfig (
Echo source "$APPSDIR/%%s/Kconfig" >> %kconfig%
)
)
DEL _tmp_.dat

IF %menu% NEQ "" (
Echo endmenu # %menu% >> %kconfig%
)

GOTO :End

REM Exit showing usage

:ShowUsage
Echo USAGE: %0 [-d] [-t ^<topdir^>] [-o ^<kconfig-file^>]
Echo USAGE: %0 [-d] [-m ^<menu^>] [-o ^<kconfig-file^>]
Echo %0 [-h]
Echo Where:
Echo ^<-d^>:
Echo Enables debug output
Echo -t ^<topdir^>:
Echo Identifies the top applicatino directory
Echo -m ^<menu^>:
Echo Menu description
Echo -o ^<kconfig-file^>:
Echo Identifies the specific configuratin for the selected ^<board-name^>.
Echo This must correspond to a sub-directory under the board directory at
Expand Down

0 comments on commit 807e51a

Please sign in to comment.