#!/usr/bin/make all
# Makefile for the Linux ISA netcard diagnostic and setup package.
# Copyright 1999-2003 Donald Becker / Scyld Computing Corporation.
# $Id: Makefile,v 1.3 2005/03/24 04:02:58 becker Exp $

# Make variables you may wish to override.
CFLAGS=-O -Wall -Wstrict-prototypes

# PREFIX may be set by the RPM build to set the effective root.
PREFIX=
# Standard directories, ref. gnumake manual.
prefix = $(PREFIX)/usr/local
exec_prefix = $(prefix)
instdir=$(exec_prefix)/sbin
MANDIR = $(prefix)/man

ifeq ($(wildcard ~/rpmdir),)
  rpmdir = /usr/src/redhat
else
  rpmdir = $(wildcard ~/rpmdir)
endif

# Diagnostic list.
DIAGS=3c515-diag 3c5x9setup at1700-diag atlantic atp-diag e21 eexpress \
      hp+ hp100vg-diag ne2k-diag
#  Others to add later    eisa el3-diag  znet-diag

all:  $(DIAGS)

install:  $(DIAGS)
	install -m 755 $^ $(instdir)
#	mkdir -p $(MANDIR)/man8/
#	install -m 444 netdiag.8 $(MANDIR)/man8/

isa-diag.tgz: Makefile isa-diag.spec $(addsuffix .c, $(DIAGS) $(UTILS)) atp.h
	tar cfvz $@ $^

rpm: isa-diag.tgz isa-diag.spec
	cp -p $< ${rpmdir}/SOURCES/
	rpm -ba isa-diag.spec


.PHONY : most all clean distclean rpm

# Too many standard ways to clean..
clean distclean mostlyclean maintainer-clean:
	-rm -f $(DIAGS)
	-rm -f isa-diag.tgz

