/*
 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: This software is part of version 7.2 of the 
* Andrew User Interface System and is the 
* property of IBM, Carnegie Mellon University, 
* and the other copyright holders.  The source 
* code of this version is for the sole use of 
* members of the Andrew Consortium with 
* memberships extending into calendar year 
* 1994.  This source code is not to be distributed 
* to non-members of the consortium nor beyond 
* a fifty-mile radius from the membership address.  
* Binary object code compiled or derived from 
* these sources is not to be distributed to non-
* members.  Members may have additional 
* distribution rights granted by prior written 
* permission of Carnegie Mellon University.
* 
* IBM, CARNEGIE MELLON UNIVERSITY, 
* AND THE OTHER COPYRIGHT HOLDERS
*  DISCLAIM ALL WARRANTIES WITH 
* REGARD TO THIS SOFTWARE, INCLUDING 
* ALL IMPLIED WARRANTIES OF MERCHANT-
* ABILITY AND FITNESS. IN 
* NO EVENT SHALL  IBM, CARNEGIE 
* MELLON UNIVERSITY, OR ANY OTHER 
* COPYRIGHT HOLDER BE LIABLE FOR 
* ANY SPECIAL, INDIRECT OR CONSE-
* QUENTIAL 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 */

#ifdef ANSI_COMPILER
COMP_CONF=-DUSE_VARARGS=0 -DUSE_PROTOTYPES=1 -DUSE_CONST=1
#else
COMP_CONF=-DUSE_VARARGS=1 -DUSE_PROTOTYPES=0 -DUSE_CONST=0
#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()
DependTarget(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)
