CC = gcc 
PROGS = streamwrite streamread dgramread dgramsend pipe \
	socketpair strchkread udgramread udgramsend ustreamread \
	ustreamwrite

all:  $(PROGS)

streamwrite: streamwrite.o
	$(CC) -o $@ streamwrite.o -lsocket -lnsl -lc

streamread: streamread.o
	$(CC) -o $@ streamread.o -lsocket -lc

dgramread: dgramread.o
	$(CC) -o $@ dgramread.o -lsocket 

dgramsend: dgramsend.o
	$(CC) -o $@ dgramsend.o -lsocket -lnsl -lc

pipe: pipe.o
	$(CC) -o $@ pipe.o -lsocket 

socketpair: socketpair.o
	$(CC) -o $@ socketpair.o -lsocket 

strchkread: strchkread.o
	$(CC) -o $@ strchkread.o -lsocket -lc

udgramread: udgramread.o
	$(CC) -o $@ udgramread.o -lsocket -lc

udgramsend: udgramsend.o
	$(CC) -o $@ udgramsend.o -lsocket 

ustreamread: ustreamread.o
	$(CC) -o $@ ustreamread.o -lsocket -lc

ustreamwrite: ustreamwrite.o
	$(CC) -o $@ ustreamwrite.o -lsocket 

clean:
	rm -f *.o *~ $(PROGS)
