# Makefile for makeindexk --te@informatik.uni-hannover.de. Public domain.
version = 2.15

prefix = c:/usr/local
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}/share

# Header files.
includedir = ${prefix}/include

# GNU .info* files.
infodir = ${prefix}/info

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

# The root of the main tree.
texmf = c:/usr/local/share/texmf

# The directory used by varfonts.
vartexfonts = c:/var/tex/fonts

# Regular input files.
texinputdir = $(texmf)/tex
mfinputdir = $(texmf)/metafont
mpinputdir = $(texmf)/metapost
mftinputdir = $(texmf)/mft

# dvips's epsf.tex, rotate.tex, etc. get installed here;
# ditto for dvilj's fonts support.
dvips_plain_macrodir = $(texinputdir)/plain/dvips
dvilj_latex2e_macrodir = $(texinputdir)/latex/dvilj

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

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

# Memory dumps (.fmt/.base/.mem).
fmtdir = $(web2cdir)
basedir = $(fmtdir)
memdir = $(fmtdir)

# Pool files.
texpooldir = $(web2cdir)
mfpooldir = $(texpooldir)
mppooldir = $(texpooldir)

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

# For dvips configuration files, psfonts.map, etc.
dvipsdir = $(texmf)/dvips

# For dvips .pro files, gsftopk's render.ps, etc.
psheaderdir = $(dvipsdir)

# 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).
# This list must be sorted in ascending order.
default_texsizes = 300:600

# common.mk -- used by all Makefiles.
SHELL = sh
MAKE=make
top_srcdir = .
srcdir = .

CC = cl
CFLAGS = -nologo -W3 -DWIN32=1 -favor:blend -MD -Os $(XCFLAGS)
CPPFLAGS =  $(XCPPFLAGS)

YDEFS = -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE \
-D_CRT_OBSOLETE_NO_DEPRECATE -D_SECURE_SCL=0

DEFS = -DHAVE_CONFIG_H $(XDEFS) $(YDEFS)

# Kpathsea needs this for compiling, programs need it for linking.
LIBTOOL = $(kpathsea_srcdir_parent)/klibtool

# You can change [X]CPPFLAGS, [X]CFLAGS, or [X]DEFS, but
# please don't change ALL_CPPFLAGS or ALL_CFLAGS.
# prog_cflags is set by subdirectories of web2c.
ALL_CPPFLAGS = $(DEFS) -I. -I$(srcdir) \
-I$(kpathsea_parent) -I$(kpathsea_srcdir_parent) \
$(prog_cflags) $(CPPFLAGS)
ALL_CFLAGS = $(ALL_CPPFLAGS) $(CFLAGS) -c
compile = $(CC) $(ALL_CFLAGS)

.SUFFIXES:
.SUFFIXES: .c .obj # in case the suffix list has been cleared, e.g., by web2c
.c.obj:
	$(compile) $<

# Installation.
INSTALL = cp
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = $(INSTALL_PROGRAM)
INSTALL_DATA = ${INSTALL}
INSTALL_LIBTOOL_LIBS = INSTALL_DATA='$(INSTALL_DATA)' $(LIBTOOL) install-lib
INSTALL_LIBTOOL_PROG = INSTALL_PROGRAM='$(INSTALL_PROGRAM)' $(LIBTOOL) install-prog

# Creating (symbolic) links.
LN = ln

# We use these for many things.
kpathsea_parent = ..
kpathsea_dir = $(kpathsea_parent)/kpathsea
kpathsea_srcdir_parent = $(top_srcdir)/..
kpathsea_srcdir = $(kpathsea_srcdir_parent)/kpathsea
kpathsea = $(kpathsea_dir)/kpathsealibw64.lib

#M#ifeq ($(CC), gcc)
#M#XDEFS = -Wpointer-arith $(warn_more)
#M#CFLAGS = -pipe -g $(XCFLAGS)
#M#endif
# End of common.mk.
# programs.mk -- used by Makefiles for executables only.

# Don't include $(CFLAGS), since ld -g under Linux forces
# static libraries, e.g., libc.a and libX*.a.
LDFLAGS =  $(XLDFLAGS)

# proglib is for web2c; 
# XLOADLIBES is for the installer.
LIBS =
LOADLIBES = $(proglib) $(kpathsea) $(LIBS) $(XLOADLIBES)

# May as well separate linking from compiling, just in case.
CCLD = $(CC)
link_command = $(CCLD) -Fe$@ $(LDFLAGS) 

# When we link with Kpathsea, have to take account that it might be a
# shared library, etc.
kpathsea_link = $(link_command)
# End of programs.mk.

objects = genind.obj mkind.obj qsort.obj scanid.obj scanst.obj sortid.obj
program = makeindex.exe
programs = $(program)

default all: $(programs)

$(program): $(kpathsea) $(objects)
	$(kpathsea_link) $(objects) setargv.obj $(LOADLIBES)
# tkpathsea.mk -- target for remaking kpathsea.
makeargs = $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' $(XMAKEARGS)

# This is wrong: the library doesn't depend on kpsewhich.c or
# acconfig.h.  But what to do?
$(kpathsea): $(kpathsea_srcdir)/*.c $(kpathsea_srcdir)/*.h
	cd $(kpathsea_dir) && $(MAKE) $(makeargs)

BINS=makeindex.exe
ZZ=c:/usr/local/txdir/w32tex/bin64/

install: $(BINS)
	cp -p $(BINS) c:/usr/work/edrive/wk/w64dist/MAKEINDEX/bin64/
	cp -p $(BINS) $(ZZ)

uninstall: uninstall-exec uninstall-data

install-exec: $(programs)
	$(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
	$(INSTALL_LIBTOOL_PROG) $(bindir) $(program)
	$(INSTALL_SCRIPT) $(srcdir)/mkindex $(scriptdir)/mkindex
uninstall-exec:
	cd $(bindir) && rm -f $(program)
	cd $(scriptdir) && rm -f mkindex

install-data: makeindex.1
	$(SHELL) $(top_srcdir)/../mkinstalldirs $(mandir)
	$(INSTALL_DATA) $(srcdir)/makeindex.1 $(mandir)/makeindex.$(manext)

uninstall-data:

distname = makeindex
program_files =
version_files =

pre-dist-$(distname):
post-dist-$(distname):

info dvi check:

# clean.mk -- cleaning.
mostlyclean::
	rm -f *.obj

clean:: mostlyclean
	rm -f $(program) $(programs) squeeze lib$(library).* $(library).a *.bad
	rm -f *.exe *.dvi *.lj

distclean:: extraclean clean
	rm -f Makefile
	rm -f config.status config.log config.cache c-auto.h
	rm -f stamp-auto stamp-tangle stamp-otangle

# Although we can remake configure and c-auto.in, we don't remove
# them, since many people may lack Autoconf.  Use configclean for that.
maintainer-clean:: distclean
	rm -f *.info*

extraclean::
	rm -f *.aux *.bak *.bbl *.blg *.dvi *.log *.pl *.tfm *.vf *.vpl
	rm -f *.*pk *.*gf *.mpx *.i *.s *~ *.orig  *.rej *\#*
	rm -f CONTENTS.tex a.out core mfput.* texput.* mpout.*

configclean:
	rm -f configure c-auto.in c-auto.h stamp-*
# End of clean.mk.

distclean::

TAGS: *.c *.h
	pwd | grep kpathsea >/dev/null && append=../kpathsea/TAGS; \
	  etags $$append *.[ch]

# Prevent GNU make 3.[59,63) from overflowing arg limit on system V.
.NOEXPORT:

# End of rdepend.mk.
genind.obj: genind.c mkind.h c-auto.h $(kpathsea_dir)/c-auto.h \
  $(kpathsea_srcdir)/config.h $(kpathsea_srcdir)/c-std.h \
  $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
  $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \
  $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
  $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
  $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h \
  $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/magstep.h \
  $(kpathsea_srcdir)/proginit.h $(kpathsea_srcdir)/tex-glyph.h \
  $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/expand.h genind.h
mkind.obj: mkind.c mkind.h c-auto.h $(kpathsea_dir)/c-auto.h \
  $(kpathsea_srcdir)/config.h $(kpathsea_srcdir)/c-std.h \
  $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
  $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \
  $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
  $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
  $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h \
  $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/magstep.h \
  $(kpathsea_srcdir)/proginit.h $(kpathsea_srcdir)/tex-glyph.h \
  $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/expand.h
qsort.obj: qsort.c mkind.h c-auto.h $(kpathsea_dir)/c-auto.h \
  $(kpathsea_srcdir)/config.h $(kpathsea_srcdir)/c-std.h \
  $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
  $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \
  $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
  $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
  $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h \
  $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/magstep.h \
  $(kpathsea_srcdir)/proginit.h $(kpathsea_srcdir)/tex-glyph.h \
  $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/expand.h
scanid.obj: scanid.c mkind.h c-auto.h $(kpathsea_dir)/c-auto.h \
  $(kpathsea_srcdir)/config.h $(kpathsea_srcdir)/c-std.h \
  $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
  $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \
  $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
  $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
  $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h \
  $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/magstep.h \
  $(kpathsea_srcdir)/proginit.h $(kpathsea_srcdir)/tex-glyph.h \
  $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/expand.h scanid.h
scanst.obj: scanst.c mkind.h c-auto.h $(kpathsea_dir)/c-auto.h \
  $(kpathsea_srcdir)/config.h $(kpathsea_srcdir)/c-std.h \
  $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
  $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \
  $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
  $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
  $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h \
  $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/magstep.h \
  $(kpathsea_srcdir)/proginit.h $(kpathsea_srcdir)/tex-glyph.h \
  $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/expand.h scanst.h
sortid.obj: sortid.c mkind.h c-auto.h $(kpathsea_dir)/c-auto.h \
  $(kpathsea_srcdir)/config.h $(kpathsea_srcdir)/c-std.h \
  $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \
  $(kpathsea_srcdir)/c-memstr.h $(kpathsea_srcdir)/c-errno.h \
  $(kpathsea_srcdir)/c-minmax.h $(kpathsea_srcdir)/c-limits.h \
  $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/debug.h \
  $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h \
  $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/magstep.h \
  $(kpathsea_srcdir)/proginit.h $(kpathsea_srcdir)/tex-glyph.h \
  $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/expand.h
