all: bat2csh.exe

# Directory containing lex
LXDIR = C:\BIN\UNX
# Directory containing compiler
CCDIR = C:\BORLANDC\BIN
# Directory containing linker
LKDIR = C:\BORLANDC\BIN
# Temporary directory (ram drive)
TMP = E:\TEMP
# Location of precompiled headers
HEADERS = $(TMP)\STDCDEF.SYM

# Filenames of lex, compiler, linker
LX = $(LXDIR)\FLEX
CC = $(CCDIR)\BCC
LK = $(LKDIR)\TLINK

# Memory model
M  = s

# Options for lex, compiler, linker
LXOPT = -i -I -L -S$(LXDIR)\FLEX.SKL
CCOPT = -c -m$(M) -d -N -O1 -K -X -H=$(HEADERS) -w -w-rch -w-ccc
LKOPT = /c /x

# Start-up obj & libraries to link
SOBJ = C0$(M)
LIBS = C$(M)

lexyy.c: bat2csh.l $(LXDIR)\flex.skl
        $(LX) $(LXOPT) bat2csh.l

lexyy.obj: lexyy.c
	$(CC) $(CCOPT) lexyy.c

bat2csh.exe: lexyy.obj
	$(LK) $(LKOPT) $(SOBJ) lexyy, bat2csh, , $(LIBS)
