#	$NetBSD: Makefile.in,v 1.8 2003/03/31 06:15:07 grant Exp $

srcdir = @srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@

PREFIX=		@prefix@
INSTALL=	@INSTALL@

mandir=		@mandir@
mandircat8=	${mandir}/cat8

CANONICAL_HOST = @CANONICAL_HOST@


all:	mtree

PROG=	mtree
MAN=
SRCS= compare.c crc.c create.c excludes.c misc.c mtree.c spec.c \
	verify.c getid.c stat_flags.c pack_dev.c vis.c unvis.c \
	fgetln.c __fts13.c err.c setmode.c setprogname.c
OBJS= compare.o crc.o create.o excludes.o misc.o mtree.o spec.o \
	verify.o getid.o stat_flags.o pack_dev.o vis.o unvis.o \
	fgetln.o __fts13.o err.o setmode.o setprogname.o

CPPFLAGS+=	-I.

CC=		@CC@
CCLD=		$(CC)
LIBS=		@LIBS@
CPPFLAGS=	@CPPFLAGS@
DEFS=		@DEFS@ -I. -I@srcdir@ -DNO_MD5 -DNO_RMD160 -DNO_SHA1 -DHOST=\"$(CANONICAL_HOST)\"
CFLAGS=		@CFLAGS@
LDFLAGS=	@LDFLAGS@

LINK=		$(CCLD) $(CFLAGS) $(LDFLAGS) -o $@
COMPILE=	$(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS)

all: ${PROG}

${PROG}: digest-types.h ${OBJS}
	${LINK} ${OBJS} ${LIBS}

digest-types.h: bits
	./bits digest-types.h

bits: bits.o
	$(LINK) bits.o $(LIBS)

.c.o:
	$(COMPILE) -c $< -o $@

clean:
	rm -f ${OBJS} ${PROG} digest-types.h bits bits.o

distclean: clean
	rm -f Makefile config.h config.status config.log

install:
	${INSTALL} ${PROG} ${DESTDIR}${bindir}
	${INSTALL} -m 755 -d ${DESTDIR}${mandircat8}
	${INSTALL} -m 444 ${PROG}.cat8 ${DESTDIR}${mandircat8}/${PROG}.0
