# Makefile -- makefile for fan 
#
# Copyright 1996  Jonathan A. Buzzard (jab@hex.prestel.co.uk)
#
# $Log: Makefile,v $
# Revision 1.3  1998/04/10 20:25:07  jab
# Added ChangeLog generation to dist target
#
# Revision 1.2  1996/07/30 18:14:12  jab
# removed -ansi option from CFLAGS as this causes it to stop
# compiling. changed dist target to be simpler (cvs is a
# bit over the top)
#
# Revision 1.1  1996/06/25 21:50:19  jab
# Initial revision
#
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
# 
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 675 Mass Ave, Cambridge, MA 02139, USA.
#
# $Id: Makefile,v 1.3 1998/04/10 20:25:07 jab Exp jab $
#

VERSION=3.0

CC = gcc
INSTALL = install
DESTDIR = /usr/local
CFLAGS= -m486 -Wall
LDFLAGS= -s

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

fan: fan.o
	$(CC) $(LDFLAGS) -o $@ fan.o

install: fan
	$(INSTALL) -m 4755 fan   $(DESTDIR)/bin
	$(INSTALL) -m 0644 fan.1 $(DESTDIR)/man/man1

clean:
	rm -f *.o *.bak fan core

dist:
	(rm -f *.o *.bak fan core ChangeLog; \
	rcs2log > ChangeLog; \
	rm -rf /tmp/fan-$(VERSION); \
	mkdir /tmp/fan-$(VERSION); \
	cp * /tmp/fan-$(VERSION); \
	cd /tmp/fan-$(VERSION); \
	find -type d | xargs chmod 755; \
	find -type f | xargs chmod 644; \
	find -type d | xargs chown root:root; \
	find -type f | xargs chown root:root; \
	cd ..; \
	tar cvf fan-$(VERSION).tar fan-$(VERSION); \
	gzip -9f fan-$(VERSION).tar; \
	echo Done.)

