# Makefile for pnmthreshcrop
#
# Crops a NetPBM image file (PBM bitmap, PGM greyscale, or PPM color pixmap)
# based on the contents, using a threshold.
#
# Remove the black border around a photo of a small planet, for example.
# Use the threshold value to decide how "black" a pixel must be for it to
# be ignored.  (So that, for example, faint starts don't get confused as
# the useful part of the image.)
#
# Based on a request on 'comp.graphics.apps.gimp' by Frank Stefani
# 
# By Bill Kendrick
# bill@newbreedsoftware.com
# http://www.newbreedsoftware.com/
#
# December 13, 2003 - December 13, 2003


CC=gcc


all:	pnmthreshcrop

clean:
	-rm pnmthreshcrop
	-rm *.o

install:
	cp pnmthreshcrop /usr/local/bin/
	chown root.root /usr/local/bin/pnmthreshcrop
	chmod 755 /usr/local/bin/pnmthreshcrop
	cp pnmcentercrop.sh /usr/local/bin
	chown root.root /usr/local/bin/pnmcentercrop.sh
	chmod 755 /usr/local/bin/pnmcentercrop.sh

uninstall:
	rm /usr/local/bin/pnmthreshcrop
	rm /usr/local/bin/pnmcentercrop.sh

pnmthreshcrop:	pnmthreshcrop.o
	$(CC) pnmthreshcrop.o -o pnmthreshcrop -lpnm

pnmthreshcrop.o:	pnmthreshcrop.c

