###
#   for Linux
###
CC= gcc
LIB=
LIB1=-lnsl -lsocket
OPT= -Wall

all: s_sock c_sock su_sock cu_sock s_sock1 s_sock1r c_sock1 c_sock0 addr1 addr2 msb hack tcpt tcptd c_sock_t s_sock1_t s_sock2_t addr1 addr2 udpt udptd udptqd udptq

s_sock: s_sock.c inet.h
	${CC} ${OPT} -o s_sock s_sock.c ${LIB} ${LIB1}

c_sock: c_sock.c inet.h
	${CC} ${OPT} -o c_sock c_sock.c ${LIB} ${LIB1}

c_sock_t: c_sock_t.c inet.h
	${CC} ${OPT} -o c_sock_t c_sock_t.c ${LIB} ${LIB1} -lpthread

su_sock: su_sock.c inet.h
	${CC} ${OPT} -o su_sock su_sock.c ${LIB} ${LIB1}

cu_sock: cu_sock.c inet.h
	${CC} ${OPT} -o cu_sock cu_sock.c ${LIB} ${LIB1}

s_sock1: s_sock1.c inet.h
	${CC} ${OPT} -o s_sock1 s_sock1.c ${LIB} ${LIB1}

s_sock1_t: s_sock1_t.c inet.h
	${CC} ${OPT} -o s_sock1_t s_sock1_t.c ${LIB} ${LIB1} -lpthread

s_sock2_t: s_sock2_t.c inet.h
	${CC} ${OPT} -o s_sock2_t s_sock2_t.c ${LIB} ${LIB1} -lpthread

s_sock1r: s_sock1r.c inet.h
	${CC} ${OPT} -o s_sock1r s_sock1r.c ${LIB} ${LIB1}

c_sock1: c_sock1.c inet.h
	${CC} ${OPT} -o c_sock1 c_sock1.c ${LIB} ${LIB1}

c_sock0: c_sock0.c inet.h
	${CC} ${OPT} -o c_sock0 c_sock0.c ${LIB} ${LIB1}

addr1: addr1.c
	${CC} ${OPT} -o addr1 addr1.c  ${LIB} ${LIB1}

addr2: addr2.c
	${CC} ${OPT} -o addr2 addr2.c  ${LIB} ${LIB1}

msb: msb.c
	${CC} ${OPT} -o msb msb.c  ${LIB} ${LIB1}

hack: hack.c
	${CC} ${OPT} -o hack hack.c  ${LIB} ${LIB1}

tcpt: tcpt.c
	${CC} ${OPT} -o tcpt tcpt.c  ${LIB} ${LIB1}
tcptd: tcptd.c
	${CC} ${OPT} -o tcptd tcptd.c  ${LIB} ${LIB1}
udpt: udpt.c
	${CC} ${OPT} -o udpt udpt.c  ${LIB} ${LIB1}
udptd: udptd.c
	${CC} ${OPT} -o udptd udptd.c  ${LIB} ${LIB1}
udptq: udptq.c
	${CC} ${OPT} -o udptq udptq.c  ${LIB} ${LIB1}
udptqd: udptqd.c
	${CC} ${OPT} -o udptqd udptqd.c  ${LIB} ${LIB1}
clean:
	rm -f s_sock c_sock c_sock0 su_sock cu_sock s_sock1 s_sock1r c_sock1 addr1 addr2 core msb hack tcpt tcptd s_sock1_t s_sock2_t c_sock_t tcpt tcptd udpt udptd
