#
#	Makefile for KA9Q TCP/IP package for PC clones with Microsoft C
#
# switches:
#	define the ones you want in the CFLAGS definition...
#
#	MSC		- Necessary to compile with Microsoft Compiler
#	PKT		- Include IP Packet building code
#	Gs		- Disable Stack Probes (necessary for interrupt
#				driven code)
#	AM		- Medium Model Program: Large Code, Small Data
#	c		- Create .OBJ, don't link

# CFLAGS for typical IBM-PC installation

CFLAGS = /DMSC /DPKT /Gs /AM /c /Zi
DFLAGS = $(CFLAGS)
#DFLAGS = $(CFLAGS) /Zi
LFLAGS = /SEGMENT:500 /STACK:8000
#LFLAGS = /CO /SEGMENT:500 /STACK:8000
LIBS   = 

# Assembler flags

AFLAGS = /Zi /DLARGECODE /ML /MX

NETOBJS= telnet.obj tnserv.obj smisc.obj ftpserv.obj ftpcli.obj \
	 ftp.obj smtpserv.obj smtpcli.obj tcpcmd.obj tcpuser.obj \
	 tcptimer.obj tcpout.obj tcpin.obj tcpsubr.obj udpcmd.obj \
	 udp.obj iface.obj ipcmd.obj ip.obj iproute.obj icmpcmd.obj \
	 icmp.obj pkt.obj arpcmd.obj arp.obj ax25cmd.obj ax25user.obj \
	 ax25.obj ax25subr.obj lapbtime.obj lapb.obj ilcmd.obj eccmd.obj \
	 enet.obj slfp.obj slip.obj kiss.obj timer.obj ttydriv.obj \
	 cmdparse.obj mbuf.obj alloc.obj netuser.obj misc.obj pathname.obj \
	 audit.obj files.obj icmpmsg.obj

NETDUMP= trace.obj enetdump.obj ax25dump.obj arpdump.obj ipdump.obj \
	 icmpdump.obj udpdump.obj tcpdump.obj

PCOBJS=  pc.obj dirutil.obj ec.obj pc100.obj hapn.obj il.obj asy.obj \
	 eagle.obj

ASMOBJS= ecvec.obj pc100vec.obj hapnvec.obj ilvec.obj asyvec.obj eaglevec.obj \
	 pcgen.obj

.c.obj : 
	errout /f nul cl /Fo$*.obj $(CFLAGS) $*.c

.asm.obj : 
	masm $(AFLAGS) $*,$*;

net.exe :  pc.lib net.lib dump.lib makefile main.obj version.obj session.obj
	errout /f nul cl /AM /Fm /Fe$@ main version session /link $(LFLAGS) pc+net+dump+$(LIBS)


net.lib : $(NETOBJS)
	erase net.lib
	lib @net_lib.arf

dump.lib : $(NETDUMP)
	erase dump.lib
	lib @dump_lib.arf

pc.lib : $(PCOBJS) $(ASMOBJS)
	erase pc.lib
	lib @pc_lib.arf



# Included by All .c files
$(NETOBJS) $(NETDUMP) $(PCOBJS): global.h

# Included by All .asm files
$(ASMOBJS): pmacros.h


ALLOC.OBJ:	   alloc.c
ARP.OBJ:	   arp.c mbuf.h timer.h iface.h enet.h ax25.h arp.h iptrace.h
ARPCMD.OBJ:	   arpcmd.c mbuf.h timer.h enet.h ax25.h arp.h cmdparse.h
ARPDUMP.OBJ:	   arpdump.c mbuf.h timer.h arp.h
ASY.OBJ:	   asy.c pc.h timer.h asy.h iface.h
AUDIT.OBJ:	   audit.c mbuf.h
AX25.OBJ:	   ax25.c mbuf.h iface.h timer.h arp.h slip.h ax25.h lapb.h
AX25CMD.OBJ:	   ax25cmd.c mbuf.h ax25.h timer.h iface.h lapb.h cmdparse.h session.h
AX25DUMP.OBJ:	   ax25dump.c mbuf.h ax25.h timer.h iface.h lapb.h trace.h
AX25SUBR.OBJ:	   ax25subr.c mbuf.h timer.h ax25.h lapb.h
AX25USER.OBJ:	   ax25user.c mbuf.h timer.h iface.h ax25.h lapb.h
CMDPARSE.OBJ:	   cmdparse.c cmdparse.h
DIRUTIL.OBJ:	   dirutil.c
EAGLE.OBJ:	   eagle.c mbuf.h iface.h eagle.h ax25.h trace.h
EC.OBJ:		   ec.c mbuf.h enet.h iface.h ec.h timer.h arp.h trace.h pc.h
ECCMD.OBJ:	   eccmd.c mbuf.h iface.h ec.h
ENET.OBJ:	   enet.c mbuf.h enet.h
ENETDUMP.OBJ:	   enetdump.c mbuf.h enet.h trace.h
FILES.OBJ:	   files.c
FTP.OBJ:	   ftp.c mbuf.h netuser.h timer.h iface.h ax25.h lapb.h tcp.h ftp.h session.h
FTPCLI.OBJ:	   ftpcli.c mbuf.h netuser.h icmp.h timer.h iface.h ax25.h lapb.h tcp.h ftp.h session.h cmdparse.h
FTPSERV.OBJ:	   ftpserv.c mbuf.h netuser.h timer.h tcp.h ftp.h
HAPN.OBJ:	   hapn.c mbuf.h iface.h hapn.h ax25.h trace.h
ICMP.OBJ:	   icmp.c mbuf.h internet.h timer.h iface.h ip.h icmp.h iptrace.h
ICMPCMD.OBJ:	   icmpcmd.c timer.h iface.h ip.h icmp.h mbuf.h netuser.h internet.h ping.h iptrace.h
ICMPDUMP.OBJ:	   icmpdump.c mbuf.h internet.h icmp.h trace.h
ICMPMSG.OBJ:	   icmpmsg.c
IFACE.OBJ:	   iface.c iface.h
IL.OBJ:		   il.c mbuf.h enet.h iface.h il.h timer.h arp.h trace.h pc.h ip.h iptrace.h
ILCMD.OBJ:	   ilcmd.c mbuf.h iface.h il.h
IP.OBJ:		   ip.c mbuf.h timer.h internet.h iface.h ip.h icmp.h iptrace.h
IPCMD.OBJ:	   ipcmd.c mbuf.h internet.h timer.h netuser.h iface.h ip.h cmdparse.h iptrace.h
IPDUMP.OBJ:	   ipdump.c mbuf.h internet.h timer.h iface.h ip.h trace.h netuser.h
IPROUTE.OBJ:	   iproute.c mbuf.h internet.h timer.h netuser.h ip.h icmp.h iface.h trace.h iptrace.h
KISS.OBJ:	   kiss.c mbuf.h iface.h kiss.h trace.h
LAPB.OBJ:	   lapb.c mbuf.h timer.h iface.h ax25.h lapb.h
LAPBTIME.OBJ:	   lapbtime.c mbuf.h ax25.h timer.h iface.h lapb.h
MAIN.OBJ:	   main.c config.h mbuf.h netuser.h timer.h icmp.h iface.h ip.h tcp.h ax25.h lapb.h ftp.h telnet.h session.h cmdparse.h unix.h amiga.h mac.h pc.h trace.h iptrace.h
MBUF.OBJ:	   mbuf.c mbuf.h
MISC.OBJ:	   misc.c
NETUSER.OBJ:	   netuser.c netuser.h
PATHNAME.OBJ:	   pathname.c
PC.OBJ:		   pc.c mbuf.h internet.h iface.h pc.h cmdparse.h
PC100.OBJ:	   pc100.c mbuf.h iface.h pc100.h ax25.h trace.h
PKT.OBJ:	   pkt.c timer.h ip.h icmp.h mbuf.h netuser.h internet.h ping.h
SESSION.OBJ:	   session.c config.h mbuf.h netuser.h timer.h iface.h tcp.h ax25.h lapb.h ftp.h telnet.h session.h cmdparse.h
SLFP.OBJ:	   slfp.c mbuf.h iface.h timer.h ip.h slfp.h unix.h pc.h asy.h trace.h
SLIP.OBJ:		   slip.c mbuf.h iface.h timer.h ip.h slfp.h ax25.h slip.h unix.h pc.h asy.h trace.h config.h
SMISC.OBJ:	   smisc.c mbuf.h netuser.h timer.h tcp.h
SMTPCLI.OBJ:	   smtpcli.c netuser.h mbuf.h timer.h tcp.h smtp.h trace.h cmdparse.h
SMTPSERV.OBJ:	   smtpserv.c mbuf.h netuser.h timer.h tcp.h smtp.h
TCPCMD.OBJ:	   tcpcmd.c timer.h mbuf.h netuser.h internet.h tcp.h cmdparse.h
TCPDUMP.OBJ:	   tcpdump.c mbuf.h netuser.h internet.h timer.h tcp.h trace.h
TCPIN.OBJ:	   tcpin.c timer.h mbuf.h netuser.h internet.h tcp.h icmp.h iface.h ip.h
TCPOUT.OBJ:	   tcpout.c timer.h mbuf.h netuser.h internet.h tcp.h
TCPSUBR.OBJ:	   tcpsubr.c timer.h mbuf.h netuser.h internet.h tcp.h
TCPTIMER.OBJ:	   tcptimer.c mbuf.h timer.h netuser.h internet.h tcp.h
TCPUSER.OBJ:	   tcpuser.c timer.h mbuf.h netuser.h internet.h tcp.h
TELNET.OBJ:	   telnet.c mbuf.h timer.h iface.h ax25.h lapb.h icmp.h netuser.h tcp.h telnet.h session.h
TIMER.OBJ:	   timer.c timer.h
TNSERV.OBJ:	   tnserv.c mbuf.h timer.h iface.h ax25.h lapb.h icmp.h netuser.h tcp.h telnet.h session.h
TRACE.OBJ:	   trace.c mbuf.h iface.h trace.h
TTYDRIV.OBJ:	   ttydriv.c
UDP.OBJ:	   udp.c mbuf.h netuser.h udp.h internet.h
UDPCMD.OBJ:	   udpcmd.c mbuf.h netuser.h udp.h internet.h cmdparse.h
UDPDUMP.OBJ:	   udpdump.c mbuf.h netuser.h internet.h udp.h
VERSION.OBJ:	   version.c
X.OBJ:		   x.c config.h stdio.h netuser.h timer.h amiga.h arp.h ax25.h cmdparse.h ctype.h dir.h ftp.h icmp.h iface.h internet.h ip.h kiss.h lapb.h mbuf.h session.h slip.h smtp.h tcp.h telnet.h trace.h udp.h iptrace.h

ASYVEC.OBJ:	   asyvec.asm pmacros.h
EAGLEVEC.OBJ:	   eaglevec.asm pmacros.h
ECVEC.OBJ:	   ecvec.asm pmacros.h
HAPNVEC.OBJ:	   hapnvec.asm pmacros.h
ILVEC.OBJ:	   ilvec.asm pmacros.h
PCGEN.OBJ:	   pcgen.asm pmacros.h
PC100VEC.OBJ:	   pc100vec.asm pmacros.h
