#!/bin/bash # compile410.sh -- per-TU compile verification for the 4.10 literal-source # reconstruction, using the fleet's own Borland C++ 4.52 with the authentic # OPT.MAK flags (CODE/BT/OPT.MAK = the BTL4OPT.EXE recipe). # # Usage: # ./compile410.sh [more.cpp ...] compile specific TUs # ./compile410.sh --sweep sweep all surviving originals # # Output .obj files land in the current directory. -DNO_PRECOMPILED_HEADERS # dodges the not-yet-reconstructed mech-family headers (BT.HPP gates on it); # drop it once mech.hpp/btplayer.hpp/mechsub.hpp exist in 1995 form. T=/c/VWE/TeslaRel410 export PATH="$T/BORLAND/BC45/BIN:$PATH" C=c:/VWE/TeslaRel410/CODE/BT R=c:/VWE/TeslaRel410/CODE/RP S=c:/VWE/TeslaRel410/restoration/source410 # include order: BT tree over RP tree over source410 backfills over BC45 INC="$C/BT_L4;$C/BT;$C/MUNGA;$C/MUNGA_L4;$C/MUNGA_L4/SOS/BC4;$R/MUNGA;$R/MUNGA_L4;$R/MUNGA_L4/sos/bc4;$C/MUNGA_L4/LIBDPL;$R/MUNGA_L4/libDPL;$R/MUNGA_L4/libDPL/dpl;$S/MUNGA;$S/BT;$S/BT_L4;c:/VWE/TeslaRel410/BORLAND/BC45/INCLUDE" # CODE/BT/OPT.MAK flags (minus -H PCH, plus the NO_PRECOMPILED_HEADERS dodge) FLAGS="-c -DLBE4 -DDEBUG_LEVEL=0 -DDEBUG_STREAM=cout \ -b -r -ff -AT -k- -N- -v- -5 -a4 -V -Jg -x- -RT- -O2 -w-" one() { r=$(bcc32 $FLAGS -I"$INC" "$1" 2>&1 | grep "^Error" | head -1) if [ -z "$r" ]; then echo "OK $(basename "$1")" else echo "FAIL $(basename "$1"): $(echo "$r" | sed 's/.*Error //')" fi } if [ "$1" = "--sweep" ]; then for f in "$C"/BT/BTMSSN.CPP "$C"/BT/BTCNSL.CPP "$C"/BT/BTREG.CPP \ "$C"/BT/BTSCNRL.CPP "$C"/BT/BTTEAM.CPP "$C"/BT/BTTOOL.CPP \ "$C"/BT/GAUSS.CPP "$C"/BT/PPC.CPP \ "$C"/BT_L4/BTL4MODE.CPP "$C"/BT_L4/BTL4ARND.CPP \ "$S"/BT_L4/*.CPP; do [ -f "$f" ] && one "$f" done else for f in "$@"; do one "$f"; done fi