# Makefile for the web2c library.

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

XDEFS = -DWIN32=1 -D_CRT_SECURE_NO_DEPRECATE=1
CC = cl
CFLAGS = -nologo -O2 -MT $(XCFLAGS)
CPPFLAGS =  $(XCPPFLAGS)
DEFS = -DNO_KPSE_DLL=1 -DHAVE_CONFIG_H $(XDEFS)

# 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_LIBTOOL_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)/libkpathsea.lib

#M#ifeq ($(CC), gcc)
#M#XDEFS = -Wpointer-arith $(warn_more)
#M#CFLAGS = -pipe -g $(XCFLAGS)
#M#endif
# End of common.mk.
# library.mk -- stuff only useful for libraries.
AR = lib
ARFLAGS = -out:
RANLIB =
# End of library.mk.
# web2c/kpathsea.mk -- In subdirectories of web2c, the build directory
# for kpathsea is one more level up.  c_auto_h_dir is used by make depend.
kpathsea_parent = ../..
c_auto_h_dir = ..

prog_cflags = -I.. -I$(srcdir)/..
# End of web2c/kpathsea.mk.

library = lib

# We don't make `texmfmp.obj', since TeX, Metafont, and MetaPost need to
# use different routine names, hence they need different .obj files. Maybe
# we should change this via #define's someday ...
objects = alloca.obj basechsuffix.obj chartostring.obj coredump.obj \
  eofeoln.obj fprintreal.obj inputint.obj input2int.obj main.obj \
  openclose.obj printversion.obj setupvar.obj uexit.obj usage.obj \
  version.obj zround.obj

default all: $(library).lib
$(library).lib: $(objects)
	rm -f $@
	$(AR) $(ARFLAGS)$@ $(objects)

# Do not use CPPFLAGS for this, because including config.h might
# result in a conflicting decl of xmalloc. How annoying.
alloca.obj: alloca.c 
	$(CC) $(CFLAGS) -c $(srcdir)/alloca.c

#Makefile: Makefile.in ../config.status
#	cd .. && $(SHELL) config.status

# clean.mk -- cleaning.

clean::
	rm -f *~ *.obj *.lib

# End of clean.mk.

# Let's stick a rule for TAGS here, just in case someone wants them.
# (We don't put them in the distributions, to keep them smaller.)
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:

# DO NOT DELETE

alloca.obj: alloca.c ../../kpathsea/c-auto.h ../../kpathsea/c-errno.h \
 ../../kpathsea/c-fopen.h ../../kpathsea/c-limits.h \
 ../../kpathsea/c-memstr.h ../../kpathsea/c-minmax.h \
 ../../kpathsea/c-proto.h ../../kpathsea/c-std.h ../../kpathsea/c-unistd.h \
 ../../kpathsea/config.h ../../kpathsea/debug.h ../../kpathsea/hash.h \
 ../../kpathsea/lib.h ../../kpathsea/progname.h ../../kpathsea/str-list.h \
 ../../kpathsea/str-llist.h ../../kpathsea/systypes.h \
 ../../kpathsea/types.h ../../kpathsea/win32lib.h ../w2c/c-auto.h \
 ../w2c/config.h
basechsuffix.obj: basechsuffix.c ../../kpathsea/c-auto.h \
 ../../kpathsea/c-errno.h ../../kpathsea/c-fopen.h \
 ../../kpathsea/c-limits.h ../../kpathsea/c-memstr.h \
 ../../kpathsea/c-minmax.h ../../kpathsea/c-proto.h ../../kpathsea/c-std.h \
 ../../kpathsea/c-unistd.h ../../kpathsea/config.h ../../kpathsea/debug.h \
 ../../kpathsea/hash.h ../../kpathsea/lib.h ../../kpathsea/progname.h \
 ../../kpathsea/str-list.h ../../kpathsea/str-llist.h \
 ../../kpathsea/systypes.h ../../kpathsea/types.h ../../kpathsea/win32lib.h \
 ../w2c/c-auto.h ../w2c/config.h ../lib/lib.h
chartostring.obj: chartostring.c ../../kpathsea/c-auto.h \
 ../../kpathsea/c-errno.h ../../kpathsea/c-fopen.h \
 ../../kpathsea/c-limits.h ../../kpathsea/c-memstr.h \
 ../../kpathsea/c-minmax.h ../../kpathsea/c-proto.h ../../kpathsea/c-std.h \
 ../../kpathsea/c-unistd.h ../../kpathsea/config.h ../../kpathsea/debug.h \
 ../../kpathsea/hash.h ../../kpathsea/lib.h ../../kpathsea/progname.h \
 ../../kpathsea/str-list.h ../../kpathsea/str-llist.h \
 ../../kpathsea/systypes.h ../../kpathsea/types.h ../../kpathsea/win32lib.h \
 ../w2c/c-auto.h ../w2c/config.h ../lib/lib.h
coredump.obj: coredump.c ../../kpathsea/c-auto.h ../../kpathsea/c-errno.h \
 ../../kpathsea/c-fopen.h ../../kpathsea/c-limits.h \
 ../../kpathsea/c-memstr.h ../../kpathsea/c-minmax.h \
 ../../kpathsea/c-proto.h ../../kpathsea/c-std.h ../../kpathsea/c-unistd.h \
 ../../kpathsea/config.h ../../kpathsea/debug.h ../../kpathsea/hash.h \
 ../../kpathsea/lib.h ../../kpathsea/progname.h ../../kpathsea/str-list.h \
 ../../kpathsea/str-llist.h ../../kpathsea/systypes.h \
 ../../kpathsea/types.h ../../kpathsea/win32lib.h ../w2c/c-auto.h \
 ../w2c/config.h
eofeoln.obj: eofeoln.c ../../kpathsea/c-auto.h ../../kpathsea/c-errno.h \
 ../../kpathsea/c-fopen.h ../../kpathsea/c-limits.h \
 ../../kpathsea/c-memstr.h ../../kpathsea/c-minmax.h \
 ../../kpathsea/c-proto.h ../../kpathsea/c-std.h ../../kpathsea/c-unistd.h \
 ../../kpathsea/config.h ../../kpathsea/debug.h ../../kpathsea/hash.h \
 ../../kpathsea/lib.h ../../kpathsea/progname.h ../../kpathsea/str-list.h \
 ../../kpathsea/str-llist.h ../../kpathsea/systypes.h \
 ../../kpathsea/types.h ../../kpathsea/win32lib.h ../w2c/c-auto.h \
 ../w2c/config.h ../lib/lib.h
fprintreal.obj: fprintreal.c ../../kpathsea/c-auto.h \
 ../../kpathsea/c-errno.h ../../kpathsea/c-fopen.h \
 ../../kpathsea/c-limits.h ../../kpathsea/c-memstr.h \
 ../../kpathsea/c-minmax.h ../../kpathsea/c-proto.h ../../kpathsea/c-std.h \
 ../../kpathsea/c-unistd.h ../../kpathsea/config.h ../../kpathsea/debug.h \
 ../../kpathsea/hash.h ../../kpathsea/lib.h ../../kpathsea/progname.h \
 ../../kpathsea/str-list.h ../../kpathsea/str-llist.h \
 ../../kpathsea/systypes.h ../../kpathsea/types.h ../../kpathsea/win32lib.h \
 ../w2c/c-auto.h ../w2c/config.h ../lib/lib.h
input2int.obj: input2int.c ../../kpathsea/c-auto.h ../../kpathsea/c-errno.h \
 ../../kpathsea/c-fopen.h ../../kpathsea/c-limits.h \
 ../../kpathsea/c-memstr.h ../../kpathsea/c-minmax.h \
 ../../kpathsea/c-proto.h ../../kpathsea/c-std.h ../../kpathsea/c-unistd.h \
 ../../kpathsea/config.h ../../kpathsea/debug.h ../../kpathsea/hash.h \
 ../../kpathsea/lib.h ../../kpathsea/progname.h ../../kpathsea/str-list.h \
 ../../kpathsea/str-llist.h ../../kpathsea/systypes.h \
 ../../kpathsea/types.h ../../kpathsea/win32lib.h ../w2c/c-auto.h \
 ../w2c/config.h ../lib/lib.h
inputint.obj: inputint.c ../../kpathsea/c-auto.h ../../kpathsea/c-errno.h \
 ../../kpathsea/c-fopen.h ../../kpathsea/c-limits.h \
 ../../kpathsea/c-memstr.h ../../kpathsea/c-minmax.h \
 ../../kpathsea/c-proto.h ../../kpathsea/c-std.h ../../kpathsea/c-unistd.h \
 ../../kpathsea/config.h ../../kpathsea/debug.h ../../kpathsea/hash.h \
 ../../kpathsea/lib.h ../../kpathsea/progname.h ../../kpathsea/str-list.h \
 ../../kpathsea/str-llist.h ../../kpathsea/systypes.h \
 ../../kpathsea/types.h ../../kpathsea/win32lib.h ../w2c/c-auto.h \
 ../w2c/config.h ../lib/lib.h
main.obj: main.c ../../kpathsea/c-auto.h ../../kpathsea/c-errno.h \
 ../../kpathsea/c-fopen.h ../../kpathsea/c-limits.h \
 ../../kpathsea/c-memstr.h ../../kpathsea/c-minmax.h \
 ../../kpathsea/c-proto.h ../../kpathsea/c-std.h ../../kpathsea/c-unistd.h \
 ../../kpathsea/config.h ../../kpathsea/debug.h ../../kpathsea/hash.h \
 ../../kpathsea/lib.h ../../kpathsea/progname.h ../../kpathsea/str-list.h \
 ../../kpathsea/str-llist.h ../../kpathsea/systypes.h \
 ../../kpathsea/types.h ../../kpathsea/win32lib.h ../w2c/c-auto.h \
 ../w2c/config.h ../lib/lib.h
openclose.obj: openclose.c ../../kpathsea/absolute.h \
 ../../kpathsea/c-auto.h ../../kpathsea/c-ctype.h ../../kpathsea/c-errno.h \
 ../../kpathsea/c-fopen.h ../../kpathsea/c-limits.h \
 ../../kpathsea/c-memstr.h ../../kpathsea/c-minmax.h \
 ../../kpathsea/c-pathch.h ../../kpathsea/c-proto.h ../../kpathsea/c-std.h \
 ../../kpathsea/c-unistd.h ../../kpathsea/config.h ../../kpathsea/debug.h \
 ../../kpathsea/hash.h ../../kpathsea/lib.h ../../kpathsea/progname.h \
 ../../kpathsea/str-list.h ../../kpathsea/str-llist.h \
 ../../kpathsea/systypes.h ../../kpathsea/tex-file.h ../../kpathsea/types.h \
 ../../kpathsea/variable.h ../../kpathsea/win32lib.h ../w2c/c-auto.h \
 ../w2c/config.h ../lib/lib.h
printversion.obj: printversion.c ../../kpathsea/c-auto.h \
 ../../kpathsea/c-errno.h ../../kpathsea/c-fopen.h \
 ../../kpathsea/c-limits.h ../../kpathsea/c-memstr.h \
 ../../kpathsea/c-minmax.h ../../kpathsea/c-proto.h ../../kpathsea/c-std.h \
 ../../kpathsea/c-unistd.h ../../kpathsea/config.h ../../kpathsea/debug.h \
 ../../kpathsea/hash.h ../../kpathsea/lib.h ../../kpathsea/progname.h \
 ../../kpathsea/str-list.h ../../kpathsea/str-llist.h \
 ../../kpathsea/systypes.h ../../kpathsea/types.h ../../kpathsea/version.h \
 ../../kpathsea/win32lib.h ../w2c/c-auto.h ../w2c/config.h ../lib/lib.h
setupvar.obj: setupvar.c ../../kpathsea/c-auto.h ../../kpathsea/c-errno.h \
 ../../kpathsea/c-fopen.h ../../kpathsea/c-limits.h \
 ../../kpathsea/c-memstr.h ../../kpathsea/c-minmax.h \
 ../../kpathsea/c-proto.h ../../kpathsea/c-std.h ../../kpathsea/c-unistd.h \
 ../../kpathsea/config.h ../../kpathsea/debug.h ../../kpathsea/hash.h \
 ../../kpathsea/lib.h ../../kpathsea/progname.h ../../kpathsea/str-list.h \
 ../../kpathsea/str-llist.h ../../kpathsea/systypes.h \
 ../../kpathsea/types.h ../../kpathsea/variable.h ../../kpathsea/win32lib.h \
 ../w2c/c-auto.h ../w2c/config.h ../lib/lib.h
uexit.obj: uexit.c ../../kpathsea/c-auto.h ../../kpathsea/c-errno.h \
 ../../kpathsea/c-fopen.h ../../kpathsea/c-limits.h \
 ../../kpathsea/c-memstr.h ../../kpathsea/c-minmax.h \
 ../../kpathsea/c-proto.h ../../kpathsea/c-std.h ../../kpathsea/c-unistd.h \
 ../../kpathsea/config.h ../../kpathsea/debug.h ../../kpathsea/hash.h \
 ../../kpathsea/lib.h ../../kpathsea/progname.h ../../kpathsea/str-list.h \
 ../../kpathsea/str-llist.h ../../kpathsea/systypes.h \
 ../../kpathsea/types.h ../../kpathsea/win32lib.h ../w2c/c-auto.h \
 ../w2c/config.h
usage.obj: usage.c ../../kpathsea/c-auto.h ../../kpathsea/c-errno.h \
 ../../kpathsea/c-fopen.h ../../kpathsea/c-limits.h \
 ../../kpathsea/c-memstr.h ../../kpathsea/c-minmax.h \
 ../../kpathsea/c-proto.h ../../kpathsea/c-std.h ../../kpathsea/c-unistd.h \
 ../../kpathsea/config.h ../../kpathsea/debug.h ../../kpathsea/hash.h \
 ../../kpathsea/lib.h ../../kpathsea/progname.h ../../kpathsea/str-list.h \
 ../../kpathsea/str-llist.h ../../kpathsea/systypes.h \
 ../../kpathsea/types.h ../../kpathsea/win32lib.h ../w2c/c-auto.h \
 ../w2c/config.h
version.obj: version.c ../w2c/c-auto.h
zround.obj: zround.c ../../kpathsea/c-auto.h ../../kpathsea/c-errno.h \
 ../../kpathsea/c-fopen.h ../../kpathsea/c-limits.h \
 ../../kpathsea/c-memstr.h ../../kpathsea/c-minmax.h \
 ../../kpathsea/c-proto.h ../../kpathsea/c-std.h ../../kpathsea/c-unistd.h \
 ../../kpathsea/config.h ../../kpathsea/debug.h ../../kpathsea/hash.h \
 ../../kpathsea/lib.h ../../kpathsea/progname.h ../../kpathsea/str-list.h \
 ../../kpathsea/str-llist.h ../../kpathsea/systypes.h \
 ../../kpathsea/types.h ../../kpathsea/win32lib.h ../w2c/c-auto.h \
 ../w2c/config.h ../lib/lib.h
