@echo off REM rugxulo at gmail dot com REM http://rugxulo.googlepages.com REM REM Friday, April 18, 2008 2:20am REM REM N.B. UPX'd DJGPP binaries run slower on XP or Vista! REM For faster speed (if it affects you), unpack 'em. if not exist %0 %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 if "%1"=="/gcc" goto gcc if "%1"=="clean" if exist tdep.exe if exist *.o del *.o if "%1"=="clean" if exist tdep.exe del tdep.exe if "%1"=="clean" goto end set ME=%0 for %%a in (bj_ctype block cfgfile diff ed) do if not exist %%a.c goto end REM This makes the smallest .EXE with all output formats available for use REM set N1=-Os -march=i386 REM This omits slow optimizations for faster compile (e.g. slow machines) REM set N1=-O REM This is default, to compile with all speed optimizations (runs faster) set N1=-O2 REM set N2=-Wall -m486 -fomit-frame-pointer -finline-functions set N2=-Wall REM let .BAT options affect compilation (easier than modifying manually) REM e.g. "-O0" here overrides all optimizations previously requested :opts if "%1"=="" goto setup set N1=%N1% %1 shift goto opts :setup echo. echo Making TDE 5.1v (w/ macro patch) via DJGPP (no dopey makefile needed!) echo. if not "%OS%"=="Windows_NT" choice /n /t:n,10 Do you wish to continue? if errorlevel 2 goto end :begin call %ME% /gcc bj_ctype.c if not exist bj_ctype.o goto end call %ME% /gcc block.c call %ME% /gcc cfgfile.c call %ME% /gcc config.c if not exist config.o goto end call %ME% /gcc djgpp\console.c call %ME% /gcc djgpp\criterr.c if not exist criterr.o goto end call %ME% /gcc default.c if not exist default.o goto end call %ME% /gcc dialogs.c call %ME% /gcc diff.c call %ME% /gcc dirlist.c call %ME% /gcc ed.c if not exist ed.o goto end call %ME% /gcc file.c call %ME% /gcc filmatch.c call %ME% /gcc findrep.c if not exist findrep.o goto end call %ME% /gcc global.c call %ME% /gcc help.c call %ME% /gcc hwind.c if not exist hwind.o goto end call %ME% /gcc macro.c call %ME% /gcc main.c call %ME% /gcc memory.c if not exist memory.o goto end call %ME% /gcc menu.c call %ME% /gcc movement.c call %ME% /gcc djgpp\port.c if not exist port.o goto end call %ME% /gcc prompts.c call %ME% /gcc pull.c call %ME% /gcc query.c if not exist query.o goto end call %ME% /gcc regx.c call %ME% /gcc sort.c call %ME% /gcc syntax.c if not exist syntax.o goto end call %ME% /gcc tab.c call %ME% /gcc undo.c call %ME% /gcc utils.c call %ME% /gcc window.c call %ME% /gcc wordwrap.c gcc -s -o tdep.exe *.o if exist macro.fix goto pack echo. echo ... applying macro fix ... echo. echo s+c+9 Macro > macro.fix echo JumpToPosition "1295:23\n" " && !g_status.stop" File >> macro.fix echo RecordMacro >> macro.fix for %%a in (macro.c macro.fix tdep.exe) do if not exist %%a goto pack tdep -i macro.fix -e s+c+9 macro.c call %ME% /gcc macro.c echo on gcc -s -o tdep.exe *.o @echo off :pack set N1= set N2= echo. if not "%OS%"=="Windows_NT" choice /n /t:n,10 Pack the .EXE via UPX? if errorlevel 2 goto end REM upx --ultra-brute tdep.exe upx --best --lzma --all-filters tdep.exe goto end :gcc shift echo on gcc -c -DNDEBUG -I. %N1% %N2% %1 %2 %3 %4 %5 %6 %7 %8 %9 @echo off goto adios :end set N1= set N2= set ME= :adios