# bvi - Binary Visual Editor Makefile
#
# Makefile for bvi - binary visual editor
#
# Copyright (c) 1996 by Gerhard Buergmann
# 
# 96-01-18 Version 1.0
#
#########################################
OBJS   =  bvi.o comm.o set.o re.o io.o
SOURCE =  bvi.c comm.c set.c re.c io.c
HEADER =  bvi.h set.h
DEST   =  /usr/local/bin
MAN    =  /usr/man/man1

make:
	@echo "Usage: make platform"
	@echo "       platforms: sun4 solaris linux osf1 hpux default"

default:
	make bvi "CC = cc"\
		"CFLAGS = -c -O2"\
		"LIB = -lcurses"

# For SunOS 4 use the curses.3v library
sun4:
	make bvi "CC = /usr/5bin/cc"\
		"CFLAGS = -c -O2"\
		"LIB = -lcurses"

# For Solaris 2 and gcc
solaris:
	make bvi "CC = gcc"\
		"CFLAGS = -c -O2 -L/usr/lib -L. -DSYSV"\
		"LIB = -lcurses"

# For Linux use gcc and ncurses
linux:
	make bvi "CC = gcc"\
		"CFLAGS = -c -O2 -I/usr/include/ncurses"\
		"LIB = -lncurses"

# For HP-UX 9 use MINICURSES
hpux:
	make bvi "CC = cc"\
		"CFLAGS = -c -DMINICURSES"\
		"LIB = -lcurses"

# For OSF/1 no getmaxyx()	
osf1:
	make bvi "CC = cc"\
		"CFLAGS = -c -O2 -DNOGETMAXYX"\
		"LIB = -lcurses"

bvi: $(OBJS)
	$(CC) -o bvi $(OBJS) $(LIB)

.c.o: $*.c $(HEADER)
	$(CC) $(CFLAGS) $*.c

install:
	install bvi.1 $(MAN)
	install -s bvi $(DEST)
	cd $(DEST)
	ln bvi bview
	ln bvi bvedit
	
clean:
	/bin/rm -f core *.o bvi a.out
