2015-08-12 23:29:52 +02:00
|
|
|
@Echo off
|
|
|
|
|
|
|
|
REM apps/tools/mkkconfig.bat
|
|
|
|
REM
|
2016-06-06 20:30:01 +02:00
|
|
|
REM Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
|
2015-08-12 23:29:52 +02:00
|
|
|
REM Author: Gregory Nutt <gnutt@nuttx.org>
|
|
|
|
REM
|
|
|
|
REM Redistribution and use in source and binary forms, with or without
|
|
|
|
REM modification, are permitted provided that the following conditions
|
|
|
|
REM are met:
|
|
|
|
REM
|
|
|
|
REM 1. Redistributions of source code must retain the above copyright
|
|
|
|
REM notice, this list of conditions and the following disclaimer.
|
|
|
|
REM 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
REM notice, this list of conditions and the following disclaimer in
|
|
|
|
REM the documentation and/or other materials provided with the
|
|
|
|
REM distribution.
|
|
|
|
REM 3. Neither the name NuttX nor the names of its contributors may be
|
|
|
|
REM used to endorse or promote products derived from this software
|
|
|
|
REM without specific prior written permission.
|
|
|
|
REM
|
|
|
|
REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
REM "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
REM LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
REM FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
REM COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
REM INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
REM BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
REM OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
REM AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
REM LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
REM ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
REM POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
REM
|
|
|
|
|
|
|
|
REM Parse command line arguments
|
|
|
|
|
2016-06-06 20:47:52 +02:00
|
|
|
SET menu=""
|
2015-08-12 23:29:52 +02:00
|
|
|
SET kconfig=Kconfig
|
|
|
|
|
|
|
|
:ArgLoop
|
|
|
|
IF "%1"=="" GOTO :EndOfLoop
|
2016-06-06 20:30:01 +02:00
|
|
|
IF "%1"=="-m" GOTO :SetMenu
|
2015-08-12 23:29:52 +02:00
|
|
|
IF "%1"=="-o" GOTO :SetKconfig
|
|
|
|
IF "%1"=="-h" GOTO :ShowUsage
|
|
|
|
|
|
|
|
Echo ERROR: Unrecogized option %1
|
|
|
|
GOTO :ShowUsage
|
|
|
|
|
|
|
|
:SetDebug
|
|
|
|
SET debug=-d
|
|
|
|
GOTO :NextArg
|
|
|
|
|
2016-06-06 20:30:01 +02:00
|
|
|
:SetMenu
|
2015-08-12 23:29:52 +02:00
|
|
|
SHIFT
|
2016-06-06 20:30:01 +02:00
|
|
|
SET menu=%1
|
2015-08-12 23:29:52 +02:00
|
|
|
GOTO :NextArg
|
|
|
|
|
|
|
|
:SetKconfig
|
|
|
|
SHIFT
|
|
|
|
SET kconfig=%1
|
|
|
|
|
|
|
|
:NextArg
|
|
|
|
SHIFT
|
|
|
|
GOTO :ArgLoop
|
|
|
|
|
|
|
|
REM Check input Parameters
|
|
|
|
|
|
|
|
:EndOfLoop
|
|
|
|
IF EXIST %kconfig% (
|
|
|
|
Del /f /q %kconfig%
|
|
|
|
REM IF %ERRORLEVEL% GTR 0 (
|
|
|
|
REM Echo ERROR: failed to remove %kconfig%
|
|
|
|
REM GOTO :End
|
|
|
|
REM )
|
|
|
|
)
|
|
|
|
|
2017-05-22 15:34:13 +02:00
|
|
|
REM Get the current directory
|
2017-07-05 19:33:58 +02:00
|
|
|
SET APPSDIR=%cd%
|
2017-07-06 22:07:17 +02:00
|
|
|
SET APPSDIR=%APPSDIR:\=/%
|
2017-05-22 15:34:13 +02:00
|
|
|
|
2015-08-12 23:29:52 +02:00
|
|
|
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%
|
2016-06-06 20:30:01 +02:00
|
|
|
Echo # This file is autogenerated, do not edit. >> %kconfig%
|
|
|
|
Echo # >> %kconfig%
|
2016-06-06 20:47:52 +02:00
|
|
|
Echo[ >> %kconfig%
|
2016-06-06 20:30:01 +02:00
|
|
|
|
|
|
|
IF %menu% NEQ "" (
|
2017-07-05 21:36:24 +02:00
|
|
|
Echo menu %menu% >> %kconfig%
|
2016-06-06 20:30:01 +02:00
|
|
|
)
|
2015-08-12 23:29:52 +02:00
|
|
|
|
|
|
|
DIR /B /A:D >_tmp_.dat
|
|
|
|
|
|
|
|
FOR /F "tokens=*" %%s IN (_tmp_.dat) do (
|
2016-06-06 20:30:01 +02:00
|
|
|
IF EXIST %%s\Kconfig (
|
2017-05-22 15:34:13 +02:00
|
|
|
Echo source "%APPSDIR%/%%s/Kconfig" >> %kconfig%
|
2016-06-06 20:30:01 +02:00
|
|
|
)
|
2015-08-12 23:29:52 +02:00
|
|
|
)
|
|
|
|
DEL _tmp_.dat
|
|
|
|
|
2016-06-06 20:30:01 +02:00
|
|
|
IF %menu% NEQ "" (
|
|
|
|
Echo endmenu # %menu% >> %kconfig%
|
|
|
|
)
|
|
|
|
|
2015-08-12 23:29:52 +02:00
|
|
|
GOTO :End
|
|
|
|
|
|
|
|
REM Exit showing usage
|
|
|
|
|
|
|
|
:ShowUsage
|
2016-06-06 20:30:01 +02:00
|
|
|
Echo USAGE: %0 [-d] [-m ^<menu^>] [-o ^<kconfig-file^>]
|
2015-08-12 23:29:52 +02:00
|
|
|
Echo %0 [-h]
|
|
|
|
Echo Where:
|
|
|
|
Echo ^<-d^>:
|
|
|
|
Echo Enables debug output
|
2016-06-06 20:30:01 +02:00
|
|
|
Echo -m ^<menu^>:
|
|
|
|
Echo Menu description
|
2015-08-12 23:29:52 +02:00
|
|
|
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
|
2019-08-05 15:33:16 +02:00
|
|
|
Echo under nuttx/boards/^<board-name^>/.
|
2015-08-12 23:29:52 +02:00
|
|
|
Echo ^<-h^>:
|
|
|
|
Echo Prints this message and exits.
|
|
|
|
|
|
|
|
REM Exit
|
|
|
|
|
|
|
|
:End
|
|
|
|
|