.SUFFIXES: .c .s

STD_DEFINES = -DSYSV -DSYSV386
# -DTCPDEB
STD_CPP_DEFINES = -DSYSV -DSYSV386

GCCFLAGS = -DNO_ASM -fstrength-reduce -fwritable-strings -fpcc-struct-return
CFLAGS = -g -Wall -O2 $(INCLUDES) $(DEFINES) $(STD_DEFINES) $(GCCFLAGS)

INCLUDES = -Ic:/djgpp/include/tcp

AR = ar clq
AS = as
CC = gcc
CPP = cpp $(STD_CPP_DEFINES)
RM = rm
RL = ranlib

OBJS =	pcstat.o bsdname.o fragment.o select.o \
	test.o pcbootp.o sock_dbu.o sock_prn.o \
	sock_ini.o pcbsd.o pcrecv.o pcconfig.o \
	pcbuf.o udp_nds.o udp_dom.o pcicmp.o \
	pcping.o pcarp.o pcsed.o pctcp.o \
	intel.o inchksum.o pcpkt.o elib.o

.c.o:
	$(RM) $@
	$(CC) -c $(CFLAGS) $*.c

.s.o:
	$(RM) $@
	$(CPP) $*.s >$*.i
	$(AS) -o $*.o $*.i
	$(RM) $*.i

all: libwatcp.a

libwatcp.a: $(OBJS)
	$(RM) $@
	$(AR) $@ $(OBJS)
	$(RL) $@
	copy $@ ..\lib
