#
# $Header: /home/intrepid/a/davy/ifstatus/RCS/Makefile,v 1.2 1998/09/21 11:38:36 davy Exp $
#
# Makefile for "ifstatus".
#
# David A. Curry
# Senior Internet Security Analyst
# IBM Emergency Response Service
# 300 Long Meadow Road, M/S 230
# Sterling Forest, NY 10979
# davy@ers.ibm.com
#
# Updated 06 JAN 2001 to Version 1.3 by Rob Thomas robt@cymru.com
#
# $Log: Makefile,v $
#
# Revision 1.3  2001/01/06 15:00:00  robt
# Updated to handle Solaris 8
#
# Revision 1.2  1998/09/21 11:38:36  davy
# Updated to handle Solaris 2.5 and 2.6.
#
# Revision 1.1  1998/09/21 11:35:09  davy
# Initial revision
#
#

#
# To build "ifstatus", you need to edit the OSNAME and LIBS variables
# below, as follows:
#
# Define OSNAME to one of the following:
#
#	OSNAME		Operating System
#	------		-----------------
#	BSD			4.3BSD or similar (try this if your o/s is not listed)
#	HPUX		Hewlett-Packard HP-UX 9.0x (may work on 8.0x too)
#	SUNOS4		Sun Microsystems SunOS 4.1.x (may work on 4.0.x too)
#	SUNOS55		Sun Microsystems SunOS 5.5 (Solaris 2.5)
#	SUNOS56		Sun Microsystems SunOS 5.6 (Solaris 2.6)
#	SUNOS58		Sun Microsystems SunOS 5.8 (Solaris 8)
#
# Define LIBS to one of the following:
#
#	OSNAME		LIBS
#	------		-----------------
#	BSD			(empty)
#	HPUX		(empty)
#	SUNOS4		(empty)
#	SUNOS55		-lkvm -lelf -lnsl -lsocket
#	SUNOS56		-lkvm -lelf -lnsl -lsocket
#	SUNOS58		-lkvm -lelf -lnsl -lsocket
#
OSNAME	= SUNOS58
LIBS	= -lkvm -lelf -lnsl -lsocket

#
# Change SBINDIR, MANDIR, and MANSUF if you want.  They are used with the
# "make install" directive only; you can build and use "ifstatus" even
# if these are wrong for your site.
#
DESTDIR	= 
prefix	= /usr/local
SBINDIR	= $(prefix)/sbin
MANSUF	= 8
MANDIR	= $(prefix)/man/man$(MANSUF)

#INSTALL	= ./install.sh
INSTALL	= install
INSTALLFLAGS	= -D

CFLAGS	= -O -D$(OSNAME)

OBJS	= ifstatus.o if-generic.o if-solaris.o

ifstatus: $(OBJS)
	$(CC) -o $@ $(OBJS) $(LIBS)

install: ifstatus
	$(INSTALL) $(INSTALLFLAGS) -c -s -m 755 ifstatus $(DESTDIR)$(SBINDIR)/ifstatus

install.man:
	$(INSTALL) $(INSTALLFLAGS) -c -m 644 ifstatus.man $(DESTDIR)$(MANDIR)/ifstatus.$(MANSUF)

clean:
	rm -f a.out core ifstatus *.o \#*

distclean: clean
