DEPTH	= ..

SRCDIR	= ../utilities
LIBDIR	= ../libtiff

#
# VERSION:	v3.4033
# DATE:		Tue Sep 16 16:04:22 EST 1997
# TARGET:	hppa1.1-hp-hpux9.05
# CCOMPILER:	bin/cc
#
SHELL	= /bin/posix/sh
NULL	=
CC	= /bin/cc
INSTALL	= ${SHELL} ../port/install.sh
#
COPTS	= -g
#OPTIMIZER=-O
IPATH	= -I. -I${SRCDIR} -I${LIBDIR}
CFLAGS	= -Aa -D_HPUX_SOURCE -Dhpux ${COPTS} ${OPTIMIZER} ${IPATH}
#
LIBTIFF	= ${DEPTH}/libtiff/libtiff.a
LIBJPEG	= -L/home/offset/b/hui/bin/jpeg-uunet/jpeg-6a -ljpeg
LIBGZ	= 
LIBS	= ${LIBTIFF} ${LIBJPEG} ${LIBGZ}  -lm
#
OBJS=	\
	tiffRead.o \
	tiffWrite.o \
	colorTransform.o \
	tiffDifference.o \
	pxm.o \
	${NULL}
TARGETS	=\
	changeColorSpace \
	${NULL}

all:	${TARGETS}
	@if [ "no" = yes ]; then \
	    ${MAKE} sgi2tiff; \
	else \
	    true; \
	fi
	@if [ "no" = yes ]; then \
	    ${MAKE} tiffgt tiffsv; \
	else \
	    true; \
	fi
install: all
	${INSTALL} -idb tiff.sw.tools -m 755 -dir /home/offset/b/hui/bin/TIFF_sgi/bin
	${INSTALL} -idb tiff.sw.tools -m 755 -F /home/offset/b/hui/bin/TIFF_sgi/bin -O ${TARGETS}
	@if [ "no" = yes ]; then \
	    ${INSTALL} -idb tiff.sw.tools -m 755 -F /home/offset/b/hui/bin/TIFF_sgi/bin -O sgi2tiff; \
	else \
	    true; \
	fi
	@if [ "no" = yes ]; then \
	    ${INSTALL} -idb tiff.sw.tools -m 755 -F /home/offset/b/hui/bin/TIFF_sgi/bin -O tiffgt tiffsv;\
	else \
	    true; \
	fi
clean:
	rm -f ${TARGETS} ${OBJS} sgigt.o tiffgt sgisv.o tiffsv \
	    sgi2tiff.o sgi2tiff core a.out ycbcr 

#
# System-independent tools
#

changeColorSpace: changeColorSpace.o ${OBJS} ${LIBTIFF}
	${CC} -o changeColorSpace ${CFLAGS} changeColorSpace.o ${OBJS}  ${LIBS}
changeColorSpace.o: ${SRCDIR}/changeColorSpace.c
	${CC} -c ${CFLAGS} ${SRCDIR}/changeColorSpace.c


#
# Junky stuff... programs that are more examples of how
# to use the library than full-blown useful tools.
#

# convert RGB image to B&W
tiff2bw: tiff2bw.o ${LIBTIFF}
	${CC} -o tiff2bw ${CFLAGS} tiff2bw.o ${LIBS}
tiff2bw.o: ${SRCDIR}/tiff2bw.c
	${CC} -c ${CFLAGS} ${SRCDIR}/tiff2bw.c

# Group 3/4 FAX file converter
fax2tiff: fax2tiff.o ${LIBTIFF}
	${CC} -o fax2tiff ${CFLAGS} fax2tiff.o ${LIBS}
fax2tiff.o: ${SRCDIR}/fax2tiff.c
	${CC} -c -I${LIBDIR} -I${DEPTH}/libtiff ${CFLAGS} ${SRCDIR}/fax2tiff.c

# Group 3/4 FAX to encoded PS converter
fax2ps: fax2ps.o ${LIBTIFF}
	${CC} -o fax2ps ${CFLAGS} fax2ps.o ${LIBS}
fax2ps.o: ${SRCDIR}/fax2ps.c
	${CC} -c ${CFLAGS} ${SRCDIR}/fax2ps.c


#
# System-specific tools.
#

#
# sgi2tiff converts SGI RGB images to TIFF; it requires
# the SGI image library -limage.
#
sgi2tiff: sgi2tiff.o ${LIBTIFF}
	${CC} -o sgi2tiff ${CFLAGS} sgi2tiff.o -limage ${LIBS}
sgi2tiff.o: ${SRCDIR}/sgi2tiff.c
	${CC} -c ${CFLAGS} ${SRCDIR}/sgi2tiff.c

