# Makefile for get/gmr27 directory
#
# DEST is where to install the tools 
# RI is the include directory for RLE files
# RL is the library directory (for librle.a)

DEST = ../../../bin
RI = ../../include
RL = ../../lib

# -lfb is Grinnell GMR27 library
LIBES = $(RL)/librle.a -lfb
CFLAGS = -O $(DFLAGS) $(IFLAGS)
IFLAGS = -I. -I$(RI)
# System V make pays attention to the SHELL environment variable. Override it.
SHELL = /bin/sh

# Executables.  The .out will be stripped off in the install action.

G_C_FILES =\
	getgmr.c\
	XtndRunget.c\
	bread.c

G_O_FILES =\
	getgmr.o\
	XtndRunget.o\
	bread.o

all: getgmr.out

# getgmr - read RLE file to Grinnell GMR27
getgmr.out: $(G_O_FILES) 
	${CC} $(CFLAGS) $(G_O_FILES) $(LIBES) -o getgmr.new
	mv getgmr.new getgmr.out

# Incremental install, copies executable to DEST dir.
install: install-pgm
install-pgm: getgmr.out
	cp getgmr.out $(DEST)/getgmr
	touch install-pgm

# Clean up installed stuff and binaries
pristine: clean
	rm -f $(DEST)/getgmr
	-rm -f install*

# Clean up binaries
clean:
	rm -f *.out core *.o errs m.err
