# Generated automatically from Makefile.in by configure.
# Top-level Makefile for kpathsea-using programs.

# Package subdirectories, the library, and all subdirectories.
programs = dviljk dvipsk gsftopkk web2c xdvik
kpathsea_dir = kpathsea
all_dirs = $(programs) $(kpathsea_dir)

# paths.make -- installation directories.
#
# The compile-time paths are defined in kpathsea/paths.h, which is built
# from kpathsea/paths.h.in and these definitions.  See kpathsea/INSTALL
# for a description of how the various path-related files are used and
# created.

# Do not change prefix and exec_prefix in Makefile.in!
# configure doesn't propagate the change to the other Makefiles.
# Instead, give the -prefix/-exec-prefix options to configure.
# (See kpathsea/INSTALL for more details.) This is arguably
# a bug, but it's not likely to change soon.
prefix = /usr/contrib/texmf
exec_prefix = ${prefix}

# Architecture-dependent executables.
bindir = $(exec_prefix)/bin

# Architecture-independent executables.
scriptdir = $(bindir)

# Architecture-dependent files, such as lib*.a files.
libdir = $(exec_prefix)/lib

# Architecture-independent files.
datadir = $(prefix)/lib

# Header files.
includedir = $(prefix)/include

# GNU .info* files.
infodir = $(prefix)/info

# Unix man pages.
manext = 1
mandir = $(prefix)/man/man$(manext)

# TeX & MF-specific directories. Not all of the following are relevant
# for all programs, but it seems cleaner to collect everything in one place.

# The default paths are now in kpathsea/paths.h.in. Passing all the
# paths to sub-makes can make the arg list too long on system V.

# The root of the tree.
texmf = $(datadir)/texmf

# TeX and MF source files.
texinputdir = $(texmf)/tex
mfinputdir = $(texmf)/mf

# MakeTeXPK.site, texmf.cnf, etc.
web2cdir = $(texmf)/web2c

# The top-level font directory.
fontdir = $(texmf)/fonts

# Memory dumps (.fmt and .base).
fmtdir = $(texmf)/ini
basedir = $(fmtdir)

# Pool files.
texpooldir = $(texmf)/ini
mfpooldir = $(texpooldir)

# If install_fonts=true, the PostScript/LaserJet TFM and VF files for
# the builtin fonts get installed in subdirectories of this directory,
# named for the typeface families of these directories. If you don't
# have the default directory setup, you will want to set
# install_fonts=false.  Ditto for install_macros.
install_fonts = true
install_macros = true

# Where the .map files from fontname are installed.
fontnamedir = $(texmf)/fontname

# Where the dvips configuration files get installed, and where
# psfonts.map is.
dvipsdir = $(texmf)/dvips
psheaderdir = $(dvipsdir)

# MakeTeXPK will go here to create dc*.
dcfontdir = $(fontdir)/public/dc

# MakeTeXPK will go here if it exists to create nonstandard CM fonts,
# e.g., cmr11. See ftp.cs.umb.edu:pub/tex/sauter.tar.gz. The Sauter
# files must be in your regular MFINPUTS.
sauterdir = $(fontdir)/public/sauter

# If a font can't be found close enough to its stated size, we look for
# each of these sizes in the order given.  This colon-separated list is
# overridden by the envvar TEXSIZES, and by a program-specific variable
# (e.g., XDVISIZES), and perhaps by a config file (e.g., in dvips).
default_texsizes = 300:600

# End of paths.make.
# makevars.make -- the directory names we pass.
# It's important that none of these values contain [ @%], for the sake
# of kpathsea/texmf.sed.
makevars = prefix=$(prefix) exec_prefix=$(exec_prefix) \
  bindir=$(bindir) scriptdir=$(scriptdir) libdir=$(libdir) \
  datadir=$(datadir) infodir=$(infodir) includedir=$(includedir) \
  manext=$(manext) mandir=$(mandir) \
  texmf=$(texmf) web2cdir=$(web2cdir) \
  texinputdir=$(texinputdir) mfinputdir=$(mfinputdir) \
  fontdir=$(fontdir) \
  fmtdir=$(fmtdir) basedir=$(basedir) \
  texpooldir=$(texpooldir) mfpooldir=$(mfpooldir) \
  install_fonts=$(install_fonts) \
  dvipsdir=$(dvipsdir) psheaderdir=$(psheaderdir) \
  default_texsizes='$(default_texsizes)'
# End of makevars.make.

# It's too bad we have to pass all these down, but I see no alternative,
# if we are to propagate changes at the top level.
makeargs = $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' $(makevars) $(XMAKEARGS)
installargs = INSTALL='$(INSTALL)' INSTALL_DATA='$(INSTALL_DATA)' \
         INSTALL_PROGRAM='$(INSTALL_PROGRAM)' $(makeargs)

# Not everything from common.make is relevant to this top-level
# Makefile, but most of it is, and it doesn't seem worth separating the
# compilation-specific stuff.
# common.make -- used by all Makefiles.
SHELL = /bin/sh

top_srcdir = .
srcdir = .

CC = gcc
# CFLAGS is used for both compilation and linking.
CFLAGS = -g -O $(XCFLAGS) -Dstrerror=strerror -DFOIL_X_WCHAR_T

# Do not override CPPFLAGS; change XCPPFLAGS, CFLAGS, XCFLAGS, or DEFS instead.
CPPFLAGS = $(XCPPFLAGS) -I. -I$(srcdir) \
	   -I$(kpathsea_parent) -I$(kpathsea_srcdir_parent) \
	   $(prog_cflags)  $(DEFS) 
.c.o:
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
.SUFFIXES: .c .o

# Installation.
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644

# This is used to recursively copy a fonts/ or tex/ directory to
# $(fontdir) or $(texinputdir).
# The first arg is `.', and the second is the target directory.
CP_R = cp -r

# This is so kpathsea will get remade automatically if you change
# something in it and recompile from the package directory.
kpathsea_parent = ..
kpathsea_dir = $(kpathsea_parent)/kpathsea
kpathsea_srcdir_parent = $(top_srcdir)/..
kpathsea_srcdir = $(kpathsea_srcdir_parent)/kpathsea
kpathsea = $(kpathsea_dir)/kpathsea.a

##ifeq ($(CC), gcc)
##XDEFS = -Wall -Wpointer-arith $(warn_more)
##CFLAGS = -g $(XCFLAGS)
##endif
# End of common.make.

# kpathsea is not a sibling, it's a child.
kpathsea_parent = .

# Make the library before the programs.
# Use if ... rather than || or && because Ultrix make exits for
# no good reason with the latter.
default all: do-kpathsea
	for d in $(programs); do if test -d $$d; then \
	  (cd $$d; $(MAKE) $(makeargs) $@); else true; fi; done

install install-data install-exec:
	for d in kpathsea $(programs); do if test -d $$d; then \
	  (cd $$d; $(MAKE) $(installargs) $@); else true; fi; done

# Other standard targets for everything.
uninstall uninstall-exec uninstall-data \
mostlyclean clean distclean realclean extraclean configclean \
TAGS info dvi check depend::
	for d in $(all_dirs); do if test -d $$d; then \
	  (cd $$d; $(MAKE) $(makeargs) $@); else true; fi; done

distclean realclean::
	rm -f Makefile config.status config.cache config.log

# Unconditionally remake the library, since we don't want to write out
# the dependencies here.
do-kpathsea:
	cd $(kpathsea_dir); $(MAKE) $(makeargs)

# Targets that only apply to web2c.
triptrap run-triptrap clean-triptrap run-trip clean-trip run-trap clean-trap \
c-sources programs TeX MF BibTeX \
formats fmts bases install-fmts install-bases \
manpages install-manpages: do-kpathsea
	cd web2c && $(MAKE) $(makeargs) $@

##ifdef HOSTNAME
##ac_dir = $(gnu)/share/autoconf
##autoconf = $(ac_dir)/acspecific.m4 $(ac_dir)/acgeneral.m4 $(ac_dir)/acsite.m4
##configure_in = $(srcdir)/configure.in
##$(srcdir)/configure: $(configure_in) $(autoconf)
##	cd $(srcdir); autoconf
##endif

config.status: $(srcdir)/configure
	$(SHELL) $(srcdir)/configure --no-create --verbose

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