blob: 245093041bdbb3032609bcc934bb0134eef1ca05 [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
DRC66f97e62010-11-23 05:49:54 +000010libjpeg_la_SOURCES = $(HDRS) jaricom.c jcapimin.c jcapistd.c jcarith.c \
11 jccoefct.c jccolor.c jcdctmgr.c jchuff.c jcinit.c jcmainct.c \
12 jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c jcprepct.c \
13 jcsample.c jctrans.c jdapimin.c jdapistd.c jdarith.c \
14 jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
15 jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
16 jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
17 jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c \
18 jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c
Constantin Kaplinsky0ca44252008-09-28 05:08:48 +000019
DRC6f8c6682010-02-16 05:03:51 +000020libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpegl.c turbojpeg.h \
21 turbojpeg-mapfile
22
DRC8515d3d2010-10-19 06:38:57 +000023if ANON_VERSION_SCRIPT
24
25libturbojpeg_la_LDFLAGS += $(ANON_VERSION_SCRIPT_FLAG)$(srcdir)/turbojpeg-mapfile
26
27endif
28
DRC6f8c6682010-02-16 05:03:51 +000029if VERSION_SCRIPT
30
DRC8515d3d2010-10-19 06:38:57 +000031libjpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)libjpeg.map
DRC6f8c6682010-02-16 05:03:51 +000032
33endif
DRC1bf1a142010-02-11 06:39:32 +000034
DRC60cddeb2010-02-12 05:37:07 +000035if WITH_SIMD
36
Pierre Ossman3a65ef42009-03-16 13:34:18 +000037SUBDIRS = simd
38libjpeg_la_LIBADD = simd/libsimd.la
DRC1bf1a142010-02-11 06:39:32 +000039libturbojpeg_la_LIBADD = simd/libsimd.la
Pierre Ossman2ae181c2009-03-09 13:21:27 +000040
DRC60cddeb2010-02-12 05:37:07 +000041else
42
43libjpeg_la_SOURCES += jsimd_none.c
44
45endif
46
DRC1bf1a142010-02-11 06:39:32 +000047TSTHDRS = rrutil.h rrtimer.h
DRC2e7b76b2009-04-03 12:04:24 +000048
DRC8e2bba92010-06-04 23:54:10 +000049bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom
50noinst_PROGRAMS = jpgtest jpegut
DRC2e7b76b2009-04-03 12:04:24 +000051
DRC1bf1a142010-02-11 06:39:32 +000052jpgtest_SOURCES = $(TSTHDRS) jpgtest.cxx bmp.h bmp.c
DRC2e7b76b2009-04-03 12:04:24 +000053
DRC971d8512010-02-13 22:55:05 +000054jpgtest_LDADD = libturbojpeg.la
DRC2e7b76b2009-04-03 12:04:24 +000055
DRC1bf1a142010-02-11 06:39:32 +000056jpegut_SOURCES = $(TSTHDRS) jpegut.c bmp.h bmp.c
DRC2e7b76b2009-04-03 12:04:24 +000057
DRC971d8512010-02-13 22:55:05 +000058jpegut_LDADD = libturbojpeg.la
DRC73de9822009-06-25 20:41:17 +000059
60cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdbmp.c rdgif.c \
61 rdppm.c rdswitch.c rdtarga.c
62
DRC971d8512010-02-13 22:55:05 +000063cjpeg_LDADD = libjpeg.la
DRC73de9822009-06-25 20:41:17 +000064
65cjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
66 -DTARGA_SUPPORTED
67
68djpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \
69 wrbmp.c wrgif.c wrppm.c wrtarga.c
70
DRC971d8512010-02-13 22:55:05 +000071djpeg_LDADD = libjpeg.la
DRC73de9822009-06-25 20:41:17 +000072
73djpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
74 -DTARGA_SUPPORTED
DRC60fa0602010-02-12 06:01:49 +000075
DRC0a945a12010-02-15 11:04:51 +000076jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h
DRC60fa0602010-02-12 06:01:49 +000077
DRC971d8512010-02-13 22:55:05 +000078jpegtran_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +000079
DRC0a945a12010-02-15 11:04:51 +000080rdjpgcom_SOURCES = rdjpgcom.c
DRC60fa0602010-02-12 06:01:49 +000081
DRC971d8512010-02-13 22:55:05 +000082rdjpgcom_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +000083
84wrjpgcom_SOURCES = wrjpgcom.c
85
DRC971d8512010-02-13 22:55:05 +000086wrjpgcom_LDADD = libjpeg.la
DRC60fa0602010-02-12 06:01:49 +000087
DRC0a945a12010-02-15 11:04:51 +000088
DRCcbda81a2010-06-05 01:12:35 +000089dist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
DRC0a945a12010-02-15 11:04:51 +000090
DRC39ea5622010-10-12 01:55:31 +000091DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \
92 structure.txt coderules.txt filelist.txt jconfig.txt change.log \
DRC0b7d4ed2010-03-03 09:37:58 +000093 README-turbo.txt rdrle.c wrrle.c LICENSE.txt LGPL.txt BUILDING.txt \
94 ChangeLog.txt
DRC0a945a12010-02-15 11:04:51 +000095
DRC968c8bb2010-02-22 22:50:13 +000096TESTFILES= testorig.jpg testorig.ppm testimg.bmp testimgflt.jpg \
DRC50503c72010-09-09 21:00:31 +000097 testimgfst.jpg testimgint.jpg testimgp.jpg testimgflt.ppm testimgfst.ppm \
DRC1f80a102010-10-18 00:15:31 +000098 testimgint.ppm testimgflt-nosimd.jpg testimgcrop.jpg
DRC0a945a12010-02-15 11:04:51 +000099
DRC1f80a102010-10-18 00:15:31 +0000100EXTRA_DIST = win release $(DOCS) $(TESTFILES) CMakeLists.txt \
DRC8515d3d2010-10-19 06:38:57 +0000101 sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in
DRC0a945a12010-02-15 11:04:51 +0000102
103dist-hook:
104 rm -rf `find $(distdir) -name .svn`
105
106
DRC66f97e62010-11-23 05:49:54 +0000107test: testclean all
108 ./jpegut
109 ./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testorig.ppm
110 cmp $(srcdir)/testimgint.jpg testoutint.jpg
111 ./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testorig.ppm
112 cmp $(srcdir)/testimgfst.jpg testoutfst.jpg
113 ./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testorig.ppm
DRC83f21442010-06-10 18:52:41 +0000114if WITH_SIMD
DRC0fd8be52010-02-19 05:12:39 +0000115 cmp $(srcdir)/testimgflt.jpg testoutflt.jpg
DRC83f21442010-06-10 18:52:41 +0000116else
DRC83f21442010-06-10 18:52:41 +0000117 cmp $(srcdir)/testimgflt-nosimd.jpg testoutflt.jpg
DRC66f97e62010-11-23 05:49:54 +0000118endif
DRC83f21442010-06-10 18:52:41 +0000119 ./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testorig.jpg
DRC83f21442010-06-10 18:52:41 +0000120 cmp $(srcdir)/testimgint.ppm testoutint.ppm
DRC66f97e62010-11-23 05:49:54 +0000121 ./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testorig.jpg
DRC30959712010-08-07 16:06:56 +0000122 cmp $(srcdir)/testimgfst.ppm testoutfst.ppm
DRC66f97e62010-11-23 05:49:54 +0000123 ./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testorig.jpg
124if WITH_SIMD
125 cmp $(srcdir)/testimgflt.ppm testoutflt.ppm
126else
DRC30959712010-08-07 16:06:56 +0000127 cmp $(srcdir)/testorig.ppm testoutflt.ppm
DRC66f97e62010-11-23 05:49:54 +0000128endif
DRC83f21442010-06-10 18:52:41 +0000129 ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg
DRC30959712010-08-07 16:06:56 +0000130 cmp $(srcdir)/testimg.bmp testout.bmp
DRC66f97e62010-11-23 05:49:54 +0000131 ./cjpeg -dct int -arithmetic -outfile testoutari.jpg $(srcdir)/testorig.ppm
132 cmp $(srcdir)/testimgari.jpg testoutari.jpg
133 ./djpeg -dct int -fast -ppm -outfile testoutari.ppm $(srcdir)/testimgari.jpg
134 cmp $(srcdir)/testimgari.ppm testoutari.ppm
135 ./jpegtran -arithmetic -outfile testouta.jpg testoutint.jpg
136 cmp $(srcdir)/testimgari.jpg testouta.jpg
137 ./jpegtran -outfile testouta.jpg testoutari.jpg
138 cmp $(srcdir)/testimgint.jpg testouta.jpg
DRC30959712010-08-07 16:06:56 +0000139 ./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testorig.ppm
140 cmp $(srcdir)/testimgp.jpg testoutp.jpg
DRC83f21442010-06-10 18:52:41 +0000141 ./jpegtran -outfile testoutt.jpg testoutp.jpg
DRC30959712010-08-07 16:06:56 +0000142 cmp $(srcdir)/testimgint.jpg testoutt.jpg
DRC9a648cc2010-10-10 02:48:21 +0000143 ./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg $(srcdir)/testorig.jpg
DRCc04bd3c2010-10-10 02:15:56 +0000144 cmp $(srcdir)/testimgcrop.jpg testoutcrop.jpg
DRC83f21442010-06-10 18:52:41 +0000145
DRC83f21442010-06-10 18:52:41 +0000146
DRC34d59e72010-02-12 06:27:34 +0000147testclean:
DRC7b991722010-06-10 19:44:56 +0000148 rm -f testout*
149 rm -f *_GRAYQ[0-9]*.bmp
150 rm -f *_GRAYQ[0-9]*.ppm
151 rm -f *_GRAYQ[0-9]*.jpg
152 rm -f *_420Q[0-9]*.bmp
153 rm -f *_420Q[0-9]*.ppm
154 rm -f *_420Q[0-9]*.jpg
155 rm -f *_422Q[0-9]*.bmp
156 rm -f *_422Q[0-9]*.ppm
157 rm -f *_422Q[0-9]*.jpg
158 rm -f *_444Q[0-9]*.bmp
159 rm -f *_444Q[0-9]*.ppm
160 rm -f *_444Q[0-9]*.jpg
DRC079b4342010-02-15 11:32:23 +0000161
DRCd1c281a2010-11-17 22:44:40 +0000162if X86_64
163
164install-exec-hook:
165 __PREFIX=`echo ${prefix} | sed -e 's@\/*$$@@'`; \
166 if [ "$$__PREFIX" = "/opt/libjpeg-turbo" ]; then \
167 cd $(DESTDIR)/${prefix}; \
168 if [ -d lib -a ! -d lib64 -a ! -h lib64 ]; then \
169 $(LN_S) lib lib64; \
170 fi \
171 fi
172
173else
174
175install-exec-hook:
176 __PREFIX=`echo ${prefix} | sed -e 's@\/*$$@@'`; \
177 if [ "$$__PREFIX" = "/opt/libjpeg-turbo" ]; then \
178 cd $(DESTDIR)/${prefix}; \
179 if [ -d lib -a ! -d lib32 -a ! -h lib32 ]; then \
180 $(LN_S) lib lib32; \
181 fi \
182 fi
183
184endif
185
DRC079b4342010-02-15 11:32:23 +0000186rpm: all
DRC1f80a102010-10-18 00:15:31 +0000187 TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
188 mkdir -p $$TMPDIR/RPMS; \
189 ln -fs `pwd` $$TMPDIR/BUILD; \
190 rm -f ${PACKAGE_NAME}.${RPMARCH}.rpm; \
191 rpmbuild -bb --define "_blddir $$TMPDIR/buildroot" \
192 --define "_topdir $$TMPDIR" --define "_srcdir ${srcdir}" \
193 --target ${RPMARCH} libjpeg-turbo.spec; \
194 cp $$TMPDIR/RPMS/${RPMARCH}/${PACKAGE_NAME}-${VERSION}-${BUILD}.${RPMARCH}.rpm ${PACKAGE_NAME}.${RPMARCH}.rpm; \
195 rm -rf $$TMPDIR
DRC079b4342010-02-15 11:32:23 +0000196
DRCf26914b2010-02-15 11:36:46 +0000197srpm: dist-gzip
DRC1f80a102010-10-18 00:15:31 +0000198 TMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \
199 mkdir -p $$TMPDIR/RPMS; \
200 mkdir -p $$TMPDIR/SRPMS; \
201 mkdir -p $$TMPDIR/BUILD; \
202 mkdir -p $$TMPDIR/SOURCES; \
203 mkdir -p $$TMPDIR/SPECS; \
204 rm -f ${PACKAGE_NAME}.src.rpm; \
205 cp ${PACKAGE_NAME}-${VERSION}.tar.gz $$TMPDIR/SOURCES; \
206 cat libjpeg-turbo.spec | sed s/%{_blddir}/%{_tmppath}/g \
207 | sed s@%{_srcdir}/@@g | sed s/#--\>//g \
208 >$$TMPDIR/SPECS/libjpeg-turbo.spec; \
209 rpmbuild -bs --define "_topdir $$TMPDIR" $$TMPDIR/SPECS/libjpeg-turbo.spec; \
210 cp $$TMPDIR/SRPMS/${PACKAGE_NAME}-${VERSION}-${BUILD}.src.rpm ${PACKAGE_NAME}.src.rpm; \
211 rm -rf $$TMPDIR
DRC52a19f22010-02-15 12:06:27 +0000212
213deb: all
214 sh $(srcdir)/release/makedpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} \
215 ${DEBARCH} ${srcdir}
DRC6533b6e2010-02-15 14:57:18 +0000216
DRC315123f2010-02-15 16:14:26 +0000217if X86_64
218
219udmg: all
DRC0f53df82010-10-21 19:47:06 +0000220 sh makemacpkg universal ${BUILDDIR32}
DRC315123f2010-02-15 16:14:26 +0000221
222endif
223
DRC6533b6e2010-02-15 14:57:18 +0000224dmg: all
DRC0f53df82010-10-21 19:47:06 +0000225 sh makemacpkg
DRCb9b1ca32010-02-17 02:24:02 +0000226
227if X86_64
228
DRC0f53df82010-10-21 19:47:06 +0000229csunpkg: all
230 sh makesunpkg combined ${BUILDDIR32}
DRCb9b1ca32010-02-17 02:24:02 +0000231
DRC3dc1bc22010-05-10 22:18:10 +0000232endif
DRCae79fdb2010-06-09 20:16:04 +0000233
DRC0f53df82010-10-21 19:47:06 +0000234sunpkg: all
235 sh makesunpkg
236
DRCae79fdb2010-06-09 20:16:04 +0000237cygwinpkg: all
238 sh $(srcdir)/release/makecygwinpkg ${PACKAGE_NAME} ${VERSION} ${srcdir}