1#	$Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.sun,v 1.36 92/02/19 14:25:29 sam Exp $
2#
3# Tag Image File Format Library
4#
5# Copyright (c) 1988, 1989, 1990, 1991, 1992 Sam Leffler
6# Copyright (c) 1991, 1992 Silicon Graphics, Inc.
7#
8# Permission to use, copy, modify, distribute, and sell this software and
9# its documentation for any purpose is hereby granted without fee, provided
10# that (i) the above copyright notices and this permission notice appear in
11# all copies of the software and related documentation, and (ii) the names of
12# Sam Leffler and Silicon Graphics may not be used in any advertising or
13# publicity relating to the software without the specific, prior written
14# permission of Stanford and Silicon Graphics.
15#
16# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
17# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19#
20# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
21# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
22# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
23# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
24# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
25# OF THIS SOFTWARE.
26#
27include ../tiff.conf
28
29DESTDIR=.
30#
31NULL=
32
33IPATH=	-I.
34#
35# Library-wide configuration defines:
36#    MMAP_SUPPORT	add support for memory mapping read-only files
37#    COLORIMETRY_SUPPORT add support for 6.0 colorimetry tags
38#    JPEG_SUPPORT	add support for 6.0 JPEG tags & JPEG algorithms
39#    YCBCR_SUPPORT	add support for 6.0 YCbCr tags
40#    CMYK_SUPPORT	add support for 6.0 CMYK tags
41#
42# Compression configuration defines:
43#    CCITT_SUPPORT	add support for CCITT Group 3 & 4 algorithms
44#    PACKBITS_SUPPORT	add support for Macintosh PackBits algorithm
45#    LZW_SUPPORT	add support for LZW algorithm
46#    THUNDER_SUPPORT	add support for ThunderScan 4-bit RLE algorithm
47#    NEXT_SUPPORT	add support for NeXT 2-bit RLE algorithm
48#    JPEG_SUPPORT	add support for JPEG DCT algorithm
49#
50# Note that if you change the library-wide configuration, you'll
51# need to manual force a full rebuild.  Changing the configuration
52# of which compression algorithms are included in the library is
53# automatically handled (i.e. tif_compress.o has a dependency on
54# the Makefile).
55#
56CONF_COMPRESSION=\
57	-DPACKBITS_SUPPORT \
58	-DLZW_SUPPORT \
59	-DCCITT_SUPPORT \
60	-DTHUNDER_SUPPORT  \
61	-DNEXT_SUPPORT  \
62	${NULL}
63CONF_LIBRARY=\
64	-DHAVE_IEEEFP=1 \
65	-DCOLORIMETRY_SUPPORT \
66	-DYCBCR_SUPPORT \
67	${NULL}
68CFLAGS=	${OPT_FLAGS} ${IPATH} ${CONF_LIBRARY} ${TIFF_CC_FLAGS}
69#
70INCS=	tiff.h tiffio.h
71SRCS=	tif_fax3.c \
72	tif_fax4.c \
73	tif_aux.c \
74	tif_ccittrle.c \
75	tif_close.c \
76	tif_compat.c \
77	tif_compress.c \
78	tif_dir.c \
79	tif_dirinfo.c \
80	tif_dirread.c \
81	tif_dirwrite.c \
82	tif_dumpmode.c \
83	tif_error.c \
84	tif_getimage.c \
85	tif_jpeg.c \
86	tif_flush.c \
87	tif_lzw.c \
88	tif_next.c \
89	tif_open.c \
90	tif_packbits.c \
91	tif_print.c \
92	tif_read.c \
93	tif_swab.c \
94	tif_strip.c \
95	tif_thunder.c \
96	tif_tile.c \
97	tif_version.c \
98	tif_warning.c \
99	tif_write.c \
100	${NULL}
101OBJS=	tif_fax3.o \
102	tif_fax4.o \
103	tif_aux.o \
104	tif_ccittrle.o \
105	tif_close.o \
106	tif_compat.o \
107	tif_compress.o \
108	tif_dir.o \
109	tif_dirinfo.o \
110	tif_dirread.o \
111	tif_dirwrite.o \
112	tif_dumpmode.o \
113	tif_error.o \
114	tif_getimage.o \
115	tif_jpeg.o \
116	tif_flush.o \
117	tif_lzw.o \
118	tif_next.o \
119	tif_open.o \
120	tif_packbits.o \
121	tif_print.o \
122	tif_read.o \
123	tif_strip.o \
124	tif_swab.o \
125	tif_thunder.o \
126	tif_tile.o \
127	tif_version.o \
128	tif_warning.o \
129	tif_write.o \
130	${NULL}
131
132all:	 ${ALL}
133
134libtiff.a: ${OBJS}
135	$(RM) libtiff.a
136	$(AR) libtiff.a $?
137	$(RANLIB) libtiff.a
138
139${OBJS}: tiffio.h tiff.h tiffcompat.h tiffioP.h
140tif_compress.o: tif_compress.c Makefile
141	${CC} -c ${CFLAGS} ${CONF_COMPRESSION} tif_compress.c
142tif_fax3.o: tif_fax3.c g3states.h t4.h tif_fax3.h
143
144g3states.h: mkg3states.c t4.h
145	${CC} -o mkg3states ${CFLAGS} mkg3states.c
146	./mkg3states > g3states.h
147
148install: all installh
149	-for i in ${ALL}; do \
150		${INSTALL} -c -m 644 $$i ${DESTDIR}/lib/$$i; \
151		${RANLIB} ${DESTDIR}/lib/$$i; \
152	done
153
154installh: ${INCS}
155	-for i in ${INCS}; do \
156	    h=`basename $$i`; \
157	    cmp -s $$i ${DESTDIR}/include/$$h || \
158	        ${INSTALL} -c -m 444 $$i ${DESTDIR}/include/$$h; \
159	done
160
161clean:
162	rm -f ${OBJS} libtiff.a core a.out mkg3states g3states.h *~
163
164tags:	${SRCS}
165	${CTAGS} ${SRCS}
166