Skip to content

Instantly share code, notes, and snippets.

@drdnar
Last active May 7, 2021 23:41
Show Gist options
  • Save drdnar/8c6c23dc8af43c36a0c2cdbc223138d6 to your computer and use it in GitHub Desktop.
Save drdnar/8c6c23dc8af43c36a0c2cdbc223138d6 to your computer and use it in GitHub Desktop.
CE SDK portable batch file
@echo off
rem Check if we're running Windows 10 or newer.
rem Early versions of Windows 10 didn't support ANSI, but since MS is very aggressive
rem about forcing updates, they're probably not likely to appear.
for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i
echo.
if %VERSION% gtr 9 echo 
echo ================================================================================
echo TI-84 PLUS CE DEVELOPER'S TOOLKIT, PORTABLE
echo ================================================================================
if %VERSION% gtr 9 echo 
echo.
rem Set up paths
set CEDEV=%~dp0
set PATH=%~dp0bin;%PATH%
rem set PREFIX=%~dp0
if NOT "%CEDEV%"=="%CEDEV: =%" goto spaces
rem If a directory was dragged onto this batch file, then run make on the directory.
if "%~1" == "" goto noargs
cd %1
make
echo.
if %VERSION% gtr 9 echo 
echo ================================================================================
echo MAKE COMPLETED, CHECK FOR ANY ERRORS ABOVE
echo ================================================================================
if %VERSION% gtr 9 echo 
echo.
pause
exit
:spaces
if %VERSION% gtr 9 echo 
echo ================================================================================
echo ERROR: There are spaces in your path!
echo makefiles are incompatible with spaces in folder names.
echo ================================================================================
if %VERSION% gtr 9 echo 
echo.
pause
exit
rem Otherwise, just open a command prompt for the user.
:noargs
echo No drag-and-drop target found, dropping into command line.
echo.
cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment