#
# This file is part of LFT.
#
# The LFT software provided in this Distribution is
# Copyright 2002 MainNerve, Inc.
#
# The full text of our legal notices is contained in the file called
# COPYING, included with this Distribution.

# Normal command to build LFT:
#   make -f Makefile.<port>

# <port> refers to the *standard* compiler/OS on the given system.    
#
# bsd           generic BSD 4.3
# solaris       GCC Solaris
# linux         generic Linux
# darwin        darwin - Mac OS X


# Directory where LFT will be installed:

prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
mandir=@mandir@
INSTALL=@INSTALL@
LN=@LN_S@

# Commands/References

CC=@CC@
CFLAGS=@CFLAGS@
LIBS=@LIBS@
LDFLAGS=@LDFLAGS@

CAT=cat
CD=cd
MKDIR=mkdir -p
BUILDTYPE=build
RM=rm -rf
SH=sh
SYSTEM=unix
TOOLS=tools
TOUCH=touch
@SET_MAKE@

# Specifics

OBJS=lft.o lft_ifname.o whois.o

all: lft

lft: $(OBJS)
	$(CC) -o lft $(OBJS) $(LDFLAGS) $(LIBS) -lm

whois-test: whois.o
	$(CC) -o whois-test whois.c -DSTANDALONE $(LDFLAGS) $(LIBS) -lm

install: lft lft.8
	test -d $(bindir)/. || $(MKDIR) $(bindir)
	$(INSTALL) lft $(bindir)/lft
	@ ( echo chown root $(bindir)/lft && chown root $(bindir)/lft && echo chmod u+s $(bindir)/lft && chmod u+s $(bindir)/lft ) || echo "***" WARNING: could not set $(bindir) suid to root
	test -d $(mandir)/man8/. || $(MKDIR) $(mandir)/man8
	$(INSTALL) lft.8 $(mandir)/man8/lft.8

clean:
	$(RM) *.o core* lft *~

distclean:
	$(RM) Makefile acconfig.h config.log config.status
