#
# /emx/src/lib/socket/makefile
#
.INCLUDE: /emx/src/lib/lib0.mak

.SOURCE.c: ..
.SOURCE.h: ..
.SOURCE.s: ..

.PHONY: clean default dstlib socket

LIBSOCKET=$(L)socket.a

LIBC_CCFLAGS = -D__ST_MT_ERRNO__

default:    socket

socket .SETDIR=$(CPU):
	$(MAKE) -f ../makefile dstlib $(PASSDOWN)

dstlib: $(LIBSOCKET)

clean:
	-del $(CPU)\*.o $(DELOPT)

accept.o: accept.c $(I)emx/syscalls.h $(ERRNO) $(FCNTL) $(I)emx/io.h
bind.o: bind.c $(I)emx/syscalls.h
connect.o: connect.c $(I)emx/syscalls.h
gethosti.o: gethosti.c $(I)emx/syscalls.h
gethostn.o: gethostn.c $(I)emx/syscalls.h
getpeern.o: getpeern.c $(I)emx/syscalls.h
gnetbyad.o: gnetbyad.c $(I)stdlib.h $(I)emx/syscalls.h
gnetbyna.o: gnetbyna.c $(I)stdlib.h $(I)emx/syscalls.h
gprotbna.o: gprotbna.c $(I)stdlib.h $(I)emx/syscalls.h
gprotbnu.o: gprotbnu.c $(I)stdlib.h $(I)emx/syscalls.h
getsockh.o: getsockh.c $(I)emx/syscalls.h
getsockn.o: getsockn.c $(I)emx/syscalls.h
getsocko.o: getsocko.c $(I)emx/syscalls.h
ghostbya.o: ghostbya.c $(I)stdlib.h $(I)emx/syscalls.h $(ERRNO) \
		$(S)types.h $(I)netdb.h
ghostbyn.o: ghostbyn.c $(I)stdlib.h $(I)emx/syscalls.h $(ERRNO) \
		$(S)types.h $(I)netdb.h
gservbyn.o: gservbyn.c $(I)stdlib.h $(I)emx/syscalls.h
gservbyp.o: gservbyp.c $(I)stdlib.h $(I)emx/syscalls.h
herror.o: herror.c $(I)stdio.h $(S)types.h $(I)netdb.h
herrno.o: herrno.c
impsockh.o: impsockh.c $(I)emx/syscalls.h $(FCNTL) $(I)emx/io.h
inetaddr.o: inetaddr.c $(I)stdlib.h $(I)ctype.h $(S)types.h $(I)netinet/in.h
inetlnao.o: inetlnao.c $(S)types.h $(I)netinet/in.h
inetmkad.o: inetmkad.c $(S)types.h $(I)netinet/in.h
inetneto.o: inetneto.c $(S)types.h $(I)netinet/in.h
inetnetw.o: inetnetw.c $(I)stdlib.h $(I)ctype.h $(S)types.h $(I)netinet/in.h
inetntoa.o: inetntoa.c $(I)stdio.h $(S)types.h $(I)netinet/in.h
listen.o: listen.c $(I)emx/syscalls.h
recv.o: recv.c $(I)emx/syscalls.h
recvfrom.o: recvfrom.c $(I)emx/syscalls.h
send.o: send.c $(I)emx/syscalls.h
sendto.o: sendto.c $(I)emx/syscalls.h
setsocko.o: setsocko.c $(I)emx/syscalls.h
shutdown.o: shutdown.c $(I)emx/syscalls.h
socket.o: socket.c $(I)emx/syscalls.h $(ERRNO) $(FCNTL) $(I)emx/io.h
swapl.o: swapl.s
swaps.o: swaps.s

$(LIBSOCKET): accept.o bind.o connect.o gethosti.o gethostn.o getpeern.o \
    getsockh.o getsockn.o getsocko.o ghostbya.o ghostbyn.o gnetbyad.o \
    gnetbyna.o gprotbna.o gprotbnu.o gservbyn.o gservbyp.o herror.o herrno.o \
    impsockh.o inetaddr.o inetlnao.o inetmkad.o inetneto.o inetnetw.o \
    inetntoa.o listen.o recv.o recvfrom.o send.o sendto.o setsocko.o \
    shutdown.o socket.o swapl.o swaps.o ../tcp32dll.imp
	emximp -o $(LIBSOCKET) ../tcp32dll.imp
	$(AR) r $(LIBSOCKET) *.o
