#
# Makefile for GRAV (GRAphic View 3.0)
#
# (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. 
#
#
#DEFINES   = -DBUG_NCURSES -DUSE_MOUSE
DEFINES   = -DUSE_MOUSE
BINDIR    = /usr/local/bin
MANDIR    = /usr/local/man/man1
OWNER     = root
GROUP     = local
JPEGDIR   = /usr/src/jpeg-5
#
CC        = gcc
LIBS      = -lncurses -lvga $(JPEGDIR)/libjpeg.a gbm.a gbmhist.a gbmscale.a gbmmir.a pnglib.a libgz.a -lm
CFLAGS    = -O2 -I$(JPEGDIR) $(DEFINES)
MODULES   =	config.o	\
		convert.o	\
		directory.o	\
		effects.o	\
		error.o		\
		info.o		\
		input.o		\
		main.o		\
		misc.o		\
		print.o		\
		read.o		\
		readgbm.o	\
		readjpg.o	\
		readpcd.o	\
		readpng.o	\
		screen.o	\
		selector.o	\
		trans.o		\
		view.o


grav :	$(MODULES)
	$(CC) $(CFLAGS) $(MODULES) $(LIBS) -o grav
	@echo
	@echo "                  Remember to delete your old ~/.gravrc File"
	@echo


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

clean:
	rm -f *.o
	rm -f grav

