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


#   This is kludgey, I know.  I'll fix it later.  Choose one, not both.
DEFINES     +=   -DLINUX
DEFINES     +=   #-DBSD

#   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/

VER         =   0.4
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 src/daemon.o

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

all: libnet

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

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

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

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

# EOF
