
# *******************************************************
# *                                                     *
# *   Delphi Runtime Library                            *
# *   MAKE script                                       *
# *                                                     *
# *   Copyright (C) 1988,95 Borland International       *
# *                                                     *
# *******************************************************


# Base directory determined either by DELPHI environment variable, or
# the constant supplied here.
!if !$d(DELPHI)
DELPHI = \DELPHI
!endif

# Set up macros for all required directories
BIN   = $(DELPHI)\bin
RTL   = $(DELPHI)\source\rtl
SYS   = $(RTL)\sys
WIN   = $(RTL)\win

# Define the tools to use, based on DEBUG define
!if $d(DEBUG)
TASM = tasm -j.286 -t -w- -z -zd
DCC  = $(BIN)\dcc -t -cw -q -$d+
!else
TASM = tasm -j.286 -t -w- -z
DCC  = $(BIN)\dcc -t -cw -q -$d-
!endif
BRCC  = $(BIN)\brcc

.asm.obj:
 $(TASM) -e -i$(SYS) $*,$*.obj

.asm.obw:
 $(TASM) -e -i$(SYS) -d_Windows_ $*,$*.obw

nul: $(RTL)\delphi.dsl $(WIN)\wincrt.dcu sys\sysutils.dcu $(WIN)\build31.exe

$(RTL)\delphi.dsl: \
sys\system.dcu $(WIN)\wintypes.dcu $(WIN)\winprocs.dcu $(WIN)\messages.dcu 
 copy /b sys\system.dcu+win\wintypes.dcu+win\winprocs.dcu+win\messages.dcu $(RTL)\delphi.dsl

sys\system.dcu: sys\system.tps sys\system.pas \
sys\wapp.obw sys\wlib.obw sys\exit.obw sys\errc.obw sys\varh.obj \
sys\long.obj sys\wmem.obw sys\strh.obj sys\seth.obj sys\fp48.obj \
sys\f48h.obj sys\f48f.obj sys\rand.obj sys\dint.obj sys\wx87.obw \
sys\df48.obj sys\df87.obw sys\sint.obj sys\sf48.obj sys\sf87.obj \
sys\tctl.obw sys\tgpc.obw sys\tchr.obw sys\tstr.obw sys\tbol.obw \
sys\tint.obw sys\tf48.obw sys\tf87.obw sys\tfun.obw sys\fctl.obw \
sys\ffun.obj sys\fdir.obw sys\memh.obj sys\wpar.obw sys\dirh.obw \
sys\char.obj sys\we87.obw sys\objh.obw sys\dmth.obj sys\tpch.obw \
sys\cint.obw sys\cf48.obw sys\cf87.obw sys\tfio.obj sys\lovf.obj \
sys\clsh.obj sys\clsf.obj sys\excp.obw sys\info.obj sys\wi87.obw \
sys\fdiv.obw $(SYS)\wf87.obj
 $(DCC) -u$(SYS) -o$(SYS) sys\system

$(WIN)\wintypes.dcu: sys\system.dcu $(WIN)\wintypes.pas
 $(DCC) -usys $(WIN)\wintypes

$(WIN)\winprocs.dcu: sys\system.dcu $(WIN)\wintypes.dcu $(WIN)\winprocs.pas
 $(DCC) -usys;win $(WIN)\winprocs

$(WIN)\messages.dcu: sys\system.dcu $(WIN)\wintypes.dcu $(WIN)\messages.pas
 $(DCC) -usys;win $(WIN)\messages

$(WIN)\toolhelp.dcu: sys\system.dcu $(WIN)\wintypes.dcu $(WIN)\toolhelp.pas
 $(DCC) -usys;win $(WIN)\toolhelp

sys\sysutils.dcu: sys\system.dcu $(WIN)\wintypes.dcu $(WIN)\winprocs.dcu \
$(WIN)\toolhelp.dcu sys\sysutils.pas sys\sysutils.res sys\sfmt.obw \
sys\ffmt.obw
 $(DCC) -usys;win; sys\sysutils

sys\sysutils.res: sys\sysutils.rc sys\sysutils.inc
 $(BRCC) sys\sysutils

$(WIN)\wincrt.dcu: sys\system.dcu sys\sysutils.dcu $(WIN)\wintypes.dcu \
$(WIN)\winprocs.dcu $(WIN)\messages.dcu $(WIN)\wincrt.pas
 $(DCC) -usys;win $(WIN)\wincrt

$(WIN)\build31.exe: $(WIN)\commdlg.pas $(WIN)\ddeml.pas \
$(WIN)\dlgs.pas $(WIN)\lzexpand.pas $(WIN)\mmsystem.pas \
$(WIN)\ole.pas $(WIN)\ole2.pas $(WIN)\shellapi.pas $(WIN)\stress.pas \
$(WIN)\toolhelp.pas $(WIN)\ver.pas $(WIN)\colordlg.pas \
$(WIN)\cpl.pas $(WIN)\print.pas $(WIN)\wfext.pas
  cd $(WIN)
  $(DCC) -m -u$(SYS) -$$S-,F+ build31
  cd ..
