#
#	Makefile for the Internet communication domain.
#

SHELL = /bin/sh

CC = gcc
AR = ar rcs
CPPFLAGS = -I../../include
CFLAGS = -O2 -Wall -mshort -fomit-frame-pointer

SRCS = inet.c ip.c port.c buf.c udp.c inetutil.c icmp.c if.c loopback.c \
  route.c routedev.c timer.c tcp.c tcpin.c tcpout.c tcputil.c tcpsig.c \
  inetdev.c \
  slip.c sl0.c sl0asm.s \
  plip.c pl0.c pl0asm.s

OBJS = inet.o ip.o port.o buf.o udp.o inetutil.o icmp.o if.o loopback.o \
  route.o routedev.o timer.o tcp.o tcpin.o tcpout.o tcputil.o tcpsig.o \
  inetdev.o \
  slip.o sl0.o sl0asm.o \
  plip.o pl0.o pl0asm.o

all: sock.a

.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@

.s.o:
	$(CC) -c $< -o $@

sock.a: $(OBJS)
	$(AR) $@ $(OBJS)

clean:
	rm -f $(OBJS) sock.a

depend:
	$(CC) -MM $(CPPFLAGS) *.c > depend

ifeq (depend, $(wildcard depend))
include depend
endif
