2011-02-20 20:11:55 +01:00
|
|
|
# This makefile is a simpler alternative to the autoconf-based build
|
|
|
|
# system, for simple local building of the libraries and tools.
|
|
|
|
# It will not install the libraries system-wide, but just create the 'cwebp'
|
|
|
|
# and 'dwebp' tools in the examples/ directory, along with the static
|
2015-04-15 11:14:08 +02:00
|
|
|
# libraries 'src/libwebp.a', 'src/libwebpdecoder.a', 'src/mux/libwebpmux.a',
|
2022-08-04 17:56:59 +02:00
|
|
|
# 'src/demux/libwebpdemux.a', 'extras/libwebpextras.a' and
|
|
|
|
# 'sharpyuv/libsharpyuv.a'.
|
2011-02-20 20:11:55 +01:00
|
|
|
#
|
|
|
|
# To build the library and examples, use:
|
|
|
|
# make -f makefile.unix
|
|
|
|
# from this top directory.
|
|
|
|
|
|
|
|
#### Customizable part ####
|
|
|
|
|
2012-11-21 21:12:29 +01:00
|
|
|
# These flags assume you have libpng, libjpeg, libtiff and libgif installed. If
|
|
|
|
# not, either follow the install instructions below or just comment out the next
|
|
|
|
# four lines.
|
2012-07-02 02:55:21 +02:00
|
|
|
EXTRA_FLAGS= -DWEBP_HAVE_PNG -DWEBP_HAVE_JPEG -DWEBP_HAVE_TIFF
|
2012-11-21 21:12:29 +01:00
|
|
|
DWEBP_LIBS= -lpng -lz
|
|
|
|
CWEBP_LIBS= $(DWEBP_LIBS) -ljpeg -ltiff
|
|
|
|
GIF_LIBS = -lgif
|
|
|
|
|
2011-06-24 22:47:59 +02:00
|
|
|
ifeq ($(strip $(shell uname)), Darwin)
|
2012-06-27 03:09:55 +02:00
|
|
|
# Work around a problem linking tables marked as common symbols,
|
|
|
|
# cf., src/enc/yuv.[hc]
|
|
|
|
# Failure observed with: gcc 4.2.1 and 4.0.1.
|
|
|
|
EXTRA_FLAGS += -fno-common
|
2013-05-01 23:47:56 +02:00
|
|
|
EXTRA_FLAGS += -DHAVE_GLUT_GLUT_H
|
2018-03-31 09:30:00 +02:00
|
|
|
EXTRA_FLAGS += -Wno-deprecated-declarations
|
2011-03-17 22:45:23 +01:00
|
|
|
EXTRA_FLAGS += -I/opt/local/include
|
|
|
|
EXTRA_LIBS += -L/opt/local/lib
|
2012-05-09 21:42:36 +02:00
|
|
|
GL_LIBS = -framework GLUT -framework OpenGL
|
|
|
|
else
|
2017-03-08 09:10:14 +01:00
|
|
|
EXTRA_FLAGS += -I/usr/local/include
|
|
|
|
EXTRA_LIBS += -L/usr/local/lib
|
2012-05-09 21:42:36 +02:00
|
|
|
GL_LIBS = -lglut -lGL
|
2011-03-17 22:45:23 +01:00
|
|
|
endif
|
2012-11-06 02:35:36 +01:00
|
|
|
|
2017-09-04 06:25:31 +02:00
|
|
|
# SDL flags: use sdl-config if it exists
|
2023-09-28 10:18:23 +02:00
|
|
|
SDL_CONFIG = $(shell sdl2-config --version 2> /dev/null)
|
2017-09-04 06:25:31 +02:00
|
|
|
ifneq ($(SDL_CONFIG),)
|
2023-09-28 10:18:23 +02:00
|
|
|
SDL_LIBS = $(shell sdl2-config --libs)
|
|
|
|
SDL_FLAGS = $(shell sdl2-config --cflags)
|
2017-09-04 06:25:31 +02:00
|
|
|
else
|
|
|
|
# use best-guess
|
2023-09-28 10:18:23 +02:00
|
|
|
SDL_LIBS = -lSDL2
|
2017-09-04 06:25:31 +02:00
|
|
|
SDL_FLAGS =
|
|
|
|
endif
|
2011-03-17 22:45:23 +01:00
|
|
|
|
|
|
|
# To install libraries on Mac OS X:
|
2021-11-17 20:16:58 +01:00
|
|
|
# 1. Install MacPorts (https://www.macports.org/install.php)
|
2011-03-17 22:45:23 +01:00
|
|
|
# 2. Run "sudo port install jpeg"
|
|
|
|
# 3. Run "sudo port install libpng"
|
2012-07-02 02:55:21 +02:00
|
|
|
# 4. Run "sudo port install tiff"
|
2012-11-06 02:35:36 +01:00
|
|
|
# 5. Run "sudo port install giflib"
|
2011-03-17 22:45:23 +01:00
|
|
|
|
|
|
|
# To install libraries on Linux:
|
|
|
|
# 1. Run "sudo apt-get install libjpeg62-dev"
|
|
|
|
# 2. Run "sudo apt-get install libpng12-dev"
|
2012-07-02 02:55:21 +02:00
|
|
|
# 3. Run "sudo apt-get install libtiff4-dev"
|
2012-11-06 02:35:36 +01:00
|
|
|
# 4. Run "sudo apt-get install libgif-dev"
|
2011-02-20 20:11:55 +01:00
|
|
|
|
|
|
|
# Uncomment for build for 32bit platform
|
|
|
|
# Alternatively, you can just use the command
|
|
|
|
# 'make -f makefile.unix EXTRA_FLAGS=-m32' to that effect.
|
2011-03-25 23:04:11 +01:00
|
|
|
# EXTRA_FLAGS += -m32
|
|
|
|
|
2013-01-19 01:23:09 +01:00
|
|
|
# Extra flags to enable byte swap for 16 bit colorspaces.
|
2017-08-01 03:53:29 +02:00
|
|
|
# EXTRA_FLAGS += -DWEBP_SWAP_16BIT_CSP=1
|
2013-01-19 01:23:09 +01:00
|
|
|
|
2011-07-22 22:09:10 +02:00
|
|
|
# Extra flags to enable multi-threading
|
|
|
|
EXTRA_FLAGS += -DWEBP_USE_THREAD
|
|
|
|
EXTRA_LIBS += -lpthread
|
|
|
|
|
2015-12-15 08:45:12 +01:00
|
|
|
# Control symbol visibility. Comment out if your compiler doesn't support it.
|
|
|
|
EXTRA_FLAGS += -fvisibility=hidden
|
|
|
|
|
2011-03-25 23:04:11 +01:00
|
|
|
# Extra flags to emulate C89 strictness with the full ANSI
|
2015-11-06 07:47:03 +01:00
|
|
|
EXTRA_FLAGS += -Wextra -Wold-style-definition
|
|
|
|
EXTRA_FLAGS += -Wmissing-prototypes
|
|
|
|
EXTRA_FLAGS += -Wmissing-declarations
|
|
|
|
EXTRA_FLAGS += -Wdeclaration-after-statement
|
|
|
|
EXTRA_FLAGS += -Wshadow
|
|
|
|
EXTRA_FLAGS += -Wformat-security -Wformat-nonliteral
|
|
|
|
# EXTRA_FLAGS += -Wvla
|
2011-02-20 20:11:55 +01:00
|
|
|
|
2015-03-20 15:54:33 +01:00
|
|
|
# SSE4.1-specific flags:
|
|
|
|
ifeq ($(HAVE_SSE41), 1)
|
|
|
|
EXTRA_FLAGS += -DWEBP_HAVE_SSE41
|
|
|
|
src/dsp/%_sse41.o: EXTRA_FLAGS += -msse4.1
|
|
|
|
endif
|
|
|
|
|
2014-03-31 16:36:33 +02:00
|
|
|
# NEON-specific flags:
|
|
|
|
# EXTRA_FLAGS += -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8
|
|
|
|
# -> seems to make the overall lib slower: -fno-split-wide-types
|
|
|
|
|
2016-05-27 12:09:27 +02:00
|
|
|
# MIPS (MSA) 32-bit build specific flags for mips32r5 (p5600):
|
|
|
|
# EXTRA_FLAGS += -mips32r5 -mabi=32 -mtune=p5600 -mmsa -mfp64
|
|
|
|
# EXTRA_FLAGS += -msched-weight -mload-store-pairs
|
|
|
|
|
|
|
|
# MIPS (MSA) 64-bit build specific flags for mips64r6 (i6400):
|
|
|
|
# EXTRA_FLAGS += -mips64r6 -mabi=64 -mtune=i6400 -mmsa -mfp64
|
|
|
|
# EXTRA_FLAGS += -msched-weight -mload-store-pairs
|
|
|
|
|
2011-02-20 20:11:55 +01:00
|
|
|
#### Nothing should normally be changed below this line ####
|
|
|
|
|
2011-08-26 02:25:11 +02:00
|
|
|
AR = ar
|
|
|
|
ARFLAGS = r
|
2017-10-07 23:15:11 +02:00
|
|
|
CPPFLAGS = -I. -Isrc/ -Wall
|
2018-04-11 13:45:53 +02:00
|
|
|
ifeq ($(DEBUG), 1)
|
|
|
|
CFLAGS = -g
|
|
|
|
else
|
|
|
|
CFLAGS = -O3 -DNDEBUG
|
|
|
|
endif
|
|
|
|
CFLAGS += $(EXTRA_FLAGS)
|
2015-05-02 01:11:49 +02:00
|
|
|
CC = gcc
|
2011-08-26 03:33:28 +02:00
|
|
|
INSTALL = install
|
2011-11-30 13:16:45 +01:00
|
|
|
GROFF = /usr/bin/groff
|
|
|
|
COL = /usr/bin/col
|
2013-02-14 07:21:41 +01:00
|
|
|
LDFLAGS = $(EXTRA_LIBS) $(EXTRA_FLAGS) -lm
|
2011-02-20 20:11:55 +01:00
|
|
|
|
2019-03-12 09:48:37 +01:00
|
|
|
ifdef BITTRACE
|
|
|
|
CFLAGS += -DBITTRACE=$(BITTRACE)
|
|
|
|
endif
|
|
|
|
|
2015-05-02 01:11:49 +02:00
|
|
|
ANIM_UTIL_OBJS = \
|
|
|
|
examples/anim_util.o \
|
|
|
|
|
2022-03-01 12:04:52 +01:00
|
|
|
SHARPYUV_OBJS = \
|
|
|
|
sharpyuv/sharpyuv.o \
|
2022-10-22 04:04:53 +02:00
|
|
|
sharpyuv/sharpyuv_cpu.o \
|
2022-04-06 15:38:21 +02:00
|
|
|
sharpyuv/sharpyuv_csp.o \
|
2022-03-01 12:04:52 +01:00
|
|
|
sharpyuv/sharpyuv_dsp.o \
|
2022-06-01 15:38:44 +02:00
|
|
|
sharpyuv/sharpyuv_gamma.o \
|
2022-03-01 12:04:52 +01:00
|
|
|
sharpyuv/sharpyuv_neon.o \
|
|
|
|
sharpyuv/sharpyuv_sse2.o \
|
|
|
|
|
2012-04-12 21:00:43 +02:00
|
|
|
DEC_OBJS = \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/dec/alpha_dec.o \
|
|
|
|
src/dec/buffer_dec.o \
|
|
|
|
src/dec/frame_dec.o \
|
|
|
|
src/dec/idec_dec.o \
|
|
|
|
src/dec/io_dec.o \
|
|
|
|
src/dec/quant_dec.o \
|
|
|
|
src/dec/tree_dec.o \
|
|
|
|
src/dec/vp8_dec.o \
|
|
|
|
src/dec/vp8l_dec.o \
|
|
|
|
src/dec/webp_dec.o \
|
2012-04-12 21:00:43 +02:00
|
|
|
|
2012-11-19 20:21:37 +01:00
|
|
|
DEMUX_OBJS = \
|
2015-09-03 01:20:24 +02:00
|
|
|
src/demux/anim_decode.o \
|
2012-11-19 20:21:37 +01:00
|
|
|
src/demux/demux.o \
|
|
|
|
|
2013-02-14 07:21:41 +01:00
|
|
|
DSP_DEC_OBJS = \
|
2014-05-26 18:05:03 +02:00
|
|
|
src/dsp/alpha_processing.o \
|
2014-08-21 19:26:18 +02:00
|
|
|
src/dsp/alpha_processing_mips_dsp_r2.o \
|
2017-01-11 17:39:29 +01:00
|
|
|
src/dsp/alpha_processing_neon.o \
|
2014-08-26 05:55:28 +02:00
|
|
|
src/dsp/alpha_processing_sse2.o \
|
2015-06-19 14:23:38 +02:00
|
|
|
src/dsp/alpha_processing_sse41.o \
|
2012-04-12 21:00:43 +02:00
|
|
|
src/dsp/cpu.o \
|
|
|
|
src/dsp/dec.o \
|
2014-02-14 04:32:21 +01:00
|
|
|
src/dsp/dec_clip_tables.o \
|
2013-12-25 12:16:01 +01:00
|
|
|
src/dsp/dec_mips32.o \
|
2014-09-02 14:03:13 +02:00
|
|
|
src/dsp/dec_mips_dsp_r2.o \
|
2016-06-09 15:47:09 +02:00
|
|
|
src/dsp/dec_msa.o \
|
2012-04-12 21:00:43 +02:00
|
|
|
src/dsp/dec_neon.o \
|
|
|
|
src/dsp/dec_sse2.o \
|
2015-03-19 21:18:59 +01:00
|
|
|
src/dsp/dec_sse41.o \
|
2015-01-28 08:02:41 +01:00
|
|
|
src/dsp/filters.o \
|
2014-08-04 16:22:10 +02:00
|
|
|
src/dsp/filters_mips_dsp_r2.o \
|
2016-07-01 15:56:00 +02:00
|
|
|
src/dsp/filters_msa.o \
|
2017-01-16 16:11:41 +01:00
|
|
|
src/dsp/filters_neon.o \
|
2015-01-29 08:06:29 +01:00
|
|
|
src/dsp/filters_sse2.o \
|
2012-04-12 21:00:43 +02:00
|
|
|
src/dsp/lossless.o \
|
2014-09-02 16:34:52 +02:00
|
|
|
src/dsp/lossless_mips_dsp_r2.o \
|
2016-06-27 11:06:28 +02:00
|
|
|
src/dsp/lossless_msa.o \
|
2014-03-31 16:36:33 +02:00
|
|
|
src/dsp/lossless_neon.o \
|
2014-03-27 21:43:21 +01:00
|
|
|
src/dsp/lossless_sse2.o \
|
2021-02-18 12:36:31 +01:00
|
|
|
src/dsp/lossless_sse41.o \
|
2015-01-09 12:05:53 +01:00
|
|
|
src/dsp/rescaler.o \
|
|
|
|
src/dsp/rescaler_mips32.o \
|
|
|
|
src/dsp/rescaler_mips_dsp_r2.o \
|
2016-07-19 16:47:54 +02:00
|
|
|
src/dsp/rescaler_msa.o \
|
2015-10-05 11:26:52 +02:00
|
|
|
src/dsp/rescaler_neon.o \
|
2015-09-25 14:34:02 +02:00
|
|
|
src/dsp/rescaler_sse2.o \
|
2012-04-12 21:00:43 +02:00
|
|
|
src/dsp/upsampling.o \
|
2014-08-15 11:00:32 +02:00
|
|
|
src/dsp/upsampling_mips_dsp_r2.o \
|
2016-07-21 16:30:44 +02:00
|
|
|
src/dsp/upsampling_msa.o \
|
2013-01-18 03:06:26 +01:00
|
|
|
src/dsp/upsampling_neon.o \
|
2012-04-12 21:00:43 +02:00
|
|
|
src/dsp/upsampling_sse2.o \
|
2017-12-11 09:00:19 +01:00
|
|
|
src/dsp/upsampling_sse41.o \
|
2012-04-12 21:00:43 +02:00
|
|
|
src/dsp/yuv.o \
|
2014-06-07 21:35:47 +02:00
|
|
|
src/dsp/yuv_mips32.o \
|
2014-08-12 11:47:36 +02:00
|
|
|
src/dsp/yuv_mips_dsp_r2.o \
|
2017-04-18 18:22:30 +02:00
|
|
|
src/dsp/yuv_neon.o \
|
2014-06-06 08:49:59 +02:00
|
|
|
src/dsp/yuv_sse2.o \
|
2017-12-11 09:00:19 +01:00
|
|
|
src/dsp/yuv_sse41.o \
|
2012-04-12 21:00:43 +02:00
|
|
|
|
2013-02-14 07:21:41 +01:00
|
|
|
DSP_ENC_OBJS = \
|
2015-02-07 11:13:26 +01:00
|
|
|
src/dsp/cost.o \
|
|
|
|
src/dsp/cost_mips32.o \
|
|
|
|
src/dsp/cost_mips_dsp_r2.o \
|
2018-11-13 00:48:51 +01:00
|
|
|
src/dsp/cost_neon.o \
|
2015-02-18 09:40:30 +01:00
|
|
|
src/dsp/cost_sse2.o \
|
2013-02-14 07:21:41 +01:00
|
|
|
src/dsp/enc.o \
|
2014-02-19 15:33:50 +01:00
|
|
|
src/dsp/enc_mips32.o \
|
2014-10-10 12:31:00 +02:00
|
|
|
src/dsp/enc_mips_dsp_r2.o \
|
2016-07-05 16:30:43 +02:00
|
|
|
src/dsp/enc_msa.o \
|
2013-02-14 07:21:41 +01:00
|
|
|
src/dsp/enc_neon.o \
|
|
|
|
src/dsp/enc_sse2.o \
|
2015-03-25 12:12:44 +01:00
|
|
|
src/dsp/enc_sse41.o \
|
2015-03-21 03:09:49 +01:00
|
|
|
src/dsp/lossless_enc.o \
|
|
|
|
src/dsp/lossless_enc_mips32.o \
|
|
|
|
src/dsp/lossless_enc_mips_dsp_r2.o \
|
2016-07-18 13:02:36 +02:00
|
|
|
src/dsp/lossless_enc_msa.o \
|
2015-03-21 03:09:49 +01:00
|
|
|
src/dsp/lossless_enc_neon.o \
|
|
|
|
src/dsp/lossless_enc_sse2.o \
|
2015-06-23 08:46:57 +02:00
|
|
|
src/dsp/lossless_enc_sse41.o \
|
2017-02-20 17:27:15 +01:00
|
|
|
src/dsp/ssim.o \
|
|
|
|
src/dsp/ssim_sse2.o \
|
2013-02-14 07:21:41 +01:00
|
|
|
|
2012-04-12 21:00:43 +02:00
|
|
|
ENC_OBJS = \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/enc/alpha_enc.o \
|
|
|
|
src/enc/analysis_enc.o \
|
2017-06-01 15:07:28 +02:00
|
|
|
src/enc/backward_references_cost_enc.o \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/enc/backward_references_enc.o \
|
|
|
|
src/enc/config_enc.o \
|
|
|
|
src/enc/cost_enc.o \
|
|
|
|
src/enc/filter_enc.o \
|
|
|
|
src/enc/frame_enc.o \
|
|
|
|
src/enc/histogram_enc.o \
|
|
|
|
src/enc/iterator_enc.o \
|
|
|
|
src/enc/near_lossless_enc.o \
|
|
|
|
src/enc/picture_enc.o \
|
|
|
|
src/enc/picture_csp_enc.o \
|
|
|
|
src/enc/picture_psnr_enc.o \
|
|
|
|
src/enc/picture_rescale_enc.o \
|
|
|
|
src/enc/picture_tools_enc.o \
|
|
|
|
src/enc/predictor_enc.o \
|
|
|
|
src/enc/quant_enc.o \
|
|
|
|
src/enc/syntax_enc.o \
|
|
|
|
src/enc/token_enc.o \
|
|
|
|
src/enc/tree_enc.o \
|
|
|
|
src/enc/vp8l_enc.o \
|
|
|
|
src/enc/webp_enc.o \
|
2012-04-12 21:00:43 +02:00
|
|
|
|
2012-12-06 22:06:37 +01:00
|
|
|
EX_FORMAT_DEC_OBJS = \
|
2016-07-20 01:02:55 +02:00
|
|
|
imageio/image_dec.o \
|
|
|
|
imageio/jpegdec.o \
|
|
|
|
imageio/metadata.o \
|
|
|
|
imageio/pngdec.o \
|
2017-01-30 10:52:19 +01:00
|
|
|
imageio/pnmdec.o \
|
2016-07-20 01:02:55 +02:00
|
|
|
imageio/tiffdec.o \
|
|
|
|
imageio/webpdec.o \
|
2012-12-06 22:06:37 +01:00
|
|
|
|
2016-09-07 07:46:31 +02:00
|
|
|
EX_FORMAT_ENC_OBJS = \
|
|
|
|
imageio/image_enc.o \
|
|
|
|
|
2012-05-12 01:00:57 +02:00
|
|
|
EX_UTIL_OBJS = \
|
2016-07-22 01:10:05 +02:00
|
|
|
examples/example_util.o \
|
2012-05-12 01:00:57 +02:00
|
|
|
|
2015-01-14 00:43:31 +01:00
|
|
|
GIFDEC_OBJS = \
|
|
|
|
examples/gifdec.o \
|
|
|
|
|
2016-07-21 03:25:00 +02:00
|
|
|
IMAGE_UTIL_OBJS = \
|
|
|
|
imageio/imageio_util.o \
|
|
|
|
|
2012-04-12 21:00:43 +02:00
|
|
|
MUX_OBJS = \
|
2015-01-07 01:12:48 +01:00
|
|
|
src/mux/anim_encode.o \
|
2012-04-12 21:00:43 +02:00
|
|
|
src/mux/muxedit.o \
|
|
|
|
src/mux/muxinternal.o \
|
|
|
|
src/mux/muxread.o \
|
|
|
|
|
2013-02-14 07:21:41 +01:00
|
|
|
UTILS_DEC_OBJS = \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/utils/bit_reader_utils.o \
|
|
|
|
src/utils/color_cache_utils.o \
|
|
|
|
src/utils/filters_utils.o \
|
|
|
|
src/utils/huffman_utils.o \
|
2023-07-04 18:09:13 +02:00
|
|
|
src/utils/palette.o \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/utils/quant_levels_dec_utils.o \
|
|
|
|
src/utils/random_utils.o \
|
|
|
|
src/utils/rescaler_utils.o \
|
|
|
|
src/utils/thread_utils.o \
|
2012-08-01 01:56:39 +02:00
|
|
|
src/utils/utils.o \
|
2012-04-12 21:00:43 +02:00
|
|
|
|
2013-02-14 07:21:41 +01:00
|
|
|
UTILS_ENC_OBJS = \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/utils/bit_writer_utils.o \
|
|
|
|
src/utils/huffman_encode_utils.o \
|
|
|
|
src/utils/quant_levels_utils.o \
|
2013-02-14 07:21:41 +01:00
|
|
|
|
2015-04-15 11:14:08 +02:00
|
|
|
EXTRA_OBJS = \
|
2016-07-20 00:23:08 +02:00
|
|
|
extras/extras.o \
|
2016-07-20 21:55:05 +02:00
|
|
|
extras/quality_estimate.o \
|
2024-01-12 03:02:16 +01:00
|
|
|
extras/sharpyuv_risk_table.o \
|
2015-04-15 11:14:08 +02:00
|
|
|
|
2013-02-14 07:21:41 +01:00
|
|
|
LIBWEBPDECODER_OBJS = $(DEC_OBJS) $(DSP_DEC_OBJS) $(UTILS_DEC_OBJS)
|
2022-08-04 17:56:59 +02:00
|
|
|
LIBWEBP_OBJS = $(LIBWEBPDECODER_OBJS) $(ENC_OBJS) \
|
2022-03-01 12:04:52 +01:00
|
|
|
$(DSP_ENC_OBJS) $(UTILS_ENC_OBJS)
|
2012-04-12 21:00:43 +02:00
|
|
|
LIBWEBPMUX_OBJS = $(MUX_OBJS)
|
2012-11-19 20:21:37 +01:00
|
|
|
LIBWEBPDEMUX_OBJS = $(DEMUX_OBJS)
|
2015-04-15 11:14:08 +02:00
|
|
|
LIBWEBPEXTRA_OBJS = $(EXTRA_OBJS)
|
2022-08-04 17:56:59 +02:00
|
|
|
LIBSHARPYUV_OBJS = $(SHARPYUV_OBJS)
|
2012-04-12 21:00:43 +02:00
|
|
|
|
2012-07-17 00:45:30 +02:00
|
|
|
HDRS_INSTALLED = \
|
|
|
|
src/webp/decode.h \
|
2013-03-18 01:14:40 +01:00
|
|
|
src/webp/demux.h \
|
2012-07-17 00:45:30 +02:00
|
|
|
src/webp/encode.h \
|
2013-03-18 01:14:40 +01:00
|
|
|
src/webp/mux.h \
|
2013-03-19 22:47:00 +01:00
|
|
|
src/webp/mux_types.h \
|
2012-07-17 00:45:30 +02:00
|
|
|
src/webp/types.h \
|
|
|
|
|
2022-08-04 17:56:59 +02:00
|
|
|
SHARPYUV_HDRS_INSTALLED = \
|
|
|
|
sharpyuv/sharpyuv.h \
|
2022-10-22 04:04:53 +02:00
|
|
|
sharpyuv/sharpyuv_cpu.h \
|
|
|
|
sharpyuv/sharpyuv_csp.h \
|
2022-08-04 17:56:59 +02:00
|
|
|
|
2012-04-12 21:00:43 +02:00
|
|
|
HDRS = \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/dec/alphai_dec.h \
|
|
|
|
src/dec/common_dec.h \
|
|
|
|
src/dec/vp8_dec.h \
|
|
|
|
src/dec/vp8i_dec.h \
|
|
|
|
src/dec/vp8li_dec.h \
|
|
|
|
src/dec/webpi_dec.h \
|
2016-02-17 09:46:55 +01:00
|
|
|
src/dsp/common_sse2.h \
|
2022-02-18 11:19:18 +01:00
|
|
|
src/dsp/cpu.h \
|
2012-04-12 21:00:43 +02:00
|
|
|
src/dsp/dsp.h \
|
|
|
|
src/dsp/lossless.h \
|
2016-09-12 17:23:15 +02:00
|
|
|
src/dsp/lossless_common.h \
|
2014-10-10 12:31:00 +02:00
|
|
|
src/dsp/mips_macro.h \
|
2016-06-09 15:47:09 +02:00
|
|
|
src/dsp/msa_macro.h \
|
2014-04-26 21:11:00 +02:00
|
|
|
src/dsp/neon.h \
|
2012-04-12 21:00:43 +02:00
|
|
|
src/dsp/yuv.h \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/enc/backward_references_enc.h \
|
|
|
|
src/enc/cost_enc.h \
|
|
|
|
src/enc/histogram_enc.h \
|
|
|
|
src/enc/vp8i_enc.h \
|
|
|
|
src/enc/vp8li_enc.h \
|
2016-10-03 23:40:51 +02:00
|
|
|
src/mux/animi.h \
|
2014-04-26 21:11:00 +02:00
|
|
|
src/mux/muxi.h \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/utils/bit_reader_utils.h \
|
|
|
|
src/utils/bit_reader_inl_utils.h \
|
|
|
|
src/utils/bit_writer_utils.h \
|
|
|
|
src/utils/color_cache_utils.h \
|
|
|
|
src/utils/endian_inl_utils.h \
|
|
|
|
src/utils/filters_utils.h \
|
|
|
|
src/utils/huffman_utils.h \
|
|
|
|
src/utils/huffman_encode_utils.h \
|
2023-07-04 18:09:13 +02:00
|
|
|
src/utils/palette.h \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/utils/quant_levels_utils.h \
|
|
|
|
src/utils/quant_levels_dec_utils.h \
|
|
|
|
src/utils/random_utils.h \
|
|
|
|
src/utils/rescaler_utils.h \
|
|
|
|
src/utils/thread_utils.h \
|
2014-04-26 21:11:00 +02:00
|
|
|
src/utils/utils.h \
|
2012-05-24 11:21:37 +02:00
|
|
|
src/webp/format_constants.h \
|
2012-07-17 00:45:30 +02:00
|
|
|
$(HDRS_INSTALLED) \
|
2022-08-04 17:56:59 +02:00
|
|
|
$(SHARPYUV_HDRS_INSTALLED) \
|
2011-09-07 11:26:35 +02:00
|
|
|
|
2016-09-07 07:46:31 +02:00
|
|
|
OUT_LIBS = examples/libexample_util.a
|
|
|
|
OUT_LIBS += imageio/libimageio_util.a
|
|
|
|
OUT_LIBS += imageio/libimagedec.a
|
|
|
|
OUT_LIBS += imageio/libimageenc.a
|
|
|
|
OUT_LIBS += src/libwebpdecoder.a
|
2016-07-20 17:43:48 +02:00
|
|
|
OUT_LIBS += src/libwebp.a
|
2022-08-04 17:56:59 +02:00
|
|
|
OUT_LIBS += sharpyuv/libsharpyuv.a
|
2016-07-20 00:23:08 +02:00
|
|
|
EXTRA_LIB = extras/libwebpextras.a
|
2012-04-24 03:46:12 +02:00
|
|
|
OUT_EXAMPLES = examples/cwebp examples/dwebp
|
2015-11-06 07:47:03 +01:00
|
|
|
EXTRA_EXAMPLES = examples/gif2webp examples/vwebp examples/webpmux \
|
2017-08-28 16:03:40 +02:00
|
|
|
examples/anim_diff examples/anim_dump \
|
|
|
|
examples/img2webp examples/webpinfo
|
2017-01-30 13:33:35 +01:00
|
|
|
OTHER_EXAMPLES = extras/get_disto extras/webp_quality extras/vwebp_sdl
|
2011-11-30 13:16:45 +01:00
|
|
|
|
2012-04-24 03:46:12 +02:00
|
|
|
OUTPUT = $(OUT_LIBS) $(OUT_EXAMPLES)
|
|
|
|
ifeq ($(MAKECMDGOALS),clean)
|
2016-07-20 21:55:05 +02:00
|
|
|
OUTPUT += $(EXTRA_EXAMPLES) $(OTHER_EXAMPLES)
|
2015-05-02 20:13:03 +02:00
|
|
|
OUTPUT += src/demux/libwebpdemux.a src/mux/libwebpmux.a $(EXTRA_LIB)
|
2015-05-02 01:11:49 +02:00
|
|
|
OUTPUT += examples/libgifdec.a examples/libanim_util.a
|
2012-04-24 03:46:12 +02:00
|
|
|
endif
|
2011-02-20 20:11:55 +01:00
|
|
|
|
2013-03-18 01:14:40 +01:00
|
|
|
ex: $(OUT_EXAMPLES)
|
2016-07-20 21:55:05 +02:00
|
|
|
all: ex $(EXTRA_EXAMPLES) $(OTHER_EXAMPLES)
|
2015-04-15 11:14:08 +02:00
|
|
|
extras: $(EXTRA_LIB)
|
2011-02-20 20:11:55 +01:00
|
|
|
|
2012-12-06 22:06:37 +01:00
|
|
|
$(EX_FORMAT_DEC_OBJS): %.o: %.h
|
|
|
|
|
2014-07-03 19:41:37 +02:00
|
|
|
# special dependencies:
|
2017-01-19 09:21:40 +01:00
|
|
|
# tree_dec.c/vp8_dec.c/bit_reader_utils.c <->
|
|
|
|
# bit_reader_inl_utils.h, endian_inl_utils.h
|
|
|
|
# bit_writer_utils.c <-> endian_inl_utils.h
|
|
|
|
src/dec/tree_dec.o: src/utils/bit_reader_inl_utils.h
|
|
|
|
src/dec/tree_dec.o: src/utils/endian_inl_utils.h
|
|
|
|
src/dec/vp8_dec.o: src/utils/bit_reader_inl_utils.h src/utils/endian_inl_utils.h
|
|
|
|
src/utils/bit_reader_utils.o: src/utils/bit_reader_inl_utils.h
|
|
|
|
src/utils/bit_reader_utils.o: src/utils/endian_inl_utils.h
|
|
|
|
src/utils/bit_writer_utils.o: src/utils/endian_inl_utils.h
|
2014-06-02 08:19:34 +02:00
|
|
|
|
2011-08-26 02:25:11 +02:00
|
|
|
%.o: %.c $(HDRS)
|
2017-09-04 06:13:33 +02:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
2011-02-20 20:11:55 +01:00
|
|
|
|
2015-05-02 01:11:49 +02:00
|
|
|
examples/libanim_util.a: $(ANIM_UTIL_OBJS)
|
2016-07-22 01:10:05 +02:00
|
|
|
examples/libexample_util.a: $(EX_UTIL_OBJS)
|
2015-01-14 00:43:31 +01:00
|
|
|
examples/libgifdec.a: $(GIFDEC_OBJS)
|
2016-07-20 00:23:08 +02:00
|
|
|
extras/libwebpextras.a: $(LIBWEBPEXTRA_OBJS)
|
2016-07-20 17:43:48 +02:00
|
|
|
imageio/libimagedec.a: $(EX_FORMAT_DEC_OBJS)
|
2016-09-07 07:46:31 +02:00
|
|
|
imageio/libimageenc.a: $(EX_FORMAT_ENC_OBJS)
|
2016-07-21 03:25:00 +02:00
|
|
|
imageio/libimageio_util.a: $(IMAGE_UTIL_OBJS)
|
2013-02-14 07:21:41 +01:00
|
|
|
src/libwebpdecoder.a: $(LIBWEBPDECODER_OBJS)
|
2012-04-12 21:00:43 +02:00
|
|
|
src/libwebp.a: $(LIBWEBP_OBJS)
|
|
|
|
src/mux/libwebpmux.a: $(LIBWEBPMUX_OBJS)
|
2012-11-19 20:21:37 +01:00
|
|
|
src/demux/libwebpdemux.a: $(LIBWEBPDEMUX_OBJS)
|
2022-08-04 17:56:59 +02:00
|
|
|
sharpyuv/libsharpyuv.a: $(LIBSHARPYUV_OBJS)
|
2012-05-12 01:00:57 +02:00
|
|
|
|
|
|
|
%.a:
|
2011-09-22 12:55:23 +02:00
|
|
|
$(AR) $(ARFLAGS) $@ $^
|
|
|
|
|
2015-05-02 01:11:49 +02:00
|
|
|
examples/anim_diff: examples/anim_diff.o $(ANIM_UTIL_OBJS) $(GIFDEC_OBJS)
|
2018-10-09 17:10:31 +02:00
|
|
|
examples/anim_dump: examples/anim_dump.o $(ANIM_UTIL_OBJS) $(GIFDEC_OBJS)
|
2016-05-31 06:45:38 +02:00
|
|
|
examples/cwebp: examples/cwebp.o
|
2012-05-12 01:00:57 +02:00
|
|
|
examples/dwebp: examples/dwebp.o
|
2015-01-14 00:43:31 +01:00
|
|
|
examples/gif2webp: examples/gif2webp.o $(GIFDEC_OBJS)
|
2012-05-12 01:00:57 +02:00
|
|
|
examples/vwebp: examples/vwebp.o
|
|
|
|
examples/webpmux: examples/webpmux.o
|
2016-12-02 11:44:17 +01:00
|
|
|
examples/img2webp: examples/img2webp.o
|
2017-03-14 10:00:43 +01:00
|
|
|
examples/webpinfo: examples/webpinfo.o
|
2012-05-12 01:00:57 +02:00
|
|
|
|
2015-05-02 01:11:49 +02:00
|
|
|
examples/anim_diff: examples/libanim_util.a examples/libgifdec.a
|
2016-07-22 01:10:05 +02:00
|
|
|
examples/anim_diff: src/demux/libwebpdemux.a examples/libexample_util.a
|
2016-07-21 03:25:00 +02:00
|
|
|
examples/anim_diff: imageio/libimageio_util.a src/libwebp.a
|
2022-08-04 17:56:59 +02:00
|
|
|
examples/anim_diff: sharpyuv/libsharpyuv.a
|
2019-07-02 04:49:18 +02:00
|
|
|
examples/anim_diff: override EXTRA_LIBS += $(GIF_LIBS)
|
2015-05-02 01:11:49 +02:00
|
|
|
examples/anim_diff: EXTRA_FLAGS += -DWEBP_HAVE_GIF
|
2018-10-09 17:10:31 +02:00
|
|
|
examples/anim_dump: examples/libanim_util.a examples/libgifdec.a
|
2017-08-28 16:03:40 +02:00
|
|
|
examples/anim_dump: src/demux/libwebpdemux.a
|
|
|
|
examples/anim_dump: examples/libexample_util.a
|
|
|
|
examples/anim_dump: imageio/libimageio_util.a
|
|
|
|
examples/anim_dump: imageio/libimageenc.a
|
|
|
|
examples/anim_dump: src/libwebp.a
|
2022-08-04 17:56:59 +02:00
|
|
|
examples/anim_dump: sharpyuv/libsharpyuv.a
|
2019-07-02 04:49:18 +02:00
|
|
|
examples/anim_dump: override EXTRA_LIBS += $(GIF_LIBS) $(DWEBP_LIBS)
|
2016-08-17 21:37:53 +02:00
|
|
|
examples/cwebp: examples/libexample_util.a
|
|
|
|
examples/cwebp: imageio/libimagedec.a
|
2017-03-02 17:45:42 +01:00
|
|
|
examples/cwebp: src/demux/libwebpdemux.a
|
2016-08-17 21:37:53 +02:00
|
|
|
examples/cwebp: imageio/libimageio_util.a
|
|
|
|
examples/cwebp: src/libwebp.a
|
2022-08-04 17:56:59 +02:00
|
|
|
examples/cwebp: sharpyuv/libsharpyuv.a
|
2019-07-02 04:49:18 +02:00
|
|
|
examples/cwebp: override EXTRA_LIBS += $(CWEBP_LIBS)
|
2016-08-17 21:37:53 +02:00
|
|
|
examples/dwebp: examples/libexample_util.a
|
|
|
|
examples/dwebp: imageio/libimagedec.a
|
2017-03-02 17:45:42 +01:00
|
|
|
examples/dwebp: src/demux/libwebpdemux.a
|
2016-09-07 07:46:31 +02:00
|
|
|
examples/dwebp: imageio/libimageenc.a
|
2016-08-17 21:37:53 +02:00
|
|
|
examples/dwebp: imageio/libimageio_util.a
|
|
|
|
examples/dwebp: src/libwebp.a
|
2022-08-04 17:56:59 +02:00
|
|
|
examples/dwebp: sharpyuv/libsharpyuv.a
|
2019-07-02 04:49:18 +02:00
|
|
|
examples/dwebp: override EXTRA_LIBS += $(DWEBP_LIBS)
|
2016-07-22 01:10:05 +02:00
|
|
|
examples/gif2webp: examples/libexample_util.a imageio/libimageio_util.a
|
2016-07-21 03:25:00 +02:00
|
|
|
examples/gif2webp: examples/libgifdec.a src/mux/libwebpmux.a src/libwebp.a
|
2022-08-04 17:56:59 +02:00
|
|
|
examples/gif2webp: sharpyuv/libsharpyuv.a
|
2019-07-02 04:49:18 +02:00
|
|
|
examples/gif2webp: override EXTRA_LIBS += $(GIF_LIBS)
|
2013-09-12 13:03:51 +02:00
|
|
|
examples/gif2webp: EXTRA_FLAGS += -DWEBP_HAVE_GIF
|
2016-07-22 01:10:05 +02:00
|
|
|
examples/vwebp: examples/libexample_util.a src/demux/libwebpdemux.a
|
2016-07-21 03:25:00 +02:00
|
|
|
examples/vwebp: imageio/libimageio_util.a src/libwebp.a
|
2022-08-04 17:56:59 +02:00
|
|
|
examples/vwebp: sharpyuv/libsharpyuv.a
|
2019-07-02 04:49:18 +02:00
|
|
|
examples/vwebp: override EXTRA_LIBS += $(GL_LIBS)
|
2013-09-12 13:03:51 +02:00
|
|
|
examples/vwebp: EXTRA_FLAGS += -DWEBP_HAVE_GL
|
2016-07-22 01:10:05 +02:00
|
|
|
examples/webpmux: examples/libexample_util.a imageio/libimageio_util.a
|
2016-07-21 03:25:00 +02:00
|
|
|
examples/webpmux: src/mux/libwebpmux.a src/libwebpdecoder.a
|
2016-12-02 11:44:17 +01:00
|
|
|
examples/img2webp: examples/libexample_util.a imageio/libimageio_util.a
|
|
|
|
examples/img2webp: imageio/libimagedec.a
|
2017-03-02 17:45:42 +01:00
|
|
|
examples/img2webp: src/demux/libwebpdemux.a
|
2022-08-04 17:56:59 +02:00
|
|
|
examples/img2webp: src/mux/libwebpmux.a
|
|
|
|
examples/img2webp: src/libwebp.a
|
|
|
|
examples/img2webp: sharpyuv/libsharpyuv.a
|
2019-07-02 04:49:18 +02:00
|
|
|
examples/img2webp: override EXTRA_LIBS += $(CWEBP_LIBS)
|
2017-03-14 10:00:43 +01:00
|
|
|
examples/webpinfo: examples/libexample_util.a imageio/libimageio_util.a
|
|
|
|
examples/webpinfo: src/libwebpdecoder.a
|
2011-11-30 13:16:45 +01:00
|
|
|
|
2016-07-20 17:43:48 +02:00
|
|
|
extras/get_disto: extras/get_disto.o
|
2017-03-02 17:45:42 +01:00
|
|
|
extras/get_disto: imageio/libimagedec.a
|
|
|
|
extras/get_disto: src/demux/libwebpdemux.a
|
|
|
|
extras/get_disto: imageio/libimageio_util.a
|
|
|
|
extras/get_disto: src/libwebp.a
|
2022-08-04 17:56:59 +02:00
|
|
|
extras/get_disto: sharpyuv/libsharpyuv.a
|
2019-07-02 04:49:18 +02:00
|
|
|
extras/get_disto: override EXTRA_LIBS += $(CWEBP_LIBS)
|
2016-07-20 17:43:48 +02:00
|
|
|
|
2016-07-20 21:55:05 +02:00
|
|
|
extras/webp_quality: extras/webp_quality.o
|
2016-07-21 03:25:00 +02:00
|
|
|
extras/webp_quality: imageio/libimageio_util.a
|
2016-07-22 09:02:17 +02:00
|
|
|
extras/webp_quality: $(EXTRA_LIB) src/libwebp.a
|
2022-08-04 17:56:59 +02:00
|
|
|
extras/webp_quality: sharpyuv/libsharpyuv.a
|
2016-07-20 21:55:05 +02:00
|
|
|
|
2017-01-30 13:33:35 +01:00
|
|
|
extras/vwebp_sdl: extras/vwebp_sdl.o
|
|
|
|
extras/vwebp_sdl: extras/webp_to_sdl.o
|
|
|
|
extras/vwebp_sdl: imageio/libimageio_util.a
|
|
|
|
extras/vwebp_sdl: src/libwebp.a
|
2022-08-04 17:56:59 +02:00
|
|
|
extras/vwebp_sdl: sharpyuv/libsharpyuv.a
|
2017-09-04 06:25:31 +02:00
|
|
|
extras/vwebp_sdl: EXTRA_FLAGS += -DWEBP_HAVE_SDL $(SDL_FLAGS)
|
2019-07-02 04:49:18 +02:00
|
|
|
extras/vwebp_sdl: override EXTRA_LIBS += $(SDL_LIBS)
|
2017-01-30 13:33:35 +01:00
|
|
|
|
2016-07-20 21:55:05 +02:00
|
|
|
$(OUT_EXAMPLES) $(EXTRA_EXAMPLES) $(OTHER_EXAMPLES):
|
2011-08-26 02:25:11 +02:00
|
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
2011-02-20 20:11:55 +01:00
|
|
|
|
2011-08-26 03:33:28 +02:00
|
|
|
dist: DESTDIR := dist
|
2013-03-18 01:14:40 +01:00
|
|
|
dist: OUT_EXAMPLES += $(EXTRA_EXAMPLES)
|
2011-08-26 03:33:28 +02:00
|
|
|
dist: all
|
2011-08-30 22:44:03 +02:00
|
|
|
$(INSTALL) -m755 -d $(DESTDIR)/include/webp \
|
2022-08-04 17:56:59 +02:00
|
|
|
$(DESTDIR)/include/webp/sharpyuv \
|
|
|
|
$(DESTDIR)/bin $(DESTDIR)/doc $(DESTDIR)/lib
|
2013-12-07 05:40:12 +01:00
|
|
|
$(INSTALL) -m755 -s $(OUT_EXAMPLES) $(DESTDIR)/bin
|
2012-07-17 00:45:30 +02:00
|
|
|
$(INSTALL) -m644 $(HDRS_INSTALLED) $(DESTDIR)/include/webp
|
2022-08-04 17:56:59 +02:00
|
|
|
$(INSTALL) -m644 $(SHARPYUV_HDRS_INSTALLED) $(DESTDIR)/include/webp/sharpyuv
|
2011-08-26 03:33:28 +02:00
|
|
|
$(INSTALL) -m644 src/libwebp.a $(DESTDIR)/lib
|
2013-03-18 01:14:40 +01:00
|
|
|
$(INSTALL) -m644 src/demux/libwebpdemux.a $(DESTDIR)/lib
|
|
|
|
$(INSTALL) -m644 src/mux/libwebpmux.a $(DESTDIR)/lib
|
2022-08-04 17:56:59 +02:00
|
|
|
$(INSTALL) -m644 sharpyuv/libsharpyuv.a $(DESTDIR)/lib
|
2011-08-30 22:44:03 +02:00
|
|
|
umask 022; \
|
2016-12-02 11:44:17 +01:00
|
|
|
for m in man/[cdv]webp.1 man/gif2webp.1 man/webpmux.1 \
|
2017-05-10 01:12:34 +02:00
|
|
|
man/img2webp.1 man/webpinfo.1; do \
|
2011-08-30 22:44:03 +02:00
|
|
|
basenam=$$(basename $$m .1); \
|
2018-04-03 21:55:01 +02:00
|
|
|
$(GROFF) -t -e -man -T ascii $$m \
|
2011-11-30 13:16:45 +01:00
|
|
|
| $(COL) -bx >$(DESTDIR)/doc/$${basenam}.txt; \
|
|
|
|
$(GROFF) -t -e -man -T html $$m \
|
|
|
|
| $(COL) -bx >$(DESTDIR)/doc/$${basenam}.html; \
|
2011-08-30 22:44:03 +02:00
|
|
|
done
|
2011-08-26 03:33:28 +02:00
|
|
|
|
2011-02-20 20:11:55 +01:00
|
|
|
clean:
|
2012-01-25 02:54:49 +01:00
|
|
|
$(RM) $(OUTPUT) *~ \
|
|
|
|
examples/*.o examples/*~ \
|
2016-07-20 00:23:08 +02:00
|
|
|
extras/*.o extras/*~ \
|
2016-07-20 01:02:55 +02:00
|
|
|
imageio/*.o imageio/*~ \
|
2022-07-05 19:41:14 +02:00
|
|
|
sharpyuv/*.o sharpyuv/*~ \
|
2011-02-20 20:11:55 +01:00
|
|
|
src/dec/*.o src/dec/*~ \
|
2012-11-19 20:21:37 +01:00
|
|
|
src/demux/*.o src/demux/*~ \
|
2011-09-02 23:30:08 +02:00
|
|
|
src/dsp/*.o src/dsp/*~ \
|
2012-01-25 02:54:49 +01:00
|
|
|
src/enc/*.o src/enc/*~ \
|
2011-09-22 12:55:23 +02:00
|
|
|
src/mux/*.o src/mux/*~ \
|
2012-01-25 02:54:49 +01:00
|
|
|
src/utils/*.o src/utils/*~ \
|
2012-01-06 07:38:05 +01:00
|
|
|
src/webp/*~ man/*~ doc/*~ swig/*~ \
|
2011-03-29 19:46:36 +02:00
|
|
|
|
2015-05-02 20:15:34 +02:00
|
|
|
.PHONY: all clean dist ex
|
2011-08-26 02:25:11 +02:00
|
|
|
.SUFFIXES:
|