# written by John Hasler based on work by Guido Socher
# You may treat this Makefile as if it was in the public domain.

PREFIX=/usr
INSTALL=/usr/bin/install -c
MANP=gpppon.1 
CC=gcc
CFLAGS= -Wall -O2


# gtk-config is usually installed together with gtk and it should
# be used when possible:
LIBS=`pkg-config --libs gtk+-2.0`
INCLUDES=-I /usr/lib/glib-2.0/include -I /usr/include/glib-2.0 -I /usr/include/gtk-2.0 -I /usr/include/gdk-2.0 -I /usr/include/cairo -I /usr/include/pango-1.0 -I /usr/lib/gtk-2.0/include -I /usr/include/atk-1.0

gpppon: gpppon.o
	$(CC) -o gpppon $(LIBS) gpppon.o 
gpppon.o: gpppon.c
	$(CC) -c $(CFLAGS) $(INCLUDES) gpppon.c

install: gpppon $(MANP)
	[ -d "$(PREFIX)/bin" ] || $(INSTALL) -d $(PREFIX)/bin
	[ -d "$(PREFIX)/man/man1" ] || $(INSTALL) -d $(PREFIX)/man/man1
	$(INSTALL) -m 750 -g dip gpppon $(PREFIX)/bin 
	$(INSTALL) -m 644 $(MANP) $(PREFIX)/man/man1

clean:
	rm -f gpppon *.o
