## Compiler, linker, and lib stuff
## Makefile for use with Watcom OS/2 Executable

CC=wpp386
CCASM=WASM
LINK=wlink
CCASMOPT=/5s /fp5 /bt=DOS4GW /mf

#disabled for faster compiler
LFLAGS=sys os2v2_pm op st=32768 op version=64.02 debug all
CFLAGS=/5s /bt=os2 /DOS2_PM /DOS2 /DMULTITHREAD /d2
#LFLAGS=sys os2v2_pm op st=32768 op version=70.10
#CFLAGS=/zp4 /5s /fp5 /bm /mf /oantrlexi /bt=os2 /DOS2_PM /DOS2 /DMULTITHREAD

## variables
#OBJS = FILE rg-486.obj,rg-6x86.obj,rg-k6.obj,rg-k5.obj,rc5p5brf.obj,rg-p6.obj,cliconfig.obj,&
#autobuff.obj,buffwork.obj,mail.obj,client.obj,iniread.obj,network.obj,rc5.obj,scram.obj
OBJS = FILE rg-486.obj,rg-6x86.obj,rg-k5.obj,rc5p5brf.obj,rg-p6.obj,cliconfig.obj,&
autobuff.obj,buffwork.obj,mail.obj,bdeslow.obj,client.obj,iniread.obj,network.obj,rc5.obj,scram.obj,&
des-x86.obj,bdeshgh.obj,convdes.obj,BBDESLOW.OBJ,BBDESHGH.OBJ,X86IDENT.OBJ,&
myclient.obj,rc5pm.obj

#LINKOBJS = cliconfig.obj client.obj rc5.obj autobuff.obj iniread.obj network.obj scram.obj &
#RG-486.OBJ RG-6X86.OBJ RG-K6.OBJ RG-K5.OBJ mail.obj rc5p5brf.obj rg-p6.obj buffwork.obj
LINKOBJS = cliconfig.obj bdeslow.obj client.obj rc5.obj autobuff.obj iniread.obj network.obj scram.obj &
RG-486.OBJ RG-6X86.OBJ RG-K5.OBJ mail.obj rc5p5brf.obj rg-p6.obj buffwork.obj des-x86.obj &
bdeshgh.obj convdes.obj BBDESLOW.OBJ BBDESHGH.OBJ X86IDENT.OBJ myclient.obj rc5pm.obj

LIBFILES = libf so32dll.lib,tcp32dll.lib

BINNAME=rc5pm.exe

$(BINNAME): $(LINKOBJS) rc5pm.res
	$(LINK) $(LFLAGS) NAME $(BINNAME) $(OBJS) $(LIBPATH) $(LIBFILES)
	rc -p -x1 rc5pm.res rc5pm.exe

myclient.obj: myclient.h myclient.cpp rc5gui.h
	$(CC) $(CFLAGS) myclient.cpp

rc5pm.obj: rc5gui.h rc5pm.cpp myclient.h
	$(CC) $(CFLAGS) rc5pm.cpp

rc5pm.res : rc5pm.rc rc5pm.dlg
	rc -x1 -r rc5pm.rc rc5pm.res

convdes.obj : convdes.cpp
	$(CC) $(CFLAGS) convdes.cpp

cliconfig.obj : cliconfig.cpp client.h rc5.h scram.h mail.h network.h iniread.h
	$(CC) $(CFLAGS) cliconfig.cpp

client.obj : client.cpp client.h rc5.h scram.h mail.h network.h iniread.h
	$(CC) $(CFLAGS) client.cpp

rc5.obj : rc5.cpp rc5.h network.h cputypes.h autobuff.h
	$(CC) $(CFLAGS) rc5.cpp

des-x86.obj : des-x86.cpp rc5.h
	$(CC) $(CFLAGS) des-x86.cpp

autobuff.obj : autobuff.cpp autobuff.h cputypes.h
	$(CC) $(CFLAGS) autobuff.cpp

network.obj : network.cpp network.h cputypes.h autobuff.h
        $(CC) $(CFLAGS) network.cpp

iniread.obj : iniread.cpp iniread.h cputypes.h
	$(CC) $(CFLAGS) iniread.cpp

scram.obj : scram.cpp scram.h cputypes.h
	$(CC) $(CFLAGS) scram.cpp

mail.obj : mail.cpp mail.h network.h client.h cputypes.h autobuff.h rc5.h scram.h mail.h network.h iniread.h
        $(CC) $(CFLAGS) mail.cpp

buffwork.obj : buffwork.cpp client.h rc5.h scram.h mail.h network.h iniread.h
	$(CC) $(CFLAGS) buffwork.cpp

rg-486.obj : rg-486.asm
        $(CCASM) $(CCASMOPT) rg-486.asm

rg-6x86.obj : rg-6x86.asm
        $(CCASM) $(CCASMOPT) rg-6x86.asm

rc5p5brf.obj : rc5p5brf.asm
        $(CCASM) $(CCASMOPT) rc5p5brf.asm

rg-p6.obj : rg-p6.asm
        $(CCASM) $(CCASMOPT) rg-p6.asm

rg-k5.obj : rg-k5.asm
        $(CCASM) $(CCASMOPT) rg-k5.asm

rg-k6.obj : rg-k6.asm
        $(CCASM) $(CCASMOPT) rg-k6.asm

