@ECHO OFF : Removes a regenerates any local MK in the [SKD]\kernels\mk folder using as reference all the .TM files found. :: This script is supposed to be at .git\hooks folder of the SKD SET "SCRIPT_PATH=%~dp0" cd %SCRIPT_PATH% cd .. cd .. SET "SKD_PATH=%cd% SET "KERNELS_PATH=%SKD_PATH%\kernels" SET "MKS_PATH=%KERNELS_PATH%\mk" :: Go to MK folder if exist %MKS_PATH% ( :: Goto MKs folder cd %MKS_PATH% echo Removing old local Meta-Kernels... del *_local.TM echo Creating updated local Meta-Kernels... for /r "%MKS_PATH%" %%f in (*.TM) do ( %SCRIPT_PATH%update_local_mk.bat %%~nxf %KERNELS_PATH% %%~nf_local.TM ) del *_local_local.TM cd %SCRIPT_PATH% echo Local Meta-Kernels updated successfully... :: pause :: exit 0 ) else ( echo "Invalid path: %MKS_PATH% , aborted." :: pause :: exit 1 )