##
# Makefile automatically generated by genmake 1.0, Mar-16-97
# genmake 1.0 by ma_muquit@fccc.edu, RCS
##
CC= cc
DEFS=  
PROGNAME= grabc
LIBS= -L/usr/X11R6/lib -lX11

INCLUDES=  -I.
cp=/bin/cp -fv
DESTDIR = 
binary=./grabc
manpage=./grabc.1
bindir=/usr/local/bin
mandir=/usr/local/share/man/man1

# replace -O with -g in order to debug

DEFINES= $(INCLUDES) $(DEFS) -D__USE_FIXED_PROTOTYPES__ -DSYS_UNIX=1
CFLAGS= -O $(DEFINES)

SRCS = grabc.c

OBJS = grabc.o

.c.o:
	rm -f $@
	$(CC) $(CFLAGS) -c $*.c

all: $(PROGNAME)

$(PROGNAME) : $(OBJS)
	$(CC) $(CFLAGS) -o $(PROGNAME) $(OBJS) $(LIBS)

doc:
	pod2man grabc.pod > grabc.1

install: installdirs install-bin install-man

install-bin:
	${cp} ${binary} ${DESTDIR}${bindir}

installdirs:
	$(SHELL) ./mkinstalldirs ${DESTDIR}${bindir}
	$(SHELL) ./mkinstalldirs ${DESTDIR}${mandir}

install-man:
	${cp} ${manpage} ${DESTDIR}${mandir}

deb:
	/bin/rm -f *.deb
	/bin/rm -rf /tmp/grabc
	make DESTDIR=/tmp/grabc install
	fpm -s dir -t deb -C /tmp/grabc --name grabc --version 1.0.2 --iteration 1 --description "A program to id entify a pixel color on an X Window"
	/bin/rm -rf /tmp/grabc
clean:
	rm -f $(OBJS) $(PROGNAME) core *.deb
