blob: 281159e97d2e2508a1e55185a500cf707b9a85ce [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
DRC890f1e02011-02-26 22:02:37 +000037libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpegl.c turbojpeg.h \
38 transupp.c transupp.h
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
DRC1bf1a142010-02-11 06:39:32 +000075TSTHDRS = rrutil.h rrtimer.h
DRC2e7b76b2009-04-03 12:04:24 +000076
DRC240d82f2011-02-19 00:00:34 +000077bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom jpgtest
78noinst_PROGRAMS = jpegut
DRC2e7b76b2009-04-03 12:04:24 +000079
DRC2e4d0442011-02-08 01:18:37 +000080jpgtest_SOURCES = $(TSTHDRS) jpgtest.c bmp.h bmp.c
DRC2e7b76b2009-04-03 12:04:24 +000081
DRCda509e32011-02-18 21:16:04 +000082jpgtest_LDADD = libturbojpeg.la -lm
DRC2e7b76b2009-04-03 12:04:24 +000083
DRC1bf1a142010-02-11 06:39:32 +000084jpegut_SOURCES = $(TSTHDRS) jpegut.c bmp.h bmp.c
DRC2e7b76b2009-04-03 12:04:24 +000085
DRC971d8512010-02-13 22:55:05 +000086jpegut_LDADD = libturbojpeg.la
DRC73de9822009-06-25 20:41:17 +000087
88cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdbmp.c rdgif.c \
89 rdppm.c rdswitch.c rdtarga.c
90
DRC971d8512010-02-13 22:55:05 +000091cjpeg_LDADD = libjpeg.la
DRC73de9822009-06-25 20:41:17 +000092
93cjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
94 -DTARGA_SUPPORTED
95
96djpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \
97 wrbmp.c wrgif.c wrppm.c wrtarga.c
98
DRC971d8512010-02-13 22:55:05 +000099djpeg_LDADD = libjpeg.la
DRC73de9822009-06-25 20:41:17 +0000100
101djpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
102 -DTARGA_SUPPORTED
DRC60fa0602010-02-12 06:01:49 +0000103
DRC0a945a12010-02-15 11:04:51 +0000104jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h
DRC60fa0602010-02-12 06:01:49 +0000105
DRC971d8512010-02-13 22:55:05 +0000106jpegtran_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +0000107
DRC0a945a12010-02-15 11:04:51 +0000108rdjpgcom_SOURCES = rdjpgcom.c
DRC60fa0602010-02-12 06:01:49 +0000109
DRC971d8512010-02-13 22:55:05 +0000110rdjpgcom_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +0000111
112wrjpgcom_SOURCES = wrjpgcom.c
113
DRC971d8512010-02-13 22:55:05 +0000114wrjpgcom_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +0000115
DRC0a945a12010-02-15 11:04:51 +0000116
DRCcbda81a2010-06-05 01:12:35 +0000117dist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
DRC0a945a12010-02-15 11:04:51 +0000118
DRC39ea5622010-10-12 01:55:31 +0000119DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \
120 structure.txt coderules.txt filelist.txt jconfig.txt change.log \
DRC0b7d4ed2010-03-03 09:37:58 +0000121 README-turbo.txt rdrle.c wrrle.c LICENSE.txt LGPL.txt BUILDING.txt \
122 ChangeLog.txt
DRC0a945a12010-02-15 11:04:51 +0000123
DRC968c8bb2010-02-22 22:50:13 +0000124TESTFILES= testorig.jpg testorig.ppm testimg.bmp testimgflt.jpg \
DRC50503c72010-09-09 21:00:31 +0000125 testimgfst.jpg testimgint.jpg testimgp.jpg testimgflt.ppm testimgfst.ppm \
DRCf0b7fef2010-11-23 17:13:02 +0000126 testimgint.ppm testimgflt-nosimd.jpg testimgcrop.jpg testimgari.jpg \
DRC2ddcc632011-02-18 22:46:05 +0000127 testimgari.ppm testimgfst100.jpg testimggray.jpg
DRC0a945a12010-02-15 11:04:51 +0000128
DRCdffd53d2011-04-01 00:37:20 +0000129EXTRA_DIST = win release $(DOCS) $(TESTFILES) CMakeLists.txt \
DRC8515d3d2010-10-19 06:38:57 +0000130 sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in
DRC0a945a12010-02-15 11:04:51 +0000131
132dist-hook:
133 rm -rf `find $(distdir) -name .svn`
134
135
DRC66f97e62010-11-23 05:49:54 +0000136test: testclean all
DRCf2602ce2011-04-01 00:20:33 +0000137if WITH_JAVA
138 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest
139 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -bi
140 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv
141 $(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -bi
142endif
DRC66f97e62010-11-23 05:49:54 +0000143 ./jpegut
DRCfbb67472010-11-24 04:02:37 +0000144 ./jpegut -yuv
DRC66f97e62010-11-23 05:49:54 +0000145 ./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testorig.ppm
146 cmp $(srcdir)/testimgint.jpg testoutint.jpg
147 ./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testorig.ppm
148 cmp $(srcdir)/testimgfst.jpg testoutfst.jpg
DRCa49c4e52011-02-18 20:50:08 +0000149 ./cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg $(srcdir)/testorig.ppm
150 cmp $(srcdir)/testimgfst100.jpg testoutfst100.jpg
DRC66f97e62010-11-23 05:49:54 +0000151 ./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testorig.ppm
DRC83f21442010-06-10 18:52:41 +0000152if WITH_SIMD
DRC0fd8be52010-02-19 05:12:39 +0000153 cmp $(srcdir)/testimgflt.jpg testoutflt.jpg
DRC83f21442010-06-10 18:52:41 +0000154else
DRC83f21442010-06-10 18:52:41 +0000155 cmp $(srcdir)/testimgflt-nosimd.jpg testoutflt.jpg
DRC66f97e62010-11-23 05:49:54 +0000156endif
DRCc8666332011-02-18 11:23:45 +0000157 ./cjpeg -dct int -grayscale -outfile testoutgray.jpg $(srcdir)/testorig.ppm
158 cmp $(srcdir)/testimggray.jpg testoutgray.jpg
DRC83f21442010-06-10 18:52:41 +0000159 ./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testorig.jpg
DRC83f21442010-06-10 18:52:41 +0000160 cmp $(srcdir)/testimgint.ppm testoutint.ppm
DRC66f97e62010-11-23 05:49:54 +0000161 ./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testorig.jpg
DRC30959712010-08-07 16:06:56 +0000162 cmp $(srcdir)/testimgfst.ppm testoutfst.ppm
DRC66f97e62010-11-23 05:49:54 +0000163 ./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testorig.jpg
164if WITH_SIMD
165 cmp $(srcdir)/testimgflt.ppm testoutflt.ppm
166else
DRC30959712010-08-07 16:06:56 +0000167 cmp $(srcdir)/testorig.ppm testoutflt.ppm
DRC66f97e62010-11-23 05:49:54 +0000168endif
DRC83f21442010-06-10 18:52:41 +0000169 ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg
DRC30959712010-08-07 16:06:56 +0000170 cmp $(srcdir)/testimg.bmp testout.bmp
DRCe3720042010-11-23 06:50:14 +0000171if WITH_ARITH_ENC
DRC66f97e62010-11-23 05:49:54 +0000172 ./cjpeg -dct int -arithmetic -outfile testoutari.jpg $(srcdir)/testorig.ppm
173 cmp $(srcdir)/testimgari.jpg testoutari.jpg
DRCe3720042010-11-23 06:50:14 +0000174 ./jpegtran -arithmetic -outfile testouta.jpg $(srcdir)/testimgint.jpg
175 cmp $(srcdir)/testimgari.jpg testouta.jpg
176endif
177if WITH_ARITH_DEC
DRC66f97e62010-11-23 05:49:54 +0000178 ./djpeg -dct int -fast -ppm -outfile testoutari.ppm $(srcdir)/testimgari.jpg
179 cmp $(srcdir)/testimgari.ppm testoutari.ppm
DRCe3720042010-11-23 06:50:14 +0000180 ./jpegtran -outfile testouta.jpg $(srcdir)/testimgari.jpg
DRC66f97e62010-11-23 05:49:54 +0000181 cmp $(srcdir)/testimgint.jpg testouta.jpg
DRCe3720042010-11-23 06:50:14 +0000182endif
DRC30959712010-08-07 16:06:56 +0000183 ./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testorig.ppm
184 cmp $(srcdir)/testimgp.jpg testoutp.jpg
DRC83f21442010-06-10 18:52:41 +0000185 ./jpegtran -outfile testoutt.jpg testoutp.jpg
DRC30959712010-08-07 16:06:56 +0000186 cmp $(srcdir)/testimgint.jpg testoutt.jpg
DRC9a648cc2010-10-10 02:48:21 +0000187 ./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg $(srcdir)/testorig.jpg
DRCc04bd3c2010-10-10 02:15:56 +0000188 cmp $(srcdir)/testimgcrop.jpg testoutcrop.jpg
DRC83f21442010-06-10 18:52:41 +0000189
DRC83f21442010-06-10 18:52:41 +0000190
DRC34d59e72010-02-12 06:27:34 +0000191testclean:
DRC7b991722010-06-10 19:44:56 +0000192 rm -f testout*
DRCf2602ce2011-04-01 00:20:33 +0000193 rm -f *_GRAY_*.bmp
194 rm -f *_GRAY_*.png
195 rm -f *_GRAY_*.ppm
196 rm -f *_GRAY_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000197 rm -f *_GRAY.yuv
DRCf2602ce2011-04-01 00:20:33 +0000198 rm -f *_420_*.bmp
199 rm -f *_420_*.png
200 rm -f *_420_*.ppm
201 rm -f *_420_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000202 rm -f *_420.yuv
DRCf2602ce2011-04-01 00:20:33 +0000203 rm -f *_422_*.bmp
204 rm -f *_422_*.png
205 rm -f *_422_*.ppm
206 rm -f *_422_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000207 rm -f *_422.yuv
DRCf2602ce2011-04-01 00:20:33 +0000208 rm -f *_444_*.bmp
209 rm -f *_444_*.png
210 rm -f *_444_*.ppm
211 rm -f *_444_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000212 rm -f *_444.yuv
DRCf2602ce2011-04-01 00:20:33 +0000213 rm -f *_440_*.bmp
214 rm -f *_440_*.png
215 rm -f *_440_*.ppm
216 rm -f *_440_*.jpg
DRCba6f4572011-03-31 09:41:53 +0000217 rm -f *_440.yuv
DRC079b4342010-02-15 11:32:23 +0000218
DRCd1c281a2010-11-17 22:44:40 +0000219if X86_64
220
221install-exec-hook:
222 __PREFIX=`echo ${prefix} | sed -e 's@\/*$$@@'`; \
223 if [ "$$__PREFIX" = "/opt/libjpeg-turbo" ]; then \
224 cd $(DESTDIR)/${prefix}; \
225 if [ -d lib -a ! -d lib64 -a ! -h lib64 ]; then \
226 $(LN_S) lib lib64; \
227 fi \
228 fi
229
230else
231
232install-exec-hook:
233 __PREFIX=`echo ${prefix} | sed -e 's@\/*$$@@'`; \
234 if [ "$$__PREFIX" = "/opt/libjpeg-turbo" ]; then \
235 cd $(DESTDIR)/${prefix}; \
236 if [ -d lib -a ! -d lib32 -a ! -h lib32 ]; then \
237 $(LN_S) lib lib32; \
238 fi \
239 fi
240
241endif
242
DRC079b4342010-02-15 11:32:23 +0000243rpm: all
DRC1f80a102010-10-18 00:15:31 +0000244 TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
245 mkdir -p $$TMPDIR/RPMS; \
246 ln -fs `pwd` $$TMPDIR/BUILD; \
DRCb94f2de2011-03-22 09:31:25 +0000247 rm -f ${PACKAGE_NAME}-${VERSION}.${RPMARCH}.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000248 rpmbuild -bb --define "_blddir $$TMPDIR/buildroot" \
249 --define "_topdir $$TMPDIR" --define "_srcdir ${srcdir}" \
DRCb94f2de2011-03-22 09:31:25 +0000250 --target ${RPMARCH} pkgscripts/libjpeg-turbo.spec; \
251 cp $$TMPDIR/RPMS/${RPMARCH}/${PACKAGE_NAME}-${VERSION}-${BUILD}.${RPMARCH}.rpm \
252 ${PACKAGE_NAME}-${VERSION}.${RPMARCH}.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000253 rm -rf $$TMPDIR
DRC079b4342010-02-15 11:32:23 +0000254
DRCf26914b2010-02-15 11:36:46 +0000255srpm: dist-gzip
DRC1f80a102010-10-18 00:15:31 +0000256 TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
257 mkdir -p $$TMPDIR/RPMS; \
258 mkdir -p $$TMPDIR/SRPMS; \
259 mkdir -p $$TMPDIR/BUILD; \
260 mkdir -p $$TMPDIR/SOURCES; \
261 mkdir -p $$TMPDIR/SPECS; \
DRCb94f2de2011-03-22 09:31:25 +0000262 rm -f ${PACKAGE_NAME}-${VERSION}.src.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000263 cp ${PACKAGE_NAME}-${VERSION}.tar.gz $$TMPDIR/SOURCES; \
DRCb94f2de2011-03-22 09:31:25 +0000264 cat pkgscripts/libjpeg-turbo.spec | sed s/%{_blddir}/%{_tmppath}/g \
DRC1f80a102010-10-18 00:15:31 +0000265 | sed s@%{_srcdir}/@@g | sed s/#--\>//g \
DRCb94f2de2011-03-22 09:31:25 +0000266 > $$TMPDIR/SPECS/libjpeg-turbo.spec; \
DRC1f80a102010-10-18 00:15:31 +0000267 rpmbuild -bs --define "_topdir $$TMPDIR" $$TMPDIR/SPECS/libjpeg-turbo.spec; \
DRCb94f2de2011-03-22 09:31:25 +0000268 cp $$TMPDIR/SRPMS/${PACKAGE_NAME}-${VERSION}-${BUILD}.src.rpm \
269 ${PACKAGE_NAME}-${VERSION}.src.rpm; \
DRC1f80a102010-10-18 00:15:31 +0000270 rm -rf $$TMPDIR
DRC52a19f22010-02-15 12:06:27 +0000271
272deb: all
DRCb94f2de2011-03-22 09:31:25 +0000273 sh pkgscripts/makedpkg
DRC6533b6e2010-02-15 14:57:18 +0000274
DRC315123f2010-02-15 16:14:26 +0000275if X86_64
276
277udmg: all
DRCb94f2de2011-03-22 09:31:25 +0000278 sh pkgscripts/makemacpkg universal ${BUILDDIR32}
DRC315123f2010-02-15 16:14:26 +0000279
280endif
281
DRC6533b6e2010-02-15 14:57:18 +0000282dmg: all
DRCb94f2de2011-03-22 09:31:25 +0000283 sh pkgscripts/makemacpkg
DRCb9b1ca32010-02-17 02:24:02 +0000284
285if X86_64
286
DRC0f53df82010-10-21 19:47:06 +0000287csunpkg: all
DRCb94f2de2011-03-22 09:31:25 +0000288 sh pkgscripts/makesunpkg combined ${BUILDDIR32}
DRCb9b1ca32010-02-17 02:24:02 +0000289
DRC3dc1bc22010-05-10 22:18:10 +0000290endif
DRCae79fdb2010-06-09 20:16:04 +0000291
DRC0f53df82010-10-21 19:47:06 +0000292sunpkg: all
DRCb94f2de2011-03-22 09:31:25 +0000293 sh pkgscripts/makesunpkg
DRC0f53df82010-10-21 19:47:06 +0000294
DRCae79fdb2010-06-09 20:16:04 +0000295cygwinpkg: all
DRCb94f2de2011-03-22 09:31:25 +0000296 sh pkgscripts/makecygwinpkg