Files
TeslaRel410/BORLAND/BC45/SOURCE/RTL/RULES.MAK
T
CydandClaude Fable 5 63312e07f9 source410: literal 4.10 source reconstruction + BC++ 4.52 fleet toolchain archived
- BORLAND/: Borland C++ 4.52 (chosen over 4.5 by byte-match: CODE/RP/CW32.LIB
  is identical to 4.52's install lib). BCC32/TLINK32/TLIB/MAKE run natively on
  Win11; CODE/BT/OPT.MAK is the shipped BTL4OPT.EXE's exact flag recipe
  (extender = Borland PowerPack DPMI32, not Phar Lap TNT).
- restoration/source410/: the literal 1995-form reconstruction of the missing
  BT game source (never mixed into CODE/). Round 1-3 state:
  * 6 of 10 surviving original TUs COMPILE CLEAN under the period toolchain
    (BTMSSN, BTCNSL, BTSCNRL, BTTEAM, BTL4MODE, BTL4ARND) - first builds
    since 1996.
  * BT_L4/BTL4APP.CPP pilot reconstruction: 12/12 functions, Fail() lands on
    its binary-recorded line 400 exactly.
  * BT/BTCNSL.HPP: console wire IDs recovered from the binary's ctors
    (Killed=9, Damaged=10, ScoreUpdate=13, DeathWithoutHonor=15 [T1];
    TeamScore=12 flagged [T4]).
  * MUNGA/: 8 engine-header backfills back-dated from the BT412 WinTesla tree
    (VDATA numbering decomp-verified; AUDREND's OpenAL-era virtual removed -
    the period compiler is the drift detector).
  * Tooling: backdate.py (WinTesla->1995 header transform), compile410.sh
    (per-TU verification sweep under authentic OPT.MAK flags).
  * README: corrected roadmap - MECH.HPP is the capstone grown with the mech
    TU reconstructions; BTREG.CPP green = the header-family milestone.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 07:33:26 -05:00

249 lines
9.1 KiB
Makefile

#############################################################################
# In order to make a suite, define one or more of the following #
# #
# DEBUG - Used to build a debuggable version of the RTL. #
# #
# DLL - Used to build the DLL version of the RTL. #
# #
# MODEL - Used to indicate a memory model under DOS, and WIN16. The #
# default is the small model. It should be one of: #
# t = Tiny model (DOS) #
# s = Small model (DOS,WIN16) #
# m = Medium model (DOS,WIN16) #
# c = Compact model (DOS,WIN16) #
# l = Large model (DOS,DPMI16,WIN16) #
# h = Huge model (DOS) #
# #
# MT - Used to include multiple thread support. This is only allowed #
# for WIN32 and OS2. #
# #
# OS - Used to indicate the OS. The default is DOS. It should be #
# one of the following: #
# DOS = 16 bit DOS #
# DPMI16 = 16 bit DPMI #
# WIN16 = 16 bit Windows #
# DPMI32 = 32 bit DPMI #
# WIN32S = 32 bit Windows on 16 bit Windows (Win32s) #
# WIN32 = 32 bit Windows on 32 bit Windows (NT,Chicago,Cairo) #
# OS2 = 32 bit OS/2 #
# #
# PCH - Used to turn on precompiled headers #
# #
#############################################################################
#############################################################################
# Setup some reasonable defaults. #
#############################################################################
!if !$d(OS)
OS = dos
!endif
BC45ROOT = \bc45
!if !$d(RTLROOT)
RTLROOT = $(BC45ROOT)\source\rtl
!endif
#############################################################################
# Setup some useful directories. #
#############################################################################
BC45INCL = $(BC45ROOT)\include
INCLBASE = $(RTLROOT)
LIBDIR = $(RTLROOT)\lib
OBJBASE = $(RTLROOT)\obj\$(OS)
SRCBASE = $(RTLROOT)\source
DEFDIR = $(SRCBASE)\defs\$(OS)
#############################################################################
# Guard against illegal variable combinations and obtain the operating #
# platform specific build rules. #
#############################################################################
!if $(OS) != DOS && $(OS) != WIN16 && $(OS) != DPMI16 && \
$(OS) != DPMI32 && $(OS) != WIN32 && $(OS) != OS2
! error Unknown OS
!endif
!if $(OS) == DOS
! if !$d(MODEL)
MODEL = s
! elif $(MODEL) != t && $(MODEL) != s && $(MODEL) != m &&\
$(MODEL) != c && $(MODEL) != l && $(MODEL) != h
! error Invalid memory model
! endif
!elif $(OS) == DPMI16 || $(OS) == WIN16
! if $(OS) == DPMI16
! if !$d(MODEL)
MODEL = l
! elif $(MODEL) != l
! error Invalid MODEL
! endif
! else
! if !$d(MODEL)
MODEL = s
! elif $(MODEL) != s && $(MODEL) != m && $(MODEL) != c && $(MODEL) != l
! error Invalid MODEL
! endif
! endif
!elif $d(MODEL)
! error The chosen OS does not support MODEL
!endif
!if $d(MT)
! if $(OS) != WIN32 && $(OS) != OS2
! error The chosen OS does not support MT
! endif
!endif
!if $(OS) == DOS && $d(DLL)
! error The chosen OS does not support DLL
!endif
!include $(OS).mak
#############################################################################
# Configure the output paths. #
#############################################################################
.PATH.lib = $(LIBDIR)
.PATH.obj = $(OBJDIR)
.PATH.res = $(OBJDIR)
#############################################################################
# Adjust switches accordingly. #
#############################################################################
!if $d(DEBUG)
CC = $(CC) -v
ASM = $(ASM) -zi
LINK = $(LINK) -v
!endif
#############################################################################
# Implicit source rules. #
#############################################################################
.asm.obj :
$(ASM) $(ASMFLAGS) $*,$(OBJDIR)\;
.c.obj :
$(CC) {$< }
.cas.obj :
$(CC) {$< }
.cpp.obj :
$(CC) {$< }
.def.fst:
$(IMPLIB) $&.lib $&.def
fastlib $&.lib $&.fst
del $&.lib
.rc.res :
$(BRCC) @&&|
-i$(INCLUDES) -fo$(OBJDIR)\$& $<
|
#############################################################################
# The rules for the compiler and assembler configuration files. #
#############################################################################
CFG = rtl.cfg
$(OBJDIR)\rtl.cfg :
copy &&|
$(CFLAGS)
| $@
tasm.cfg :
copy &&|
$(AFLAGS)
| $@
delcfg :
if exist tasm.cfg del tasm.cfg
cfg : $(OBJDIR)\rtl.cfg
#############################################################################
# The rule for building a response file for library creation. #
#############################################################################
librsp :
makersp "-+$(OBJDIR:\=\\)\\%s &\n" &&|
$(OBJS)
| >> $(LIBDIR)\tlib.rsp
#############################################################################
# The rule for building the static RTL. #
#############################################################################
lib : librsp
$(TLIB) $(LIBDIR)\$(LIBNAME)$(MTSUFFIX).lib @tlib.rsp,temp.lst
if exist $(LIBDIR)\$(LIBNAME)$(MTSUFFIX).bak del $(LIBDIR)\$(LIBNAME)$(MTSUFFIX).bak
del temp.lst
#############################################################################
# The rules for building response files for RTL DLL and import library #
# creation #
#############################################################################
dllrsp :
makersp "$(OBJDIR:\=\\)\\!s+\n" &&|
$(OBJS)
| >> $(LIBDIR)\dll.rsp
importrsp :
makersp "-+$(OBJDIR:\=\\)\\!s &\n" &&|
$(IMPOBJS)
| >> $(LIBDIR)\import.rsp
#############################################################################
# The rule for building the RTL DLL. #
#############################################################################
dll : $(LIBDIR)\dll.rsp $(LIBDIR)\import.rsp $(OBJDIR)\version.res
copy &&|
$(DEFDIR)\$(DLLDEF), $(OBJDIR)\version
| dll1.rsp
$(LINK) @dll.rsp,$(DLLNAME),,$(IMPORT), @dll1.rsp
implib $(LIBNAME)$(MTSUFFIX)$(DLLSUFFIX).lib $(DLLNAME).dll
fastlib $(LIBNAME)$(MTSUFFIX)$(DLLSUFFIX).lib $(LIBNAME)$(MTSUFFIX)$(DLLSUFFIX).fst
$(TLIB) $(IMPLIBNAME)-+$(LIBNAME)$(MTSUFFIX)$(DLLSUFFIX).fst
$(TLIB) $(IMPLIBNAME) @import.rsp,nul
del $(LIBNAME)$(MTSUFFIX)$(DLLSUFFIX).lib
del $(LIBNAME)$(MTSUFFIX)$(DLLSUFFIX).fst
del $(IMPLIBNAME).bak
del dll1.rsp
#############################################################################
# The crux of the build process is to build the required response files #
# either the static or dynamic RTLs. As the process scans each directory, #
# the needed objs are built and placed into $(OBJDIR). The rule below #
# makes this possible. #
#############################################################################
ALL = $(OBJDIR)\rtl.cfg
!if $d(OBJS)
ALL = $(ALL) $(OBJS)
! if $d(DLL)
ALL = $(ALL) dllrsp
! else
ALL = $(ALL) librsp
! endif
!endif
!if $d(MISC)
ALL = $(ALL) $(MISC)
!endif
!if $d(DLL)
! if $d(RES)
ALL = $(ALL) $(RES)
! endif
! if $d(IMPOBJS)
ALL = $(ALL) $(IMPOBJS) importrsp
! endif
!endif
!if $d(TASMCFG)
ALL = tasm.cfg $(ALL) delcfg
!endif
objs : $(ALL)