1#	$Header: /cvsroot/osrs/libtiff/contrib/dosdjgpp/Makefile.tools,v 1.1.1.1 1999/07/27 21:50:27 mike Exp $
2#
3# manually derived from Makefile.in for DJGPP v2.x (GNU C for DOS/386).
4#
5# TIFF Library Tools
6#
7# Copyright (c) 1988-1996 Sam Leffler
8# Copyright (c) 1991-1996 Silicon Graphics, Inc.
9#
10# Permission to use, copy, modify, distribute, and sell this software and
11# its documentation for any purpose is hereby granted without fee, provided
12# that (i) the above copyright notices and this permission notice appear in
13# all copies of the software and related documentation, and (ii) the names of
14# Sam Leffler and Silicon Graphics may not be used in any advertising or
15# publicity relating to the software without the specific, prior written
16# permission of Stanford and Silicon Graphics.
17#
18# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
19# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
20# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
21#
22# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
23# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
24# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
25# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
26# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
27# OF THIS SOFTWARE.
28#
29DEPTH	= ..
30SRCDIR	= .
31LIBDIR	= ${DEPTH}/libtiff
32
33NULL	=
34CC	= gcc
35#
36COPTS	=
37OPTIMIZER=-O
38IPATH	= -I. -I${SRCDIR} -I${LIBDIR}
39CFLAGS	= ${COPTS} ${OPTIMIZER} ${IPATH}
40#
41LIBTIFF	= ${DEPTH}/libtiff/libtiff.a
42LIBJPEG	= #@LIBJPEG@
43LIBGZ	= #@LIBGZ@
44LIBS	= ${LIBTIFF} ${LIBJPEG} ${LIBGZ}
45#
46OBJS=	\
47	fax2tiff.o \
48	fax2ps.o \
49	gif2tiff.o \
50	pal2rgb.o \
51	ppm2tiff.o \
52	rgb2ycbcr.o \
53	ras2tiff.o \
54	thumbnail.o \
55	tiff2bw.o \
56	tiff2ps.o \
57	tiffcmp.o \
58	tiffcp.o \
59	tiffdither.o \
60	tiffdump.o \
61	tiffinfo.o \
62	tiffmedian.o \
63	tiffsplit.o \
64	${NULL}
65TARGETS	=\
66	fax2tiff \
67	fax2ps \
68	gif2tiff \
69	pal2rgb \
70	ppm2tiff \
71	rgb2ycbcr \
72	thumbnail \
73	ras2tiff \
74	tiff2bw \
75	tiff2ps \
76	tiffcmp \
77	tiffcp \
78	tiffdither \
79	tiffdump \
80	tiffinfo \
81	tiffmedian \
82	tiffsplit \
83	${NULL}
84
85all:	${TARGETS}
86
87clean:
88	rm -f ${TARGETS} ${addsuffix .exe, ${TARGETS}} ${OBJS}
89	rm -f sgigt.o tiffgt sgisv.o tiffsv sgi2tiff.o sgi2tiff ycbcr
90
91#
92# System-independent tools
93#
94
95tiffinfo: tiffinfo.o ${LIBTIFF}
96	${CC} -o tiffinfo ${CFLAGS} tiffinfo.o ${LIBS}
97tiffinfo.o: ${SRCDIR}/tiffinfo.c
98	${CC} -c ${CFLAGS} ${SRCDIR}/tiffinfo.c
99
100tiffcmp:tiffcmp.o ${LIBTIFF}
101	${CC} -o tiffcmp ${CFLAGS} tiffcmp.o ${LIBS}
102tiffcmp.o: ${SRCDIR}/tiffcmp.c
103	${CC} -c ${CFLAGS} ${SRCDIR}/tiffcmp.c
104
105tiffcp:	tiffcp.o ${LIBTIFF}
106	${CC} -o tiffcp ${CFLAGS} tiffcp.o ${LIBS}
107tiffcp.o: ${SRCDIR}/tiffcp.c
108	${CC} -c ${CFLAGS} ${SRCDIR}/tiffcp.c
109
110tiffdump: tiffdump.o
111	${CC} -o tiffdump ${CFLAGS} tiffdump.o ${LIBS}
112tiffdump.o: ${SRCDIR}/tiffdump.c
113	${CC} -c ${CFLAGS} ${SRCDIR}/tiffdump.c
114
115tiffmedian: tiffmedian.o ${LIBTIFF}
116	${CC} -o tiffmedian ${CFLAGS} tiffmedian.o ${LIBS}
117tiffmedian.o: ${SRCDIR}/tiffmedian.c
118	${CC} -c ${CFLAGS} ${SRCDIR}/tiffmedian.c
119
120tiffsplit: tiffsplit.o ${LIBTIFF}
121	${CC} -o tiffsplit ${CFLAGS} tiffsplit.o ${LIBS}
122tiffsplit.o: ${SRCDIR}/tiffsplit.c
123	${CC} -c ${CFLAGS} ${SRCDIR}/tiffsplit.c
124
125tiff2ps: tiff2ps.o ${LIBTIFF}
126	${CC} -o tiff2ps ${CFLAGS} tiff2ps.o ${LIBS}
127tiff2ps.o: ${SRCDIR}/tiff2ps.c
128	${CC} -c ${CFLAGS} ${SRCDIR}/tiff2ps.c
129
130#
131# Junky stuff... programs that are more examples of how
132# to use the library than full-blown useful tools.
133#
134
135# convert RGB image to B&W
136tiff2bw: tiff2bw.o ${LIBTIFF}
137	${CC} -o tiff2bw ${CFLAGS} tiff2bw.o ${LIBS}
138tiff2bw.o: ${SRCDIR}/tiff2bw.c
139	${CC} -c ${CFLAGS} ${SRCDIR}/tiff2bw.c
140
141# convert B&W image to bilevel w/ FS dithering
142tiffdither: tiffdither.o ${LIBTIFF}
143	${CC} -o tiffdither ${CFLAGS} tiffdither.o ${LIBS}
144tiffdither.o: ${SRCDIR}/tiffdither.c
145	${CC} -c ${CFLAGS} ${SRCDIR}/tiffdither.c
146
147# simple Sun rasterfile converter
148ras2tiff: ras2tiff.o ${LIBTIFF}
149	${CC} -o ras2tiff ${CFLAGS} ras2tiff.o ${LIBS}
150ras2tiff.o: ${SRCDIR}/ras2tiff.c
151	${CC} -c ${CFLAGS} ${SRCDIR}/ras2tiff.c
152
153# simple GIF converter
154gif2tiff: gif2tiff.o ${LIBTIFF}
155	${CC} -o gif2tiff ${CFLAGS} gif2tiff.o ${LIBS}
156gif2tiff.o: ${SRCDIR}/gif2tiff.c
157	${CC} -c ${CFLAGS} ${SRCDIR}/gif2tiff.c
158
159# very limited PBM converter
160ppm2tiff: ppm2tiff.o ${LIBTIFF}
161	${CC} -o ppm2tiff ${CFLAGS} ppm2tiff.o ${LIBS}
162ppm2tiff.o: ${SRCDIR}/ppm2tiff.c
163	${CC} -c ${CFLAGS} ${SRCDIR}/ppm2tiff.c
164
165# Group 3/4 FAX file converter
166fax2tiff: fax2tiff.o ${LIBTIFF}
167	${CC} -o fax2tiff ${CFLAGS} fax2tiff.o ${LIBS}
168fax2tiff.o: ${SRCDIR}/fax2tiff.c
169	${CC} -c -I${LIBDIR} -I${DEPTH}/libtiff ${CFLAGS} ${SRCDIR}/fax2tiff.c
170
171# Group 3/4 FAX to encoded PS converter
172fax2ps: fax2ps.o ${LIBTIFF}
173	${CC} -o fax2ps ${CFLAGS} fax2ps.o ${LIBS}
174fax2ps.o: ${SRCDIR}/fax2ps.c
175	${CC} -c ${CFLAGS} ${SRCDIR}/fax2ps.c
176
177# convert Palette image to RGB
178pal2rgb: pal2rgb.o ${LIBTIFF}
179	${CC} -o pal2rgb ${CFLAGS} pal2rgb.o ${LIBS}
180pal2rgb.o: ${SRCDIR}/pal2rgb.c
181	${CC} -c ${CFLAGS} ${SRCDIR}/pal2rgb.c
182
183# convert RGB image to YCbCr
184rgb2ycbcr: rgb2ycbcr.o ${LIBTIFF}
185	${CC} -o rgb2ycbcr ${CFLAGS} rgb2ycbcr.o ${LIBS}
186rgb2ycbcr.o: ${SRCDIR}/rgb2ycbcr.c
187	${CC} -c ${CFLAGS} ${SRCDIR}/rgb2ycbcr.c
188
189# generate thumbnail images from fax (example of SubIFD usage)
190thumbnail: thumbnail.o ${LIBTIFF}
191	${CC} -o thumbnail ${CFLAGS} thumbnail.o ${LIBS}
192thumbnail.o: ${SRCDIR}/thumbnail.c
193	${CC} -c ${CFLAGS} ${SRCDIR}/thumbnail.c
194
195#
196# System-specific tools.
197#
198
199#
200# sgi2tiff converts SGI RGB images to TIFF; it requires
201# the SGI image library -limage.
202#
203sgi2tiff: sgi2tiff.o ${LIBTIFF}
204	${CC} -o sgi2tiff ${CFLAGS} sgi2tiff.o -limage ${LIBS}
205sgi2tiff.o: ${SRCDIR}/sgi2tiff.c
206	${CC} -c ${CFLAGS} ${SRCDIR}/sgi2tiff.c
207
208# SGI versions of tiffgt & tiffsv that require -lgl
209tiffgt:	sgigt.o ${LIBTIFF}
210	${CC} -o tiffgt ${CFLAGS} sgigt.o ${LIBS} -lgutil -lgl_s
211sgigt.o: ${SRCDIR}/sgigt.c
212	${CC} -c ${CFLAGS} ${SRCDIR}/sgigt.c
213
214tiffsv:	sgisv.o ${LIBTIFF}
215	${CC} -o tiffsv ${CFLAGS} sgisv.o ${LIBS} -lgutil -lgl_s
216sgisv.o: ${SRCDIR}/sgisv.c
217	${CC} -c ${CFLAGS} ${SRCDIR}/sgisv.c
218