Files
BT412/game/original/BT_L4/BTL4.MAK
T
arcattackandClaude Opus 4.8 7b7d465e5e Initial commit: bt411 -- standalone Windows BattleTech (Tesla 4.10 port)
Clean, self-contained extraction of the BattleTech-specific work from the
reverse-engineering workspace -- engine + game + content + build, with nothing
from Red Planet or the raw archive dumps. Builds green (Win32) and runs the
single-player drive->animate->target->fire->damage->destroy loop out of the box.

Layout:
  engine/   MUNGA + MUNGA_L4 shared 2007 engine, carrying our BT render/loader
            work (bgfload/L4D3D/L4VIDEO: BSL bit-slice decode, LOD/ground/shadow
            models) + image codec; the minimal rp/ headers the audio HAL needs
  game/     reconstructed BT logic + surviving-original BT source + fwd shims
            + WinMain launcher
  content/  full runtime tree (BTL4.RES, VIDEO/, GAUGE/, AUDIO/, eggs, BTDPL.INI)
  docs/     format specs + reconstruction ledgers
  reference/ raw Ghidra pseudocode (recon source-of-truth) + decomp exporter
  tools/    MP console emulator + map/resource scanners

One top-level CMake builds munga_engine lib + bt410_l4 game lib + btl4.exe.
All paths relativized (186 fwd shims + ~437 CMake abs paths -> repo-relative);
DXSDK is the one external, overridable via -DDXSDK. Verified: builds to a
byte-identical 2.27MB exe and runs combat (TARGET DESTROYED, 0 crashes) against
the bundled content.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-05 21:03:40 -05:00

154 lines
3.1 KiB
Makefile

.autodepend
.cacheautodepend
.suffixes: .cpp
!ifndef BTYPE
!error BTYPE macro not supplied
!endif
!ifndef BPATH
!error BPATH macro not supplied
!endif
!include make.cfg
!include $(BPATH)
TARGET_DIR = $(BTL4_ROOT)\$(BTYPE)
TARGET_PATH = $(TARGET_DIR)\\
.path.obj = $(TARGET_DIR)
.path.lib = $(LIBRARY_PATH)
LIB_PREFIX = -+$(TARGET_DIR)\\
CFG_FILE = $(TARGET_DIR)\$(BTYPE).cfg
HEADER_FILE = btl4$(BTYPE).csm
#------------------------------------------------------------------------------
# Library targets
#
all:\
$(CFG_FILE) $(TARGET_DIR)\btl4$(BTYPE).exe $(TARGET_DIR)\btl4tool.exe\
$(TARGET_DIR)\mechbld.exe
clean:
del $(TARGET_DIR)\*.obj
del $(TARGET_DIR)\*.lib
del $(TARGET_DIR)\*.exe
del $(TARGET_DIR)\*.bak
del $(TARGET_DIR)\*.cfg
assemble:
@echo No assembly targets
#------------------------------------------------------------------------------
# Implicit rules
#
!include $(BTYPE).mak
!ifndef STARTUP_OBJ
!error STARTUP_OBJ macro is not defined
!endif
!ifndef STARTUP_LIBS
!error STARTUP_LIBS macro is not defined
!endif
{$(INCLUDE_PATH)}.cpp{$(TARGET_DIR)}.obj:
$(BCC) @$(CFG_FILE) $< >>error.log
{$(INCLUDE_PATH)}.c{$(TARGET_DIR)}.obj:
$(BCC) @$(CFG_FILE) $< >>error.log
{$(BTL4_ROOT)}.asm{$(TARGET_DIR)}.obj:
tasm32 -ml $(TASM_OPTIONS) -i$(BTL4_ROOT) $<,$@ >>error.log
#------------------------------------------------------------------------------
# Game
#
$(TARGET_DIR)\btl4$(BTYPE).exe: \
$(BTL4_ROOT)\btl4.mak l4stub.lib stub.lib $(TARGET_DIR)\btl4.lib\
bt.lib mungal4.lib munga.lib btl4.obj $(BTYPE).mak\
$(DPL_ROOT)\libdpl.lib
tlink32 @&&|
$(LINK_OPTIONS) +
$(STARTUP_OBJ)+
$(TARGET_DIR)\btl4.obj
$<,$*
l4stub.lib+
stub.lib+
munga.lib+
mungal4.lib+
$(DPL_ROOT)\libdpl.lib+
bt.lib+
$(TARGET_DIR)\btl4.lib+
$(STARTUP_LIBS)
| >>error.log
btl4.obj: $(CFG_FILE)
#------------------------------------------------------------------------------
# Tools
#
$(TARGET_DIR)\btl4tool.exe: \
$(BTL4_ROOT)\btl4.mak l4stub.lib stub.lib $(TARGET_DIR)\btl4.lib\
bt.lib mungal4.lib munga.lib btl4tool.obj $(BTYPE).mak\
$(DPL_ROOT)\libdpl.lib
tlink32 @&&|
$(LINK_OPTIONS) +
$(STARTUP_OBJ)+
$(TARGET_DIR)\btl4tool.obj
$<,$*
l4stub.lib+
stub.lib+
munga.lib+
mungal4.lib+
$(DPL_ROOT)\libdpl.lib+
bt.lib+
$(TARGET_DIR)\btl4.lib+
$(STARTUP_LIBS)
| >>error.log
btl4tool.obj: $(CFG_FILE)
#------------------------------------------------------------------------------
# Mech builder
#
$(TARGET_DIR)\mechbld.exe:\
$(BTL4_ROOT)\btl4.mak mechbld.obj stub.lib munga.lib $(BTYPE).mak
tlink32 @&&|
$(LINK_OPTIONS) +
$(STARTUP_OBJ)+
$(TARGET_DIR)\mechbld.obj
$<,$*
stub.lib+
munga.lib+
$(STARTUP_LIBS)
| >>error.log
mechbld.obj: $(BCC_CONFIG) $(BTYPE).mak
#------------------------------------------------------------------------------
# Battletech library
#
BTL4_OBJS = \
?btl4mode.obj \
?btl4rdr.obj \
?btl4gaug.obj \
?btl4gau2.obj \
?btl4gau3.obj \
?btl4grnd.obj \
?btl4galm.obj \
?btl4vid.obj \
?btl4mppr.obj \
?btl4arnd.obj \
?btl4mssn.obj \
?btl4app.obj \
?btl4pb.obj
$(BTL4_OBJS:?=): $(CFG_FILE)
$(TARGET_DIR)\btl4.lib: $(BTL4_OBJS:?=) $(BTL4_ROOT)\btl4.mak
tlib $@ $(LIB_OPTIONS) @&&|
$(BTL4_OBJS:?=$(LIB_PREFIX))
| >>error.log