blob: 791fdd2e4de9b6f9029925924a0535601522358f [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
DRC418dbdf2011-05-26 10:45:06 +000037libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpeg.c turbojpeg.h \
DRC9b28def2011-05-21 14:37:15 +000038 transupp.c transupp.h jdatadst-tj.c jdatasrc-tj.c
DRCf8e00552011-02-04 11:06:36 +000039
DRCdffd53d2011-04-01 00:37:20 +000040SUBDIRS = java
41
DRCf2602ce2011-04-01 00:20:33 +000042if WITH_JAVA
DRCf8e00552011-02-04 11:06:36 +000043
44libturbojpeg_la_SOURCES += turbojpeg-jni.c
DRCe08c05f2011-03-31 08:03:26 +000045libturbojpeg_la_CFLAGS = ${JNI_CFLAGS}
DRCf8e00552011-02-04 11:06:36 +000046TJMAPFILE = turbojpeg-mapfile.jni
47
48else
49
50TJMAPFILE = turbojpeg-mapfile
51
52endif
53
54libturbojpeg_la_SOURCES += $(TJMAPFILE)
DRC6f8c6682010-02-16 05:03:51 +000055
56if VERSION_SCRIPT
57
DRC9fa95592011-02-25 00:23:44 +000058libturbojpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)$(srcdir)/$(TJMAPFILE)
DRC8515d3d2010-10-19 06:38:57 +000059libjpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)libjpeg.map
DRC6f8c6682010-02-16 05:03:51 +000060
61endif
DRC1bf1a142010-02-11 06:39:32 +000062
DRC60cddeb2010-02-12 05:37:07 +000063if WITH_SIMD
64
DRCf2602ce2011-04-01 00:20:33 +000065SUBDIRS += simd
Pierre Ossman3a65ef42009-03-16 13:34:18 +000066libjpeg_la_LIBADD = simd/libsimd.la
DRC1bf1a142010-02-11 06:39:32 +000067libturbojpeg_la_LIBADD = simd/libsimd.la
Pierre Ossman2ae181c2009-03-09 13:21:27 +000068
DRC60cddeb2010-02-12 05:37:07 +000069else
70
71libjpeg_la_SOURCES += jsimd_none.c
72
73endif
74
DRC3185cb92011-05-25 03:52:22 +000075bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom tjbench
DRCb76c8402011-12-19 15:01:55 +000076noinst_PROGRAMS = tjunittest jcstest
DRC2e7b76b2009-04-03 12:04:24 +000077
DRC3185cb92011-05-25 03:52:22 +000078tjbench_SOURCES = tjbench.c bmp.h bmp.c tjutil.h tjutil.c rdbmp.c rdppm.c \
DRC18821f82011-05-24 17:07:51 +000079 wrbmp.c wrppm.c
DRC2e7b76b2009-04-03 12:04:24 +000080
DRC3185cb92011-05-25 03:52:22 +000081tjbench_LDADD = libturbojpeg.la libjpeg.la -lm
DRC2e7b76b2009-04-03 12:04:24 +000082
DRC3185cb92011-05-25 03:52:22 +000083tjbench_CFLAGS = -DBMP_SUPPORTED -DPPM_SUPPORTED
DRCbe49b8c2011-05-24 13:41:27 +000084
DRC3185cb92011-05-25 03:52:22 +000085tjunittest_SOURCES = tjunittest.c tjutil.h tjutil.c
DRC2e7b76b2009-04-03 12:04:24 +000086
DRC3185cb92011-05-25 03:52:22 +000087tjunittest_LDADD = libturbojpeg.la
DRC73de9822009-06-25 20:41:17 +000088
89cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdbmp.c rdgif.c \
90 rdppm.c rdswitch.c rdtarga.c
91
DRC971d8512010-02-13 22:55:05 +000092cjpeg_LDADD = libjpeg.la
DRC73de9822009-06-25 20:41:17 +000093
94cjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
95 -DTARGA_SUPPORTED
96
97djpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \
98 wrbmp.c wrgif.c wrppm.c wrtarga.c
99
DRC971d8512010-02-13 22:55:05 +0000100djpeg_LDADD = libjpeg.la
DRC73de9822009-06-25 20:41:17 +0000101
102djpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
103 -DTARGA_SUPPORTED
DRC60fa0602010-02-12 06:01:49 +0000104
DRC0a945a12010-02-15 11:04:51 +0000105jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h
DRC60fa0602010-02-12 06:01:49 +0000106
DRC971d8512010-02-13 22:55:05 +0000107jpegtran_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +0000108
DRC0a945a12010-02-15 11:04:51 +0000109rdjpgcom_SOURCES = rdjpgcom.c
DRC60fa0602010-02-12 06:01:49 +0000110
DRC971d8512010-02-13 22:55:05 +0000111rdjpgcom_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +0000112
113wrjpgcom_SOURCES = wrjpgcom.c
114
DRC971d8512010-02-13 22:55:05 +0000115wrjpgcom_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +0000116
DRCb76c8402011-12-19 15:01:55 +0000117jcstest_SOURCES = jcstest.c
118
119jcstest_LDADD = libjpeg.la
DRC0a945a12010-02-15 11:04:51 +0000120
DRCcbda81a2010-06-05 01:12:35 +0000121dist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
DRC0a945a12010-02-15 11:04:51 +0000122
DRCa1647c82012-02-10 00:39:05 +0000123DOCS= install.txt coderules.txt filelist.txt jconfig.txt change.log \
124 rdrle.c wrrle.c BUILDING.txt ChangeLog.txt
125
126docdir = $(datadir)/doc
127doc_DATA = README README-turbo.txt libjpeg.txt structure.txt usage.txt \
128 wizard.txt
129
130exampledir = $(datadir)/doc
131example_DATA = example.c
DRC0a945a12010-02-15 11:04:51 +0000132
DRC750e0782011-05-10 21:05:49 +0000133
DRC866e6ff2012-01-31 08:00:50 +0000134EXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \
DRCa006fba2011-10-27 23:25:28 +0000135 sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \
136 jccolext.c jdcolext.c jdmrgext.c
DRC0a945a12010-02-15 11:04:51 +0000137
138dist-hook:
139 rm -rf `find $(distdir) -name .svn`
140
141
DRC66f97e62010-11-23 05:49:54 +0000142test: testclean all
DRCf2602ce2011-04-01 00:20:33 +0000143if WITH_JAVA
144 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest
145 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -bi
146 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv
147 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -bi
148endif
DRC3185cb92011-05-25 03:52:22 +0000149 ./tjunittest
150 ./tjunittest -alloc
151 ./tjunittest -yuv
DRC6ebf1102012-01-31 04:58:26 +0000152 ./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testimages/testorig.ppm
153 cmp $(srcdir)/testimages/testimgint.jpg testoutint.jpg
154 ./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testimages/testorig.ppm
155 cmp $(srcdir)/testimages/testimgfst.jpg testoutfst.jpg
156 ./cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg $(srcdir)/testimages/testorig.ppm
157 cmp $(srcdir)/testimages/testimgfst100.jpg testoutfst100.jpg
158 ./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testimages/testorig.ppm
DRC321e0682011-05-03 08:47:43 +0000159if WITH_SSE_FLOAT_DCT
DRC6ebf1102012-01-31 04:58:26 +0000160 cmp $(srcdir)/testimages/testimgflt.jpg testoutflt.jpg
DRC83f21442010-06-10 18:52:41 +0000161else
DRC6ebf1102012-01-31 04:58:26 +0000162 cmp $(srcdir)/testimages/testimgflt-nosimd.jpg testoutflt.jpg
DRC66f97e62010-11-23 05:49:54 +0000163endif
DRC6ebf1102012-01-31 04:58:26 +0000164 ./cjpeg -dct int -grayscale -outfile testoutgray.jpg $(srcdir)/testimages/testorig.ppm
165 cmp $(srcdir)/testimages/testimggray.jpg testoutgray.jpg
166 ./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testimages/testorig.jpg
167 cmp $(srcdir)/testimages/testimgint.ppm testoutint.ppm
168 ./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testimages/testorig.jpg
169 cmp $(srcdir)/testimages/testimgfst.ppm testoutfst.ppm
170 ./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testimages/testorig.jpg
DRC321e0682011-05-03 08:47:43 +0000171if WITH_SSE_FLOAT_DCT
DRC6ebf1102012-01-31 04:58:26 +0000172 cmp $(srcdir)/testimages/testimgflt.ppm testoutflt.ppm
DRC66f97e62010-11-23 05:49:54 +0000173else
DRC6ebf1102012-01-31 04:58:26 +0000174 cmp $(srcdir)/testimages/testorig.ppm testoutflt.ppm
DRC66f97e62010-11-23 05:49:54 +0000175endif
DRC6ebf1102012-01-31 04:58:26 +0000176 ./djpeg -dct int -scale 1/2 -ppm -outfile testoutint1_2.ppm $(srcdir)/testimages/testorig.jpg
177 cmp $(srcdir)/testimages/testimgint1_2.ppm testoutint1_2.ppm
178 ./djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm $(srcdir)/testimages/testorig.jpg
179 cmp $(srcdir)/testimages/testimgfst1_2.ppm testoutfst1_2.ppm
180 ./djpeg -dct int -scale 1/4 -ppm -outfile testoutint1_4.ppm $(srcdir)/testimages/testorig.jpg
181 cmp $(srcdir)/testimages/testimgint1_4.ppm testoutint1_4.ppm
182 ./djpeg -dct fast -scale 1/4 -ppm -outfile testoutfst1_4.ppm $(srcdir)/testimages/testorig.jpg
183 cmp $(srcdir)/testimages/testimgfst1_4.ppm testoutfst1_4.ppm
184 ./djpeg -dct int -scale 1/8 -ppm -outfile testoutint1_8.ppm $(srcdir)/testimages/testorig.jpg
185 cmp $(srcdir)/testimages/testimgint1_8.ppm testoutint1_8.ppm
186 ./djpeg -dct fast -scale 1/8 -ppm -outfile testoutfst1_8.ppm $(srcdir)/testimages/testorig.jpg
187 cmp $(srcdir)/testimages/testimgfst1_8.ppm testoutfst1_8.ppm
188 ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testimages/testorig.jpg
189 cmp $(srcdir)/testimages/testimg.bmp testout.bmp
DRCe3720042010-11-23 06:50:14 +0000190if WITH_ARITH_ENC
DRC6ebf1102012-01-31 04:58:26 +0000191 ./cjpeg -dct int -arithmetic -outfile testoutari.jpg $(srcdir)/testimages/testorig.ppm
192 cmp $(srcdir)/testimages/testimgari.jpg testoutari.jpg
193 ./jpegtran -arithmetic -outfile testouta.jpg $(srcdir)/testimages/testimgint.jpg
194 cmp $(srcdir)/testimages/testimgari.jpg testouta.jpg
DRCe3720042010-11-23 06:50:14 +0000195endif
196if WITH_ARITH_DEC
DRC6ebf1102012-01-31 04:58:26 +0000197 ./djpeg -dct int -fast -ppm -outfile testoutari.ppm $(srcdir)/testimages/testimgari.jpg
198 cmp $(srcdir)/testimages/testimgari.ppm testoutari.ppm
199 ./jpegtran -outfile testouta.jpg $(srcdir)/testimages/testimgari.jpg
200 cmp $(srcdir)/testimages/testimgint.jpg testouta.jpg
DRCe3720042010-11-23 06:50:14 +0000201endif
DRC6ebf1102012-01-31 04:58:26 +0000202 ./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testimages/testorig.ppm
203 cmp $(srcdir)/testimages/testimgp.jpg testoutp.jpg
DRC83f21442010-06-10 18:52:41 +0000204 ./jpegtran -outfile testoutt.jpg testoutp.jpg
DRC6ebf1102012-01-31 04:58:26 +0000205 cmp $(srcdir)/testimages/testimgint.jpg testoutt.jpg
206 ./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg $(srcdir)/testimages/testorig.jpg
207 cmp $(srcdir)/testimages/testimgcrop.jpg testoutcrop.jpg
DRC83f21442010-06-10 18:52:41 +0000208
DRC83f21442010-06-10 18:52:41 +0000209
DRC34d59e72010-02-12 06:27:34 +0000210testclean:
DRC7b991722010-06-10 19:44:56 +0000211 rm -f testout*
DRCf2602ce2011-04-01 00:20:33 +0000212 rm -f *_GRAY_*.bmp
213 rm -f *_GRAY_*.png
214 rm -f *_GRAY_*.ppm
215 rm -f *_GRAY_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000216 rm -f *_GRAY.yuv
DRCf2602ce2011-04-01 00:20:33 +0000217 rm -f *_420_*.bmp
218 rm -f *_420_*.png
219 rm -f *_420_*.ppm
220 rm -f *_420_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000221 rm -f *_420.yuv
DRCf2602ce2011-04-01 00:20:33 +0000222 rm -f *_422_*.bmp
223 rm -f *_422_*.png
224 rm -f *_422_*.ppm
225 rm -f *_422_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000226 rm -f *_422.yuv
DRCf2602ce2011-04-01 00:20:33 +0000227 rm -f *_444_*.bmp
228 rm -f *_444_*.png
229 rm -f *_444_*.ppm
230 rm -f *_444_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000231 rm -f *_444.yuv
DRCf2602ce2011-04-01 00:20:33 +0000232 rm -f *_440_*.bmp
233 rm -f *_440_*.png
234 rm -f *_440_*.ppm
235 rm -f *_440_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000236 rm -f *_440.yuv
DRC079b4342010-02-15 11:32:23 +0000237
DRC9cd4e4b2012-01-31 07:56:44 +0000238
239tjtest:
240 sh ./tjbenchtest
241if WITH_JAVA
242 sh ./tjexampletest
243endif
244
245
DRCd1c281a2010-11-17 22:44:40 +0000246if X86_64
247
248install-exec-hook:
249 __PREFIX=`echo ${prefix} | sed -e 's@\/*$$@@'`; \
250 if [ "$$__PREFIX" = "/opt/libjpeg-turbo" ]; then \
251 cd $(DESTDIR)/${prefix}; \
252 if [ -d lib -a ! -d lib64 -a ! -h lib64 ]; then \
253 $(LN_S) lib lib64; \
254 fi \
255 fi
256
257else
258
259install-exec-hook:
260 __PREFIX=`echo ${prefix} | sed -e 's@\/*$$@@'`; \
261 if [ "$$__PREFIX" = "/opt/libjpeg-turbo" ]; then \
262 cd $(DESTDIR)/${prefix}; \
263 if [ -d lib -a ! -d lib32 -a ! -h lib32 ]; then \
264 $(LN_S) lib lib32; \
265 fi \
266 fi
267
268endif
269
DRC079b4342010-02-15 11:32:23 +0000270rpm: all
DRC1f80a102010-10-18 00:15:31 +0000271 TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
272 mkdir -p $$TMPDIR/RPMS; \
273 ln -fs `pwd` $$TMPDIR/BUILD; \
DRCb94f2de2011-03-22 09:31:25 +0000274 rm -f ${PACKAGE_NAME}-${VERSION}.${RPMARCH}.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000275 rpmbuild -bb --define "_blddir $$TMPDIR/buildroot" \
276 --define "_topdir $$TMPDIR" --define "_srcdir ${srcdir}" \
DRCb94f2de2011-03-22 09:31:25 +0000277 --target ${RPMARCH} pkgscripts/libjpeg-turbo.spec; \
278 cp $$TMPDIR/RPMS/${RPMARCH}/${PACKAGE_NAME}-${VERSION}-${BUILD}.${RPMARCH}.rpm \
279 ${PACKAGE_NAME}-${VERSION}.${RPMARCH}.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000280 rm -rf $$TMPDIR
DRC079b4342010-02-15 11:32:23 +0000281
DRCf26914b2010-02-15 11:36:46 +0000282srpm: dist-gzip
DRC1f80a102010-10-18 00:15:31 +0000283 TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
284 mkdir -p $$TMPDIR/RPMS; \
285 mkdir -p $$TMPDIR/SRPMS; \
286 mkdir -p $$TMPDIR/BUILD; \
287 mkdir -p $$TMPDIR/SOURCES; \
288 mkdir -p $$TMPDIR/SPECS; \
DRCb94f2de2011-03-22 09:31:25 +0000289 rm -f ${PACKAGE_NAME}-${VERSION}.src.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000290 cp ${PACKAGE_NAME}-${VERSION}.tar.gz $$TMPDIR/SOURCES; \
DRCb94f2de2011-03-22 09:31:25 +0000291 cat pkgscripts/libjpeg-turbo.spec | sed s/%{_blddir}/%{_tmppath}/g \
DRC1f80a102010-10-18 00:15:31 +0000292 | sed s@%{_srcdir}/@@g | sed s/#--\>//g \
DRCb94f2de2011-03-22 09:31:25 +0000293 > $$TMPDIR/SPECS/libjpeg-turbo.spec; \
DRC1f80a102010-10-18 00:15:31 +0000294 rpmbuild -bs --define "_topdir $$TMPDIR" $$TMPDIR/SPECS/libjpeg-turbo.spec; \
DRCb94f2de2011-03-22 09:31:25 +0000295 cp $$TMPDIR/SRPMS/${PACKAGE_NAME}-${VERSION}-${BUILD}.src.rpm \
296 ${PACKAGE_NAME}-${VERSION}.src.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000297 rm -rf $$TMPDIR
DRC52a19f22010-02-15 12:06:27 +0000298
299deb: all
DRCb94f2de2011-03-22 09:31:25 +0000300 sh pkgscripts/makedpkg
DRC6533b6e2010-02-15 14:57:18 +0000301
DRC315123f2010-02-15 16:14:26 +0000302if X86_64
303
304udmg: all
DRCb94f2de2011-03-22 09:31:25 +0000305 sh pkgscripts/makemacpkg universal ${BUILDDIR32}
DRC315123f2010-02-15 16:14:26 +0000306
307endif
308
DRC6533b6e2010-02-15 14:57:18 +0000309dmg: all
DRCb94f2de2011-03-22 09:31:25 +0000310 sh pkgscripts/makemacpkg
DRCb9b1ca32010-02-17 02:24:02 +0000311
312if X86_64
313
DRC0f53df82010-10-21 19:47:06 +0000314csunpkg: all
DRCb94f2de2011-03-22 09:31:25 +0000315 sh pkgscripts/makesunpkg combined ${BUILDDIR32}
DRCb9b1ca32010-02-17 02:24:02 +0000316
DRC3dc1bc22010-05-10 22:18:10 +0000317endif
DRCae79fdb2010-06-09 20:16:04 +0000318
DRC0f53df82010-10-21 19:47:06 +0000319sunpkg: all
DRCb94f2de2011-03-22 09:31:25 +0000320 sh pkgscripts/makesunpkg
DRC0f53df82010-10-21 19:47:06 +0000321
DRCae79fdb2010-06-09 20:16:04 +0000322cygwinpkg: all
DRCb94f2de2011-03-22 09:31:25 +0000323 sh pkgscripts/makecygwinpkg