# --- Auto-generated from Makefile.support.proto ---
#
# QIC-02 driver v0.7.1.6 support files v1.9b installation Makefile
# Jeff Stern <jstern@eclectic.ss.uci.edu>
#
# Makefile for installing Hennus Bergman's QIC-02 tape driver support
# files.. This does NOT do *everything* you need to do to install the
# driver.  See README.tape-0.7.1.6 for instructions on doing complete
# installation for latest version..  -js.

# Did some minor edits to avoid installation if user just types ``make''.
# Version stuff is updated from master files to make maintenance
# easier. -- hhb.


# rmt is now put into /usr/sbin instead of /etc. You may want to symlink it.

USRBIN=/usr/bin
USRSBIN=/usr/sbin
BIN=/bin
SBIN=/sbin
MAN=/usr/man

INSTSTUFF=mt rmt cpio mtreset tapetest edd buffer qic02conf conf-archive \
      conf-mountain conf-wangtek conf-emerald cpio.1 mt.1 buffer.1


.PHONY: dummy
dummy: $(INSTSTUFF)



.PHONY: install
install: $(INSTSTUFF) $(USRBIN) $(BIN) $(SBIN)
	cp mt $(BIN)
	cp rmt $(USRSBIN)
	cp cpio $(USRBIN)
	cp mtreset $(BIN)
	cp tapetest $(USRBIN)
	cp edd $(USRBIN)
	cp buffer $(USRBIN)
	cp qic02conf $(SBIN)
	cp conf-archive $(SBIN)
	cp conf-mountain $(SBIN)
	cp conf-wangtek $(SBIN)
	cp conf-emerald $(SBIN)
	cp cpio.1 $(MAN)/man1
	cp mt.1 $(MAN)/man1
	cp buffer.1 $(MAN)/man1

$(USRBIN):
	mkdir -p $@

$(BIN):
	mkdir -p $@

$(SBIN):
	mkdir -p $@

mtreset: mtreset.c
	gcc -O2 -Wall -s -o $@ $<

tapetest: tapetest.c
	gcc -O2 -Wall -s -o $@ $<

qic02conf: qic02conf.c
	gcc -O2 -Wall -s -o $@ $<


buffer buffer.1: buffer-1.16.tar
	tar -xvf buffer-1.16.tar
	cd buffer-1.16; make buffer; cp buffer .. ; cp buffer.man ../buffer.1

.PHONY: uninstall
uninstall:
	rm -f $(BIN)/mt
	rm -f $(USRBIN)/cpio
	rm -f $(BIN)/mtreset
	rm -f $(USRBIN)/tapetest
	rm -f $(USRBIN)/edd
	rm -f $(USRBIN)/buffer
	rm -f $(SBIN)/qic02conf
	rm -f $(SBIN)/conf-archive
	rm -f $(SBIN)/conf-mountain
	rm -f $(SBIN)/conf-wangtek
	rm -f $(MAN)/man1/cpio.1
	rm -f $(MAN)/cat1/cpio.[0-9]*
	rm -f $(MAN)/man1/mt.1
	rm -f $(MAN)/cat1/mt.[0-9]*
