all: detex.exe
SHELL = sh
MAKE=make
VERSION=2.8.7
top_srcdir = .
srcdir = .

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

YDEFS = -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE \
-D_CRT_OBSOLETE_NO_DEPRECATE -D_SECURE_SCL=0 -D__STDC_VERSION__=199901L

DEFS = -DHAVE_CONFIG_H -DWIN32=1 -DW32TEX=1 -DKPATHSEA=1 -DNOFILE=16 $(XDEFS)

XDEFS = -DYY_NO_UNISTD_H=1 $(YDEFS)
# Kpathsea needs this for compiling, programs need it for linking.
LIBTOOL =

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

LDFLAGS =  $(XLDFLAGS)

LIBS = 
LOADLIBES = $(proglib) $(kpathsea) $(LIBS) $(XLOADLIBES)
LEXLIB =

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

kpathsea_link = $(link_command)
# End of programs.mk.
# tkpathsea.mk -- target for remaking kpathsea.
makeargs = $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' $(XMAKEARGS)

program = detex.exe
prog_cflags = -DKPATHSEA=1

$(program): detex.obj $(kpathsea)
	$(kpathsea_link) detex.obj setargv.obj $(LEXLIB) $(LOADLIBES) -link /manifest
	mt -manifest $@.manifest -outputresource:$@";"1


detex.obj: detex.c detex.h
ZZ=c:/usr/local/txdir/w32tex/bin64/

clean:
	rm -f *.exe *.obj *~
install: detex.exe
	cp -p detex.exe c:/usr/work/edrive/wk/w64dist/WEB2CBIN/bin64/
	cp -p detex.exe $(ZZ)
