# Generated automatically from Makefile.in by configure.
# Makefile for X dvi previewer.
version = 0.28

# Installation directories.
prefix = /vol/X11
exec_prefix = ${prefix}
bindir = $(exec_prefix)/bin
manext = 1
mandir = $(prefix)/man/man$(manext)

# Default paths for you to override.  You can either change these and
# run `make', or copy paths.h.in to paths.h and change
# them manually.  These paths are overridden by various environment
# variables; see the documentation.
default_pk_path = .:/vol/tex/fonts/pk300
default_gf_path = $(default_pk_path)

# If a font can't be found at its stated size, we look for each of these
# sizes in the order given.  This list is overridden by the envvar XDVISIZES.
default_xdvisizes=300:1200
#default_xdvisizes=300:328.6:360:432:518.4:622:746.4
#default_xdvisizes=100.46:120.6:144.7:173.6:208.3:250:300:328.6:360:432:518.4:622:746.4

# If your X include files or libraries won't be found automatically by
# the compiler or linker, define these appropriately:
xincludedir = -I/vol/X11/include
xlibdir = -L/vol/X11/lib

# If you want A4 paper sizes by default, add -DA4.
# If you are using X10, add -DX10.  Probably hasn't been tested in years.
# See README for other things.
DEFS = -DMSBITFIRST -DBMSHORT -DA4 -DTECHFAK

# Perhaps you will want to optimize here if you are not using GCC.
CFLAGS = -O2

# Start of system configuration section.
SHELL = /bin/sh
srcdir = .
VPATH = .

# Need DEFS to get -DHAVE_CONFIG_H.
CC = gcc 
CPPFLAGS = -DHAVE_CONFIG_H -I$(srcdir) $(DEFS) $(xincludedir)

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

LIBS = -lXaw -lXmu -lXt -lXext -lX11  -lm /vol/local/lib/libTeX.a /vol/local/lib/libhesiod.a -lresolv -lnsl -lsocket $(extralibs)
LDFLAGS = $(xlibdir) $(CFLAGS) $(XLDFLAGS)

INSTALL = /vol/gnu/bin/install -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644

pathsearch_objs = concat.o concat3.o dir-p.o extend-fname.o file-p.o \
find-suffix.o fontmap.o line.o pathsrch.o remove-suffx.o xcalloc.o \
xfopen.o xmalloc.o xopendir.o xrealloc.o xstat.o xstrdup.o

# We don't use alloca ourselves, but the X library might, and this way
# we avoid the buggy versions in -lPW or -lucb.
ALLOCA = alloca.o

OBJS = xdvi.o dvi-init.o dvi-draw.o gf.o pk.o pxl-open.o tpic.o \
 make-suffix.o $(ALLOCA) $(pathsearch_objs)

all:	xdvi xdvi.1

xdvi:	$(OBJS)
	$(CC) $(LDFLAGS) -o xdvi $(OBJS) $(LIBS)

paths.h: paths.h.in
	rm -f paths.h
	echo "/* Generated from paths.h.in (`date`).  */" > paths.h
	sed -e "s,replace-with-pk-path,$(default_pk_path)," \
            -e "s,replace-with-gf-path,$(default_gf_path)," \
            -e "s,replace-with-xdvisizes,$(default_xdvisizes)," \
          $(srcdir)/paths.h.in >> paths.h

# This is installed using $(manext); it doesn't matter that we are
# building it as `.1'.
xdvi.1: xdvi.man sedscript
	sed -f sedscript < $(srcdir)/xdvi.man > xdvi.1

sedscript: mksedscript
	$(SHELL) $(srcdir)/mksedscript $(default_pk_path) $(default_gf_path) \
          $(default_xdvisizes) $(CFLAGS) > sedscript

install: install-exec install-data
uninstall: uninstall-exec uninstall-data

install-exec: xdvi
	$(INSTALL_PROGRAM) xdvi $(bindir)/xdvi
uninstall-exec:
	rm -f $(bindir)/xdvi

install-data: xdvi.1
	$(INSTALL_DATA) xdvi.1 $(mandir)/xdvi.$(manext)
uninstall-data:
	rm -f $(mandir)/xdvi.$(manext)

distdir = xdvik-$(version)
dist:
	rm -rf $(distdir)
	mkdir $(distdir)
	ln AUTHORS ChangeLog README *.in *.h *.c $(distdir)
	ln configure mksedscript xdvi.icon xdvi.man $(distdir)
	cp -p $(gnu)/lib/aclocal.m4 $(distdir)
	cp -p $(HOME)/gnu/gnuorg/COPYING* $(top_distdir)
	rm -f $(distdir)/c-auto.h $(distdir)/paths.h
	tar czf $(distdir). $(distdir)
	rm -rf $(distdir)

# Prevent GNU make 3 from overflowing arg limit on system V.
.NOEXPORT:

configure: configure.in
	cd $(srcdir); autoconf

config.status: configure
	cd $(srcdir); $(SHELL) configure --no-create

Makefile: $(srcdir)/Makefile.in config.status
	$(SHELL) config.status

depend: paths.h
	$(CC) -MM *.c > /tmp/depend
.PHONY: depend

TAGS:
	etags -t *.c *.h

mostlyclean:
	rm -f *.o xdvi *log core a.out

clean: mostlyclean
	rm -f sedscript xdvi.1 *.dvi *.pl

distclean: clean
	rm -f Makefile paths.h config.status c-auto.h

realclean: distclean
	rm -f TAGS

extraclean: distclean
	rm -f *gf *pk *.tfm *~ *\#* patch* *.orig *.rej

# Dependencies:
concat.o : concat.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h 
concat3.o : concat3.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h 
dir-p.o : dir-p.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h c-errno.h \
  c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h xdvi.h \
  lib.h types.h dirio.h xstat.h 
dvi-draw.o : dvi-draw.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h c-ctype.h dvi.h 
dvi-init.o : dvi-init.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h dvi.h pxl-open.h 
extend-fname.o : extend-fname.c config.h c-auto.h paths.h c-std.h c-unistd.h \
  c-memstr.h c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h \
  c-fopen.h c-proto.h xdvi.h lib.h types.h 
file-p.o : file-p.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h xstat.h 
find-suffix.o : find-suffix.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h 
fontmap.o : fontmap.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h fontmap.h 
gf.o : gf.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h c-errno.h \
  c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h xdvi.h \
  lib.h types.h 
line.o : line.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h c-errno.h \
  c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h xdvi.h \
  lib.h types.h 
make-suffix.o : make-suffix.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h 
pathsrch.o : pathsrch.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h xstat.h c-ctype.h dirio.h pathsrch.h 
pk.o : pk.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h c-errno.h \
  c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h xdvi.h \
  lib.h types.h 
pxl-open.o : pxl-open.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h fontmap.h pathsrch.h pxl-open.h 
remove-suffx.o : remove-suffx.c config.h c-auto.h paths.h c-std.h c-unistd.h \
  c-memstr.h c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h \
  c-fopen.h c-proto.h xdvi.h lib.h types.h 
tpic.o : tpic.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h c-errno.h \
  c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h xdvi.h \
  lib.h types.h c-ctype.h 
version.o : version.c 
xcalloc.o : xcalloc.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h 
xdvi.o : xdvi.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h c-errno.h \
  c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h xdvi.h \
  lib.h types.h c-ctype.h pxl-open.h xdvi.icon 
xfopen.o : xfopen.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h 
xmalloc.o : xmalloc.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h 
xopendir.o : xopendir.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h dirio.h 
xrealloc.o : xrealloc.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h 
xstat.o : xstat.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h c-errno.h \
  c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h xdvi.h \
  lib.h types.h xstat.h 
xstrdup.o : xstrdup.c config.h c-auto.h paths.h c-std.h c-unistd.h c-memstr.h \
  c-errno.h c-minmax.h c-limits.h c-pathch.h c-pathmx.h c-namemx.h c-fopen.h c-proto.h \
  xdvi.h lib.h types.h 
