buildone.bat 892 B

123456789101112131415161718192021222324252627282930313233343536
  1. @echo off
  2. REM --------------------------------------------------------------------
  3. REM This nifty batch script will compile one tool which is specified
  4. REM on the commandline
  5. REM
  6. REM for example if we want to build ttpack we will call this tool:
  7. REM buildone.bat ttpack
  8. REM
  9. REM if upx is found in the path it will pack the executables otherwise
  10. REM they stay in their original form
  11. REM
  12. REM at the end of the batch script the final executable is moved into
  13. REM the calctools bin directory
  14. REM --------------------------------------------------------------------
  15. echo compiling %1 ...
  16. gcc %1.c -o %1.exe
  17. @IF ERRORLEVEL 1 goto failed
  18. start /min /wait upx -9 %1.exe > nul
  19. @IF ERRORLEVEL 1 goto skipped
  20. goto notskipped
  21. :skipped
  22. echo compression skipped
  23. :notskipped
  24. echo moving executable ...
  25. mkdir bin
  26. move %1.exe bin\
  27. goto end
  28. :failed
  29. pause
  30. goto end
  31. :end