/*
 Library-wide configuration defines:
    MMAP_SUPPORT	add support for memory mapping read-only files
    COLORIMETRY_SUPPORT add support for 6.0 colorimetry tags
    JPEG_SUPPORT	add support for 6.0 JPEG tags & JPEG algorithms
    YCBCR_SUPPORT	add support for 6.0 YCbCr tags
    CMYK_SUPPORT	add support for 6.0 CMYK tags

 Compression configuration defines:
    CCITT_SUPPORT	add support for CCITT Group 3 & 4 algorithms
    PACKBITS_SUPPORT	add support for Macintosh PackBits algorithm
    LZW_SUPPORT	add support for LZW algorithm
    THUNDER_SUPPORT	add support for ThunderScan 4-bit RLE algorithm
    NEXT_SUPPORT	add support for NeXT 2-bit RLE algorithm
    JPEG_SUPPORT	add support for JPEG DCT algorithm

 Note that if you change the library-wide configuration, you'll
 need to manual force a full rebuild.  Changing the configuration
 of which compression algorithms are included in the library is
 automatically handled (i.e. tif_compress.o has a dependency on
 the Makefile).

CONFIGURE: */

/*
	$Disclaimer: 
*Permission to use, copy, modify, and distribute this software and its 
*documentation for any purpose is hereby granted without fee, 
*provided that the above copyright notice appear in all copies and that 
*both that copyright notice, this permission notice, and the following 
*disclaimer appear in supporting documentation, and that the names of 
*IBM, Carnegie Mellon University, and other copyright holders, not be 
*used in advertising or publicity pertaining to distribution of the software 
*without specific, written prior permission.
*
*IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 
*DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
*ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 
*SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 
*BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 
*DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
*WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
*ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
*OF THIS SOFTWARE.
* $
*/


CONF_COMPRESSION=\
	-DPACKBITS_SUPPORT \
	-DLZW_SUPPORT \
	-DCCITT_SUPPORT \
	-DTHUNDER_SUPPORT  \
	-DNEXT_SUPPORT

/* CONFIGURE: AIX 3.2	: add -DMMAP_SUPPORT (?)
            AIX 2.1.1	: -DUSE_VARARGS=1 -DUSE_PROTOTYPES=0 -DUSE_CONST=0 */

#if defined(ANSI_COMPILER)
COMP_CONF=-DUSE_VARARGS=0 -DUSE_PROTOTYPES=1 -DUSE_CONST=1
#else
#ifndef linux
COMP_CONF=-DUSE_VARARGS=1 -DUSE_PROTOTYPES=0 -DUSE_CONST=0
#endif
#endif

CONF_LIBRARY=\
	$(COMP_CONF)\
	-DHAVE_IEEEFP=1 \
	-DCOLORIMETRY_SUPPORT \
	-DJPEG_SUPPORT \
	-DYCBCR_SUPPORT \
	-DCMYK_SUPPORT

DEFINES = -Dunix  ${CONF_LIBRARY}

INCS=	tiff.h tiffio.h
OBJS=	tif_fax3.o \
	tif_fax4.o \
	tif_aux.o \
	tif_ccittrle.o \
	tif_close.o \
	tif_compat.o \
	tif_compress.o \
	tif_dir.o \
	tif_dirinfo.o \
	tif_dirread.o \
	tif_dirwrite.o \
	tif_dumpmode.o \
	tif_error.o \
	tif_getimage.o \
	tif_jpeg.o \
	tif_flush.o \
	tif_lzw.o \
	tif_next.o \
	tif_open.o \
	tif_packbits.o \
	tif_print.o \
	tif_read.o \
	tif_strip.o \
	tif_swab.o \
	tif_thunder.o \
	tif_tile.o \
	tif_version.o \
	tif_warning.o \
	tif_write.o

tif_compress.o: tif_compress.c Makefile
	${CC} -c ${CFLAGS} ${CONF_COMPRESSION} tif_compress.c

NormalObjectRule()
DependTargetFiles(g3states.h)

LibraryTarget(libtiff.a,${OBJS})

clean::
	${RM} g3states.h mkg3states

/* CONFIGURE: Remove '-c' in AIX 2.1.1 */
g3states.h: mkg3states.c t4.h
	${CC} -o mkg3states ${CFLAGS} mkg3states.c
	./mkg3states -c > g3states.h

InstallLibrary(libtiff.a,${BASEDIR}/lib)
InstallMultiple(${INCS}, ${INSTINCFLAGS},${BASEDIR}/include)
