#   libnet Makefile
#   route|daemon9 <route@infonexus.com>


#   Resolve dots n decimals into hostnames.  Slows things down as DNS name
#   lookups have to be done.
#   default:    disabled.
DEFINES     +=  #-DUSE_NAME


LIBNET      =   libnet.a
INCLUDE     =   include/libnet.h
INSTALL_LOC =   /usr/local/

RANLIB      =   /usr/bin/ranlib
CC          =   /usr/bin/gcc
AR          =   /usr/bin/ar
CFLAGS      =   -O3 -funroll-loops -fomit-frame-pointer -pipe -m486 -Wall
OBJECTS     =   src/inet.o src/socket.o

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

all: libnet

libnet: $(OBJECTS)
	$(AR) -cr $(LIBNET) $(OBJECTS)
	$(RANLIB) $(LIBNET)

dist:   clean
	@(cd ..; rm libnet.tgz; tar cvzf libnet.tgz Libnet/)

test:   libnet
	$(CC) -Wall test.c -o test -L./ -lnet

install: libnet
	install -m 0644 $(LIBNET) $(INSTALL_LOC)lib
	install -m 0644 $(INCLUDE) $(INSTALL_LOC)include

clean:
	rm -f core src/*.o libnet.a test

# EOF
