From 807e51ad05056c5f63a901976ff6b1c89f993f8d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 6 Jun 2016 12:30:01 -0600 Subject: [PATCH] Update tools/mkkconfig.bat; silence some Makefile output --- Directory.mk | 2 +- Makefile | 3 +-- tools/mkkconfig.bat | 59 +++++++++++++++++---------------------------- 3 files changed, 24 insertions(+), 40 deletions(-) diff --git a/Directory.mk b/Directory.mk index a9880178e..e02230dd0 100644 --- a/Directory.mk +++ b/Directory.mk @@ -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) diff --git a/Makefile b/Makefile index 6039d15b6..d8c848434 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/tools/mkkconfig.bat b/tools/mkkconfig.bat index c2a2a1986..69082e8c5 100755 --- a/tools/mkkconfig.bat +++ b/tools/mkkconfig.bat @@ -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 REM REM Redistribution and use in source and binary forms, with or without @@ -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 @@ -51,9 +51,9 @@ GOTO :ShowUsage SET debug=-d GOTO :NextArg -:SetTopDir +:SetMenu SHIFT -SET topdir=%1 +SET menu=%1 GOTO :NextArg :SetKconfig @@ -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 ( @@ -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 ^] [-o ^] +Echo USAGE: %0 [-d] [-m ^] [-o ^] Echo %0 [-h] Echo Where: Echo ^<-d^>: Echo Enables debug output -Echo -t ^: -Echo Identifies the top applicatino directory +Echo -m ^: +Echo Menu description Echo -o ^: Echo Identifies the specific configuratin for the selected ^. Echo This must correspond to a sub-directory under the board directory at