# $Id: Makefile,v 1.2.10.1 2002/01/25 18:12:26 pbaltz Exp $
#

INSTALL_DIR=/home/mhonarc

all: mh-wrapper

install: mh-wrapper-install

mh-wrapper: mh-wrapper.c
	gcc -O2 -o mh-wrapper mh-wrapper.c

mh-wrapper-install: mh-wrapper
	install -D -g daemon -o mail -m 04750 -s mh-wrapper \
	  $(INSTALL_DIR)/bin/mh-wrapper
	# should test to make sure /usr/adm/sm.bin exists first
	# otherwise automation is a pain
	test -d /usr/adm/sm.bin || mkdir -p /usr/adm/sm.bin
	test -f /usr/adm/sm.bin/mh-wrapper && rm /usr/adm/sm.bin/mh-wrapper \
		|| /bin/true
	ln -s $(INSTALL_DIR)/bin/mh-wrapper /usr/adm/sm.bin/mh-wrapper
