#
# Makefile for GRAV (GRAphic View 3.5)
#
# (C) Michael Knigge, 1995
#
#
# You must be root to install GRAV because GRAV have to run setuid root.
# If GRAV will not run setuid root, svgalib can't get the required permissions
# to do the VGA I/O !!!!
#
#
# If you use a ncurses version > 1.8.7 and < 1.9.1a, you have to
# define BUG_NCURSES beecause this releases have some bugs.
#
#
# Since version 3.1 you can use the mouse for scrolling. But I've noticed
# some problems when  gpm  is running on my machine (no problems with
# selection). So if you want to get sure GRAV is running correctly, don't 
# define USE_MOUSE. 
#
#
BINDIR     = /usr/local/bin
MANDIR     = /usr/local/man/man1
# 
JPEG_INC   = /usr/src/jpeg-5
JPEG_LIB   = /usr/src/jpeg-5
#
SVGA_INC   = /usr/local/include
SVGA_LIB   = /usr/local/lib
#
NCUR_INC   = /usr/include/ncurses
NCUR_LIB   = /usr/lib
#
export LIB = -L$(SVGA_LIB) -L$(NCUR_LIB) -lncurses -lvga $(JPEG_LIB)/libjpeg.a
export INC = -I$(JPEG_INC) -I$(SVGA_INC) -I$(NCUR_INC) 
export DEF = -DUSE_MOUSE
#
SUBDIRS	  = zlib plib gbm/gbm src
#

grav :	
	@for i in $(SUBDIRS); do $(MAKE) -C $$i; done


install:
	install -s -g root -o root -m 6555 src/grav   $(BINDIR)
	install -c -g root -o root -m 0444 src/grav.1 $(MANDIR)
	@echo
	@echo "                  Remember to delete your old ~/.gravrc File"
	@echo

clean:
	@for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
