.SILENT:

# MAKEFILE to deploy RMRTG, hopefully. $Id: Makefile,v 1.3 2001/12/05 01:55:36 piers Exp $

MRTGEXT=/home/mrtg/ext
MRTGTMP=/home/mrtg/tmp

SERVER=$(MRTGEXT)/rmrtg
CLIENT=$(MRTGEXT)/rmrtgc

default:
	echo ""
	echo "This is a simple Makefile"
	echo "Please tweak the MRTGEXT location near the top of the file"
	echo "to match the location in which you install this sort of thing"
	echo ""
	echo "If I was feeling adventurous I'd make the manpages too"
	echo "" 
	echo "Type: make server - to install the server"
	echo "Type: make client - to install the client"
	echo "Type: make all - installs both, lets you rmrtgc to localhost for testing"
	echo ""

all: server client
server: directories
	echo "rmrtg => $(SERVER) (x)"
	if test -f $(SERVER) && test ! -w $(SERVER); then chmod +w $(SERVER); fi
	cp rmrtg $(SERVER)
	if test ! -x $(SERVER); then chmod a+x $(SERVER); fi

client: directories
	echo "rmrtgc => $(CLIENT) (x)"
	if test -f $(CLIENT) && test ! -w $(CLIENT); then chmod +w $(CLIENT); fi
	cp rmrtgc $(CLIENT)
	if test ! -x $(CLIENT); then chmod a+x $(CLIENT); fi

directories:
	if [ ! -d $(MRTGEXT) ]; then mkdir -p $(MRTGEXT); fi
	if [ ! -d $(MRTGTMP) ]; then mkdir -p $(MRTGTMP); fi

