# $Header

target: coljust.dll

all: coljust.dll coljust.bsc

clean:
	del coljust.obj
	del coljust.out
	del coljust.bak
	del coljust.map
	
realclean: clean
	del coljust.dll

CWDIR=c:\cwright


INCDIR=-I$(CWDIR)\cwstart -I$(CWDIR)\include 
LIBDIR=$(CWDIR)\lib
EXEDIR=$(CWDIR)
DLLDIR=.
STARTUP_H=$(CWDIR)\cwstart\cwstart.h
EXPORTS_H=$(CWDIR)\include\exports.h

# W3 sets warning level
# ALw selects large model
# G2 generates 80286 code
# Gs disables stack checking (Ge enables)
# Gw generates Windows prologs/epilogs for real-mode FAR calls
# Od disables optimization
# Ow assumes aliasing only across function calls
# Zp specifies structure packing--should be followed by 1|2|4|8|16
# Zi specifies full debug information
# Zd specifies partial debug info--line numbers only
# FR builds the BSC (browser database) file

CC=cl -c $(INCDIR) -W3 -DMT -ALw -G2sw -Ows -Zpe -FR

# Uncomment to compile with Borland C
#CC=BCC -WD -ml -c -M -v -DBORLAND $(INCDIR)

coljust.obj: coljust.c $(EXPORTS_H) $(STARTUP_H)
	$(CC) coljust.c
	
# comment this line out if you take -FR out of the cl command line
#
coljust.bsc: coljust.sbr
	bscmake -o coljust.bsc coljust.sbr
	
$(DLLDIR)\coljust.dll: coljust.obj $(LIBDIR)\libentry.obj coljust.def $(LIBDIR)\cwstart.lib
	link /CO/NOD/li coljust $(LIBDIR)\libentry,coljust.dll,,libw ldllcew $(LIBDIR)\cwright $(LIBDIR)\cwstart,coljust.def
# Uncomment to link with Borland's tlink
#	tlink /Twd /n /m /v c0dl.obj coljust.obj, $(DLLDIR)\coljust, , cwl cl import $(LIBDIR)\cwright $(LIBDIR)\cwstart,coljust
	rc $(DLLDIR)\coljust.dll
