CC =		gcc
LOBS = 		-lnetpbm

TREE = $(DESTDIR)/usr
# FSSTND; or /usr/local

all: ppmtoagafb

ppmtoagafb: ppmtoagafb.o encodeham8.o
	$(CC) -o $@ $^ $(LOBS)

root: ppmtoagafb
	chown root.root ppmtoagafb
	chmod u+s ppmtoagafb

install: ppmtoagafb
	install -s -m4755 -o root -g root ppmtoagafb $(TREE)/bin/ppmtoagafb
	install -m755 -o root -g root agaview.py $(TREE)/bin/agaview
	install -o root -g root ppmtoagafb.1 $(TREE)/man/man1/ppmtoagafb.1

clean:
	rm -f *.o ppmtoagafb *~

distclean:
	rm -f *.o *~

.PHONY: root install clean distclean all
