1 # Makefile for Independent JPEG Group's software
3 # makefile.cfg is edited by configure to produce a custom Makefile.
5 # Read installation instructions before saying "make" !!
7 # For compiling with source and object files in different directories.
11 # Where to install the programs and man pages.
13 exec_prefix = @exec_prefix@
14 bindir = $(exec_prefix)/bin
15 libdir = $(exec_prefix)/lib
16 includedir = $(prefix)/include
20 mandir = $(prefix)/man/man$(manext)
22 # The name of your C compiler:
25 # You may need to adjust these cc options:
26 CFLAGS= @CFLAGS@ @CPPFLAGS@ @INCLUDEFLAGS@
27 # Generally, we recommend defining any configuration symbols in jconfig.h,
28 # NOT via -D switches here.
29 # However, any special defines for ansi2knr.c may be included here:
30 ANSI2KNRFLAGS= @ANSI2KNRFLAGS@
32 # Link-time cc options:
35 # To link any special libraries, add the necessary -l commands here.
38 # If using GNU libtool, LIBTOOL references it; if not, LIBTOOL is empty.
40 # $(O) expands to "lo" if using libtool, plain "o" if not.
41 # Similarly, $(A) expands to "la" or "a".
45 # Library version ID; libtool uses this for the shared library version number.
46 # Note: we suggest this match the macro of the same name in jpeglib.h.
47 JPEG_LIB_VERSION = @JPEG_LIB_VERSION@
49 # Put here the object file name for the correct system-dependent memory
50 # manager file. For Unix this is usually jmemnobs.o, but you may want
51 # to use jmemansi.o or jmemname.o if you have limited swap space.
52 SYSDEPMEM= @MEMORYMGR@
54 # miscellaneous OS-dependent stuff
58 # file deletion command
60 # directory creation command
62 # library (.a) file creation command
64 # second step in .a creation (use "touch" if not needed)
66 # installation program
68 INSTALL_PROGRAM= @INSTALL_PROGRAM@
69 INSTALL_LIB= @INSTALL_LIB@
70 INSTALL_DATA= @INSTALL_DATA@
72 # End of configurable options.
75 # source files: JPEG library proper
76 LIBSOURCES= jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \
77 jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
78 jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
79 jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
80 jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
81 jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
82 jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c jquant1.c \
83 jquant2.c jutils.c jmemmgr.c
84 # memmgr back ends: compile only one of these into a working library
85 SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
86 # source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
87 APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
88 rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
89 rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
90 SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
91 # files included by source files
92 INCLUDES= jchuff.h jdhuff.h jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h \
93 jpegint.h jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
94 # documentation, test, and support files
95 DOCS= README install.doc usage.doc cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
96 wrjpgcom.1 wizard.doc example.c libjpeg.doc structure.doc \
97 coderules.doc filelist.doc change.log
98 MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.bcc \
99 makefile.mc6 makefile.dj makefile.wat makefile.vc makelib.ds \
100 makeapps.ds makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
101 maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
103 CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
104 jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
106 CONFIGUREFILES= config.guess config.sub install-sh ltconfig ltmain.sh
107 OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
108 TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
110 DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
111 $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
112 # library object files common to compression and decompression
113 COMOBJECTS= jcomapi.$(O) jutils.$(O) jerror.$(O) jmemmgr.$(O) $(SYSDEPMEM)
114 # compression library object files
115 CLIBOBJECTS= jcapimin.$(O) jcapistd.$(O) jctrans.$(O) jcparam.$(O) \
116 jdatadst.$(O) jcinit.$(O) jcmaster.$(O) jcmarker.$(O) jcmainct.$(O) \
117 jcprepct.$(O) jccoefct.$(O) jccolor.$(O) jcsample.$(O) jchuff.$(O) \
118 jcphuff.$(O) jcdctmgr.$(O) jfdctfst.$(O) jfdctflt.$(O) \
120 # decompression library object files
121 DLIBOBJECTS= jdapimin.$(O) jdapistd.$(O) jdtrans.$(O) jdatasrc.$(O) \
122 jdmaster.$(O) jdinput.$(O) jdmarker.$(O) jdhuff.$(O) jdphuff.$(O) \
123 jdmainct.$(O) jdcoefct.$(O) jdpostct.$(O) jddctmgr.$(O) \
124 jidctfst.$(O) jidctflt.$(O) jidctint.$(O) jidctred.$(O) \
125 jdsample.$(O) jdcolor.$(O) jquant1.$(O) jquant2.$(O) jdmerge.$(O)
126 # These objectfiles are included in libjpeg.a
127 LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
128 # object files for sample applications (excluding library files)
129 COBJECTS= cjpeg.$(O) rdppm.$(O) rdgif.$(O) rdtarga.$(O) rdrle.$(O) \
130 rdbmp.$(O) rdswitch.$(O) cdjpeg.$(O)
131 DOBJECTS= djpeg.$(O) wrppm.$(O) wrgif.$(O) wrtarga.$(O) wrrle.$(O) \
132 wrbmp.$(O) rdcolmap.$(O) cdjpeg.$(O)
133 TROBJECTS= jpegtran.$(O) rdswitch.$(O) cdjpeg.$(O) transupp.$(O)
136 all: @A2K_DEPS@ libjpeg.$(A) cjpeg djpeg jpegtran rdjpgcom wrjpgcom
138 # Special compilation rules to support ansi2knr and libtool.
141 # How to compile with libtool.
143 @COM_LT@ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/$*.c
145 # How to use ansi2knr, when not using libtool.
147 @COM_A2K@ ./ansi2knr $(srcdir)/$*.c knr/$*.c
148 @COM_A2K@ $(CC) $(CFLAGS) -c knr/$*.c
149 @COM_A2K@ $(RM) knr/$*.c
151 # How to use ansi2knr AND libtool.
153 @COM_A2K@ ./ansi2knr $(srcdir)/$*.c knr/$*.c
154 @COM_A2K@ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c knr/$*.c
155 @COM_A2K@ $(RM) knr/$*.c
158 $(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr $(srcdir)/ansi2knr.c
164 libjpeg.a: @A2K_DEPS@ $(LIBOBJECTS)
166 $(AR) libjpeg.a $(LIBOBJECTS)
170 libjpeg.la: @A2K_DEPS@ $(LIBOBJECTS)
171 $(LIBTOOL) --mode=link $(CC) -o libjpeg.la $(LIBOBJECTS) \
172 -rpath $(libdir) -version-info $(JPEG_LIB_VERSION)
176 cjpeg: $(COBJECTS) libjpeg.$(A)
177 $(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.$(A) $(LDLIBS)
179 djpeg: $(DOBJECTS) libjpeg.$(A)
180 $(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.$(A) $(LDLIBS)
182 jpegtran: $(TROBJECTS) libjpeg.$(A)
183 $(LN) $(LDFLAGS) -o jpegtran $(TROBJECTS) libjpeg.$(A) $(LDLIBS)
185 rdjpgcom: rdjpgcom.$(O)
186 $(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.$(O) $(LDLIBS)
188 wrjpgcom: wrjpgcom.$(O)
189 $(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.$(O) $(LDLIBS)
191 # Installation rules:
193 install: cjpeg djpeg jpegtran rdjpgcom wrjpgcom @FORCE_INSTALL_LIB@
194 $(INSTALL_PROGRAM) cjpeg $(bindir)/$(binprefix)cjpeg
195 $(INSTALL_PROGRAM) djpeg $(bindir)/$(binprefix)djpeg
196 $(INSTALL_PROGRAM) jpegtran $(bindir)/$(binprefix)jpegtran
197 $(INSTALL_PROGRAM) rdjpgcom $(bindir)/$(binprefix)rdjpgcom
198 $(INSTALL_PROGRAM) wrjpgcom $(bindir)/$(binprefix)wrjpgcom
199 $(INSTALL_DATA) $(srcdir)/cjpeg.1 $(mandir)/$(manprefix)cjpeg.$(manext)
200 $(INSTALL_DATA) $(srcdir)/djpeg.1 $(mandir)/$(manprefix)djpeg.$(manext)
201 $(INSTALL_DATA) $(srcdir)/jpegtran.1 $(mandir)/$(manprefix)jpegtran.$(manext)
202 $(INSTALL_DATA) $(srcdir)/rdjpgcom.1 $(mandir)/$(manprefix)rdjpgcom.$(manext)
203 $(INSTALL_DATA) $(srcdir)/wrjpgcom.1 $(mandir)/$(manprefix)wrjpgcom.$(manext)
205 install-lib: libjpeg.$(A) install-headers
206 $(INSTALL_LIB) libjpeg.$(A) $(libdir)/$(binprefix)libjpeg.$(A)
208 install-headers: jconfig.h
209 $(INSTALL_DATA) jconfig.h $(includedir)/jconfig.h
210 $(INSTALL_DATA) $(srcdir)/jpeglib.h $(includedir)/jpeglib.h
211 $(INSTALL_DATA) $(srcdir)/jmorecfg.h $(includedir)/jmorecfg.h
212 $(INSTALL_DATA) $(srcdir)/jerror.h $(includedir)/jerror.h
215 $(RM) *.o *.lo libjpeg.a libjpeg.la
216 $(RM) cjpeg djpeg jpegtran rdjpgcom wrjpgcom
217 $(RM) ansi2knr core testout* config.log config.status
218 $(RM) -r knr .libs _libs
221 $(RM) Makefile jconfig.h libtool config.cache
223 test: cjpeg djpeg jpegtran
225 ./djpeg -dct int -ppm -outfile testout.ppm $(srcdir)/testorig.jpg
226 ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg
227 ./cjpeg -dct int -outfile testout.jpg $(srcdir)/testimg.ppm
228 ./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg
229 ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm
230 ./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg
231 cmp $(srcdir)/testimg.ppm testout.ppm
232 cmp $(srcdir)/testimg.bmp testout.bmp
233 cmp $(srcdir)/testimg.jpg testout.jpg
234 cmp $(srcdir)/testimg.ppm testoutp.ppm
235 cmp $(srcdir)/testimgp.jpg testoutp.jpg
236 cmp $(srcdir)/testorig.jpg testoutt.jpg
242 jconfig.h: jconfig.doc
243 echo You must prepare a system-dependent jconfig.h file.
244 echo Please read the installation directions in install.doc.
247 # GNU Make likes to know which target names are not really files to be made:
248 .PHONY: all install install-lib install-headers clean distclean test check
251 jcapimin.$(O): jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
252 jcapistd.$(O): jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
253 jccoefct.$(O): jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
254 jccolor.$(O): jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
255 jcdctmgr.$(O): jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
256 jchuff.$(O): jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
257 jcinit.$(O): jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
258 jcmainct.$(O): jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
259 jcmarker.$(O): jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
260 jcmaster.$(O): jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
261 jcomapi.$(O): jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
262 jcparam.$(O): jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
263 jcphuff.$(O): jcphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jchuff.h
264 jcprepct.$(O): jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
265 jcsample.$(O): jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
266 jctrans.$(O): jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
267 jdapimin.$(O): jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
268 jdapistd.$(O): jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
269 jdatadst.$(O): jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
270 jdatasrc.$(O): jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
271 jdcoefct.$(O): jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
272 jdcolor.$(O): jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
273 jddctmgr.$(O): jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
274 jdhuff.$(O): jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
275 jdinput.$(O): jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
276 jdmainct.$(O): jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
277 jdmarker.$(O): jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
278 jdmaster.$(O): jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
279 jdmerge.$(O): jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
280 jdphuff.$(O): jdphuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdhuff.h
281 jdpostct.$(O): jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
282 jdsample.$(O): jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
283 jdtrans.$(O): jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
284 jerror.$(O): jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
285 jfdctflt.$(O): jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
286 jfdctfst.$(O): jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
287 jfdctint.$(O): jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
288 jidctflt.$(O): jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
289 jidctfst.$(O): jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
290 jidctint.$(O): jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
291 jidctred.$(O): jidctred.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
292 jquant1.$(O): jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
293 jquant2.$(O): jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
294 jutils.$(O): jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
295 jmemmgr.$(O): jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
296 jmemansi.$(O): jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
297 jmemname.$(O): jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
298 jmemnobs.$(O): jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
299 jmemdos.$(O): jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
300 jmemmac.$(O): jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
301 cjpeg.$(O): cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
302 djpeg.$(O): djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
303 jpegtran.$(O): jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
304 rdjpgcom.$(O): rdjpgcom.c jinclude.h jconfig.h
305 wrjpgcom.$(O): wrjpgcom.c jinclude.h jconfig.h
306 cdjpeg.$(O): cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
307 rdcolmap.$(O): rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
308 rdswitch.$(O): rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
309 transupp.$(O): transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
310 rdppm.$(O): rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
311 wrppm.$(O): wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
312 rdgif.$(O): rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
313 wrgif.$(O): wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
314 rdtarga.$(O): rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
315 wrtarga.$(O): wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
316 rdbmp.$(O): rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
317 wrbmp.$(O): wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
318 rdrle.$(O): rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
319 wrrle.$(O): wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h