# Makefile for dviinfo $Revision: 1.1 $.
# Copyright (C) 1991-96 Valentino Kyriakides.

#### Start of configuration section. ####

VPATH = .
srcdir = $(VPATH)

CC = cc
CFLAGS = -g
# If DEFS is leaved empty, "centimeters" are the default page metric option.
DEFS =  -DINCH   # defs "inches" to be the default page metric option.
LDFLAGS = -g
LIBS = 

INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = $(INSTALL) -s
INSTALL_DATA = $(INSTALL) -m 644
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi

prefix = /usr/local
exec_prefix = $(prefix)

bindir = $(exec_prefix)/bin
mandir = $(prefix)/man/man1

# Prefix to be prepended to each installed program, normally empty or `g'.
binprefix = 

#### End of configuration section. ####

SHELL = /bin/sh

SRCS = dviinfo.c
OBJS = dviinfo.o 
MANS = dviinfo.1
DISTFILES = $(SRCS) $(MANS) COPYING ChangeLog NEWS Makefile \
	    README INSTALL mkinstalldirs

all: dviinfo
.PHONY: all

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $<

.PHONY: install installdirs
install: installdirs dviinfo
	$(INSTALL_PROGRAM) dviinfo $(bindir)/$(binprefix)dviinfo
	-$(INSTALL_DATA) $(srcdir)/dviinfo.1 $(mandir)/dviinfo.1
installdirs:
	${srcdir}/mkinstalldirs $(bindir) $(mandir)

dviinfo: $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

.PHONY: check
check: dviinfo
	@echo expect no output from diff
	./dviinfo > test.out
	diff -c $(srcdir)/testdata test.out
	rm -f test.out

TAGS: $(SRCS)
	etags $(SRCS)

.PHONY: clean mostlyclean

clean:
	rm -f dviinfo *.o core test.out dviinfo.bak

mostlyclean: clean

# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
