blob: 19f692c35ab534b7bd789e0dc58807bb5fc61dbb [file] [log] [blame]
DRC1bf1a142010-02-11 06:39:32 +00001lib_LTLIBRARIES = libjpeg.la libturbojpeg.la
DRC1f80a102010-10-18 00:15:31 +00002libjpeg_la_LDFLAGS = -version-info ${SO_MAJOR_VERSION}:${SO_MINOR_VERSION} -no-undefined
DRC21d66832010-02-12 04:34:41 +00003libturbojpeg_la_LDFLAGS = -avoid-version -no-undefined
DRC0a945a12010-02-15 11:04:51 +00004include_HEADERS = jerror.h jmorecfg.h jpeglib.h turbojpeg.h
5nodist_include_HEADERS = jconfig.h
DRC0c0f3042010-01-28 05:34:53 +00006
Adam Tkacda5a1fe2008-10-22 11:19:25 +00007HDRS = jchuff.h jdct.h jdhuff.h jerror.h jinclude.h jmemsys.h jmorecfg.h \
DRC1f80a102010-10-18 00:15:31 +00008 jpegint.h jpeglib.h jversion.h jsimd.h jsimddct.h jpegcomp.h
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +00009
DRCe3720042010-11-23 06:50:14 +000010libjpeg_la_SOURCES = $(HDRS) jcapimin.c jcapistd.c jccoefct.c jccolor.c \
11 jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
12 jcomapi.c jcparam.c jcphuff.c jcprepct.c jcsample.c jctrans.c \
13 jdapimin.c jdapistd.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
14 jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
15 jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c \
16 jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c \
17 jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c
18
19if WITH_ARITH
20
21libjpeg_la_SOURCES += jaricom.c
22
23endif
24
25if WITH_ARITH_ENC
26
27libjpeg_la_SOURCES += jcarith.c
28
29endif
30
31if WITH_ARITH_DEC
32
33libjpeg_la_SOURCES += jdarith.c
34
35endif
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +000036
DRC6f8c6682010-02-16 05:03:51 +000037libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpegl.c turbojpeg.h \
38 turbojpeg-mapfile
39
40if VERSION_SCRIPT
41
DRC6e51e192011-02-24 19:36:02 +000042libturbojpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)$(srcdir)/turbojpeg-mapfile
DRC8515d3d2010-10-19 06:38:57 +000043libjpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)libjpeg.map
DRC6f8c6682010-02-16 05:03:51 +000044
45endif
DRC1bf1a142010-02-11 06:39:32 +000046
DRC60cddeb2010-02-12 05:37:07 +000047if WITH_SIMD
48
Pierre Ossman3a65ef42009-03-16 13:34:18 +000049SUBDIRS = simd
50libjpeg_la_LIBADD = simd/libsimd.la
DRC1bf1a142010-02-11 06:39:32 +000051libturbojpeg_la_LIBADD = simd/libsimd.la
Pierre Ossman2ae181c2009-03-09 13:21:27 +000052
DRC60cddeb2010-02-12 05:37:07 +000053else
54
55libjpeg_la_SOURCES += jsimd_none.c
56
57endif
58
DRC1bf1a142010-02-11 06:39:32 +000059TSTHDRS = rrutil.h rrtimer.h
DRC2e7b76b2009-04-03 12:04:24 +000060
DRC240d82f2011-02-19 00:00:34 +000061bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom jpgtest
62noinst_PROGRAMS = jpegut
DRC2e7b76b2009-04-03 12:04:24 +000063
DRC2e4d0442011-02-08 01:18:37 +000064jpgtest_SOURCES = $(TSTHDRS) jpgtest.c bmp.h bmp.c
DRC2e7b76b2009-04-03 12:04:24 +000065
DRCda509e32011-02-18 21:16:04 +000066jpgtest_LDADD = libturbojpeg.la -lm
DRC2e7b76b2009-04-03 12:04:24 +000067
DRC1bf1a142010-02-11 06:39:32 +000068jpegut_SOURCES = $(TSTHDRS) jpegut.c bmp.h bmp.c
DRC2e7b76b2009-04-03 12:04:24 +000069
DRC971d8512010-02-13 22:55:05 +000070jpegut_LDADD = libturbojpeg.la
DRC73de9822009-06-25 20:41:17 +000071
72cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdbmp.c rdgif.c \
73 rdppm.c rdswitch.c rdtarga.c
74
DRC971d8512010-02-13 22:55:05 +000075cjpeg_LDADD = libjpeg.la
DRC73de9822009-06-25 20:41:17 +000076
77cjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
78 -DTARGA_SUPPORTED
79
80djpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \
81 wrbmp.c wrgif.c wrppm.c wrtarga.c
82
DRC971d8512010-02-13 22:55:05 +000083djpeg_LDADD = libjpeg.la
DRC73de9822009-06-25 20:41:17 +000084
85djpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
86 -DTARGA_SUPPORTED
DRC60fa0602010-02-12 06:01:49 +000087
DRC0a945a12010-02-15 11:04:51 +000088jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h
DRC60fa0602010-02-12 06:01:49 +000089
DRC971d8512010-02-13 22:55:05 +000090jpegtran_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +000091
DRC0a945a12010-02-15 11:04:51 +000092rdjpgcom_SOURCES = rdjpgcom.c
DRC60fa0602010-02-12 06:01:49 +000093
DRC971d8512010-02-13 22:55:05 +000094rdjpgcom_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +000095
96wrjpgcom_SOURCES = wrjpgcom.c
97
DRC971d8512010-02-13 22:55:05 +000098wrjpgcom_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +000099
DRC0a945a12010-02-15 11:04:51 +0000100
DRCcbda81a2010-06-05 01:12:35 +0000101dist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
DRC0a945a12010-02-15 11:04:51 +0000102
DRC39ea5622010-10-12 01:55:31 +0000103DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \
104 structure.txt coderules.txt filelist.txt jconfig.txt change.log \
DRC0b7d4ed2010-03-03 09:37:58 +0000105 README-turbo.txt rdrle.c wrrle.c LICENSE.txt LGPL.txt BUILDING.txt \
106 ChangeLog.txt
DRC0a945a12010-02-15 11:04:51 +0000107
DRC968c8bb2010-02-22 22:50:13 +0000108TESTFILES= testorig.jpg testorig.ppm testimg.bmp testimgflt.jpg \
DRC50503c72010-09-09 21:00:31 +0000109 testimgfst.jpg testimgint.jpg testimgp.jpg testimgflt.ppm testimgfst.ppm \
DRCf0b7fef2010-11-23 17:13:02 +0000110 testimgint.ppm testimgflt-nosimd.jpg testimgcrop.jpg testimgari.jpg \
DRC16e761e2011-02-18 21:20:50 +0000111 testimgari.ppm testimgfst100.jpg
DRC0a945a12010-02-15 11:04:51 +0000112
DRC1f80a102010-10-18 00:15:31 +0000113EXTRA_DIST = win release $(DOCS) $(TESTFILES) CMakeLists.txt \
DRC8515d3d2010-10-19 06:38:57 +0000114 sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in
DRC0a945a12010-02-15 11:04:51 +0000115
116dist-hook:
117 rm -rf `find $(distdir) -name .svn`
118
119
DRC66f97e62010-11-23 05:49:54 +0000120test: testclean all
121 ./jpegut
DRCfbb67472010-11-24 04:02:37 +0000122 ./jpegut -yuv
DRC66f97e62010-11-23 05:49:54 +0000123 ./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testorig.ppm
124 cmp $(srcdir)/testimgint.jpg testoutint.jpg
125 ./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testorig.ppm
126 cmp $(srcdir)/testimgfst.jpg testoutfst.jpg
DRC72abc292011-02-18 01:45:24 +0000127 ./cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg $(srcdir)/testorig.ppm
128 cmp $(srcdir)/testimgfst100.jpg testoutfst100.jpg
DRC66f97e62010-11-23 05:49:54 +0000129 ./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testorig.ppm
DRC83f21442010-06-10 18:52:41 +0000130if WITH_SIMD
DRC0fd8be52010-02-19 05:12:39 +0000131 cmp $(srcdir)/testimgflt.jpg testoutflt.jpg
DRC83f21442010-06-10 18:52:41 +0000132else
DRC83f21442010-06-10 18:52:41 +0000133 cmp $(srcdir)/testimgflt-nosimd.jpg testoutflt.jpg
DRC66f97e62010-11-23 05:49:54 +0000134endif
DRC83f21442010-06-10 18:52:41 +0000135 ./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testorig.jpg
DRC83f21442010-06-10 18:52:41 +0000136 cmp $(srcdir)/testimgint.ppm testoutint.ppm
DRC66f97e62010-11-23 05:49:54 +0000137 ./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testorig.jpg
DRC30959712010-08-07 16:06:56 +0000138 cmp $(srcdir)/testimgfst.ppm testoutfst.ppm
DRC66f97e62010-11-23 05:49:54 +0000139 ./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testorig.jpg
140if WITH_SIMD
141 cmp $(srcdir)/testimgflt.ppm testoutflt.ppm
142else
DRC30959712010-08-07 16:06:56 +0000143 cmp $(srcdir)/testorig.ppm testoutflt.ppm
DRC66f97e62010-11-23 05:49:54 +0000144endif
DRC83f21442010-06-10 18:52:41 +0000145 ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg
DRC30959712010-08-07 16:06:56 +0000146 cmp $(srcdir)/testimg.bmp testout.bmp
DRCe3720042010-11-23 06:50:14 +0000147if WITH_ARITH_ENC
DRC66f97e62010-11-23 05:49:54 +0000148 ./cjpeg -dct int -arithmetic -outfile testoutari.jpg $(srcdir)/testorig.ppm
149 cmp $(srcdir)/testimgari.jpg testoutari.jpg
DRCe3720042010-11-23 06:50:14 +0000150 ./jpegtran -arithmetic -outfile testouta.jpg $(srcdir)/testimgint.jpg
151 cmp $(srcdir)/testimgari.jpg testouta.jpg
152endif
153if WITH_ARITH_DEC
DRC66f97e62010-11-23 05:49:54 +0000154 ./djpeg -dct int -fast -ppm -outfile testoutari.ppm $(srcdir)/testimgari.jpg
155 cmp $(srcdir)/testimgari.ppm testoutari.ppm
DRCe3720042010-11-23 06:50:14 +0000156 ./jpegtran -outfile testouta.jpg $(srcdir)/testimgari.jpg
DRC66f97e62010-11-23 05:49:54 +0000157 cmp $(srcdir)/testimgint.jpg testouta.jpg
DRCe3720042010-11-23 06:50:14 +0000158endif
DRC30959712010-08-07 16:06:56 +0000159 ./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testorig.ppm
160 cmp $(srcdir)/testimgp.jpg testoutp.jpg
DRC83f21442010-06-10 18:52:41 +0000161 ./jpegtran -outfile testoutt.jpg testoutp.jpg
DRC30959712010-08-07 16:06:56 +0000162 cmp $(srcdir)/testimgint.jpg testoutt.jpg
DRC9a648cc2010-10-10 02:48:21 +0000163 ./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg $(srcdir)/testorig.jpg
DRCc04bd3c2010-10-10 02:15:56 +0000164 cmp $(srcdir)/testimgcrop.jpg testoutcrop.jpg
DRC83f21442010-06-10 18:52:41 +0000165
DRC83f21442010-06-10 18:52:41 +0000166
DRC34d59e72010-02-12 06:27:34 +0000167testclean:
DRC7b991722010-06-10 19:44:56 +0000168 rm -f testout*
169 rm -f *_GRAYQ[0-9]*.bmp
170 rm -f *_GRAYQ[0-9]*.ppm
171 rm -f *_GRAYQ[0-9]*.jpg
172 rm -f *_420Q[0-9]*.bmp
173 rm -f *_420Q[0-9]*.ppm
174 rm -f *_420Q[0-9]*.jpg
175 rm -f *_422Q[0-9]*.bmp
176 rm -f *_422Q[0-9]*.ppm
177 rm -f *_422Q[0-9]*.jpg
178 rm -f *_444Q[0-9]*.bmp
179 rm -f *_444Q[0-9]*.ppm
180 rm -f *_444Q[0-9]*.jpg
DRC079b4342010-02-15 11:32:23 +0000181
DRCd1c281a2010-11-17 22:44:40 +0000182if X86_64
183
184install-exec-hook:
185 __PREFIX=`echo ${prefix} | sed -e 's@\/*$$@@'`; \
186 if [ "$$__PREFIX" = "/opt/libjpeg-turbo" ]; then \
187 cd $(DESTDIR)/${prefix}; \
188 if [ -d lib -a ! -d lib64 -a ! -h lib64 ]; then \
189 $(LN_S) lib lib64; \
190 fi \
191 fi
192
193else
194
195install-exec-hook:
196 __PREFIX=`echo ${prefix} | sed -e 's@\/*$$@@'`; \
197 if [ "$$__PREFIX" = "/opt/libjpeg-turbo" ]; then \
198 cd $(DESTDIR)/${prefix}; \
199 if [ -d lib -a ! -d lib32 -a ! -h lib32 ]; then \
200 $(LN_S) lib lib32; \
201 fi \
202 fi
203
204endif
205
DRC079b4342010-02-15 11:32:23 +0000206rpm: all
DRC1f80a102010-10-18 00:15:31 +0000207 TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
208 mkdir -p $$TMPDIR/RPMS; \
209 ln -fs `pwd` $$TMPDIR/BUILD; \
210 rm -f ${PACKAGE_NAME}.${RPMARCH}.rpm; \
211 rpmbuild -bb --define "_blddir $$TMPDIR/buildroot" \
212 --define "_topdir $$TMPDIR" --define "_srcdir ${srcdir}" \
213 --target ${RPMARCH} libjpeg-turbo.spec; \
214 cp $$TMPDIR/RPMS/${RPMARCH}/${PACKAGE_NAME}-${VERSION}-${BUILD}.${RPMARCH}.rpm ${PACKAGE_NAME}.${RPMARCH}.rpm; \
215 rm -rf $$TMPDIR
DRC079b4342010-02-15 11:32:23 +0000216
DRCf26914b2010-02-15 11:36:46 +0000217srpm: dist-gzip
DRC1f80a102010-10-18 00:15:31 +0000218 TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
219 mkdir -p $$TMPDIR/RPMS; \
220 mkdir -p $$TMPDIR/SRPMS; \
221 mkdir -p $$TMPDIR/BUILD; \
222 mkdir -p $$TMPDIR/SOURCES; \
223 mkdir -p $$TMPDIR/SPECS; \
224 rm -f ${PACKAGE_NAME}.src.rpm; \
225 cp ${PACKAGE_NAME}-${VERSION}.tar.gz $$TMPDIR/SOURCES; \
226 cat libjpeg-turbo.spec | sed s/%{_blddir}/%{_tmppath}/g \
227 | sed s@%{_srcdir}/@@g | sed s/#--\>//g \
228 >$$TMPDIR/SPECS/libjpeg-turbo.spec; \
229 rpmbuild -bs --define "_topdir $$TMPDIR" $$TMPDIR/SPECS/libjpeg-turbo.spec; \
230 cp $$TMPDIR/SRPMS/${PACKAGE_NAME}-${VERSION}-${BUILD}.src.rpm ${PACKAGE_NAME}.src.rpm; \
231 rm -rf $$TMPDIR
DRC52a19f22010-02-15 12:06:27 +0000232
233deb: all
234 sh $(srcdir)/release/makedpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} \
235 ${DEBARCH} ${srcdir}
DRC6533b6e2010-02-15 14:57:18 +0000236
DRC315123f2010-02-15 16:14:26 +0000237if X86_64
238
239udmg: all
DRC0f53df82010-10-21 19:47:06 +0000240 sh makemacpkg universal ${BUILDDIR32}
DRC315123f2010-02-15 16:14:26 +0000241
242endif
243
DRC6533b6e2010-02-15 14:57:18 +0000244dmg: all
DRC0f53df82010-10-21 19:47:06 +0000245 sh makemacpkg
DRCb9b1ca32010-02-17 02:24:02 +0000246
247if X86_64
248
DRC0f53df82010-10-21 19:47:06 +0000249csunpkg: all
250 sh makesunpkg combined ${BUILDDIR32}
DRCb9b1ca32010-02-17 02:24:02 +0000251
DRC3dc1bc22010-05-10 22:18:10 +0000252endif
DRCae79fdb2010-06-09 20:16:04 +0000253
DRC0f53df82010-10-21 19:47:06 +0000254sunpkg: all
255 sh makesunpkg
256
DRCae79fdb2010-06-09 20:16:04 +0000257cygwinpkg: all
258 sh $(srcdir)/release/makecygwinpkg ${PACKAGE_NAME} ${VERSION} ${srcdir}