# Makefile for tiff2png
# Copyright (C) 1996 Willem van Schaik

CC=cl
OPTIMFLAGS = -O2 -favor:blend
DEBUGFLAGS = -nologo -MD -DWIN32=1
COPY=cp -p
DEL=rm -f

# TAKE CARE:  If you use the (very old) libtiff that comes with netpbm, which
#             is v2.4, you may need to change this to -DOLD_LIBTIFF.  (The
#             only difference is whether tiffcomp.h is included; it is not
#             installed by default in newer versions of libtiff, but it may
#             have been required for older versions.)
TIFF_VERSION =

# It appears that PHOTOMETRIC_MINISWHITE should always be inverted (which
# makes sense), but if you find a class of TIFFs or a version of libtiff for
# which that is *not* the case, try not defining INVERT_MINISWHITE:
#
#MIN_INVERT =
MIN_INVERT = -DINVERT_MINISWHITE  


# change to match your directories (you see the ./ and ../ ?!?!)
LIBTIFF=../../libs/libtiff/libtiff/libtiff.lib
LIBJPEG=../../libs/libjpeg/libjpeg.lib
TIFFINC=../../libs/libtiff/libtiff
LIBPNG=../../libs/libpng/libpng.lib
PNGINC=../../libs/libpng
ZLIB=../../libs/zlib/libz.lib
ZINC=../../libs/zlib

INSTALL=c:/usr/local

# GRR 19990713:  FAXPECT is a custom conversion option for stretched faxes
CFLAGS=$(TIFF_VERSION) -DFAXPECT $(MIN_INVERT) $(OPTIMFLAGS) $(DEBUGFLAGS) \
	-I$(TIFFINC) \
	-I$(PNGINC) \
	-I$(ZINC)
LDFLAGS=$(LIBTIFF) $(LIBPNG) $(ZLIB)

SLDFLAGS=

OBJS = tiff2png.obj

# default is dynamic only (or mixed dynamic/static, depending on installed libs)
default: tiff2png.exe

# it's nice to have a choice, though
all: tiff2png.exe

tiff2png.exe: tiff2png.obj
	$(CC) -Fetiff2png.exe tiff2png.obj $(LDFLAGS)
clean::
	$(DEL) *~ *.obj tiff2png.exe

# leave this line empty

$(OBJS): tiff2png.c
	$(CC) $(CFLAGS) -c -w $<

ZZ=c:/usr/local/txdir/w32tex/bin64

install: tiff2png.exe
	cp -p tiff2png.exe c:/usr/work/edrive/wk/w64dist/TIFF2PNG/bin64/
	cp -p tiff2png.exe $(ZZ)/
