2015-08-12 23:29:52 +02:00
|
|
|
@Echo off
|
|
|
|
|
|
|
|
REM apps/tools/mkkconfig.bat
|
|
|
|
REM
|
2021-06-10 07:37:15 +02:00
|
|
|
REM Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
REM contributor license agreements. See the NOTICE file distributed with
|
|
|
|
REM this work for additional information regarding copyright ownership. The
|
|
|
|
REM ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
REM "License"); you may not use this file except in compliance with the
|
|
|
|
REM License. You may obtain a copy of the License at
|
2015-08-12 23:29:52 +02:00
|
|
|
REM
|
2021-06-10 07:37:15 +02:00
|
|
|
REM http://www.apache.org/licenses/LICENSE-2.0
|
2015-08-12 23:29:52 +02:00
|
|
|
REM
|
2021-06-10 07:37:15 +02:00
|
|
|
REM Unless required by applicable law or agreed to in writing, software
|
|
|
|
REM distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
REM WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
REM License for the specific language governing permissions and limitations
|
|
|
|
REM under the License.
|
2015-08-12 23:29:52 +02:00
|
|
|
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
|
|
|
|
|
2020-02-23 05:51:44 +01:00
|
|
|
Echo ERROR: Unrecognized option %1
|
2015-08-12 23:29:52 +02:00
|
|
|
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^>:
|
2020-02-23 05:51:44 +01:00
|
|
|
Echo Identifies the specific configuration for the selected ^<board-name^>.
|
2015-08-12 23:29:52 +02:00
|
|
|
Echo This must correspond to a sub-directory under the board directory at
|
2019-08-09 16:40:22 +02:00
|
|
|
Echo under nuttx/boards/^<arch^>/^<chip^>/^<board^>/.
|
2015-08-12 23:29:52 +02:00
|
|
|
Echo ^<-h^>:
|
|
|
|
Echo Prints this message and exits.
|
|
|
|
|
|
|
|
REM Exit
|
|
|
|
|
|
|
|
:End
|
|
|
|
|