#
# Makefile for vh (volks-hypertext) browser
#
#	@(#)Makefile	1.3
#
# Set your system type and I/O facilities
# -DUNIX   	-- The OS is UNIX
# -DATT		-- The OS is AT&T UNIX (System III, System V)
# -DBSD		-- The OS is Berkeley UNIX
# -DMSDOS  	-- The OS is MSDOS
# -DCURSES 	-- curses(3) character-oriented screen handling
# -DAMIGA	-- Generate for the Amiga, using Amiga curses
# -DATTMOUSE	-- AT&T 6386 /dev/mouse
# -DPOPUP	-- text entry via Mac-like dialogue boxes.
# -DCONST	-- your C has `const'
#
# If you're using Borland Turbo-C under MS-DOS, see TurboMake
#
SYSTYPE=-DUNIX -DCURSES -DATT -DSCROLLBAR -DATTMOUSE #-DPOPUP

CFLAGS  = -O $(SYSTYPE)
LDFLAGS = -s

jargon: vh
	mv vh jargon

vh: vh.o browse.o screen.o
	$(CC) vh.o browse.o screen.o $(LDFLAGS) -lcurses -o vh

vh.o: vh.c vh.h
browse.o: browse.c vh.h screen.h
screen.o: screen.c screen.h

vh.lpr: vh.1
	nroff -Tlp -man vh.1 >vh.lpr

clean:
	rm -f vh vh.o browse.o screen.o vh.shar vh.lpr TAGS *~

SOURCES	= vh.h vh.c screen.h screen.c browse.c
ALL	= READ.ME README.AMIGA COPYING vh.1 Makefile TurboMake $(SOURCES)

vh.shar: $(ALL)
	shar $(ALL) >vh.shar

vh.tar: $(ALL)
	tar cvf vh.tar $(ALL)

vh.tar.Z: vh.tar
	compress vh.tar

vh.cpio.Z: $(ALL)
	echo $(ALL) | tr ' ' '\012' | cpio -ocv >vh.cpio
	compress -b 14 vh.cpio

browser.arc: $(ALL) vh.lpr
	rm -f browser.arc arcdir/*
	cp $(ALL) vh.lpr arcdir
	cd arcdir; arc mi ../browser.arc $(ALL) vh.lpr
	# This calculation multiplies by 2 to account for XMODEM overhead
	@set - `ls -l browser.arc`; echo "2400bps xmodem upload should take ~" `echo "$$5 / 9000" | bc` minute\(s\)."

TAGS: $(SOURCES)
	etags $(SOURCES)
