prefix=/usr/local
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
mandir=${prefix}/man
INSTALLCMD=/usr/bin/install -c

CC=gcc
CFLAGS=-O2 -Wall -W -mpoke-function-name -mthrowback

OBJS= ccache.o mdfour.o hash.o execute.o util.o args.o stats.o \
	cleanup.o snprintf.o unify.o
HEADERS = ccache.h mdfour.h

all: ccache

docs: ccache.1 web/ccache-man.html

ccache: $(OBJS) $(HEADERS)
	$(CC) $(CFLAGS) -o $@ $(OBJS)

ccache.1: ccache.yo
	yodl2man -o ccache.1 ccache.yo

web/ccache-man.html: ccache.yo
	mkdir -p man
	yodl2html -o web/ccache-man.html ccache.yo

install:
	${INSTALLCMD} -m 755 ccache ${bindir}
	${INSTALLCMD} -m 644 ccache.1 ${mandir}/man1

clean:
	/bin/rm -f $(OBJS) *~ ccache

distclean:
	/bin/rm -f Makefile config.h config.sub config.log build-stamp config.status
