comparison Makefile @ 2:bb21eb1cd483

Use pkg-config.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 07 Dec 2016 10:17:53 +0200
parents 772086c29cc7
children bbd61622856a
comparison
equal deleted inserted replaced
1:c04221f4d596 2:bb21eb1cd483
7 # Enable x265 for the encoder 7 # Enable x265 for the encoder
8 USE_X265=y 8 USE_X265=y
9 # Enable the JCTVC code (best quality but slow) for the encoder 9 # Enable the JCTVC code (best quality but slow) for the encoder
10 #USE_JCTVC=y 10 #USE_JCTVC=y
11 # Compile bpgview (SDL and SDL_image libraries needed) 11 # Compile bpgview (SDL and SDL_image libraries needed)
12
12 USE_BPGVIEW=y 13 USE_BPGVIEW=y
13 # Enable it to use bit depths > 12 (need more tests to validate encoder) 14 # Enable it to use bit depths > 12 (need more tests to validate encoder)
14 #USE_JCTVC_HIGH_BIT_DEPTH=y 15 #USE_JCTVC_HIGH_BIT_DEPTH=y
15 # Enable the cross compilation for Windows 16 # Enable the cross compilation for Windows
16 #CONFIG_WIN32=y 17 #CONFIG_WIN32=y
36 AR=$(CROSS_PREFIX)ar 37 AR=$(CROSS_PREFIX)ar
37 EMCC=emcc 38 EMCC=emcc
38 39
39 PWD:=$(shell pwd) 40 PWD:=$(shell pwd)
40 41
42 LIBSDL_CFLAGS:=$(shell pkg-config --cflags sdl)
43 LIBSDL_LDFLAGS:=$(shell pkg-config --libs sdl) -lSDL_image
44
45 LIBPNG_CFLAGS:=$(shell pkg-config --cflags libpng)
46 LIBPNG_LDFLAGS:=$(shell pkg-config --libs libpng)
47
48 LIBJPEG_CFLAGS:=$(shell pkg-config --cflags libjpeg)
49 LIBJPEG_LDFLAGS:=$(shell pkg-config --libs libjpeg)
50
41 CFLAGS:=-Os -Wall -MMD -fno-asynchronous-unwind-tables -fdata-sections -ffunction-sections -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -fomit-frame-pointer 51 CFLAGS:=-Os -Wall -MMD -fno-asynchronous-unwind-tables -fdata-sections -ffunction-sections -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -fomit-frame-pointer
42 CFLAGS+=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT 52 CFLAGS+=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT
43 CFLAGS+=-I. 53 CFLAGS+=-I. $(LIBSDL_CFLAGS) $(LIBPNG_CFLAGS) $(LIBJPEG_CFLAGS)
44 CFLAGS+=-DCONFIG_BPG_VERSION=\"$(shell cat VERSION)\" 54 CFLAGS+=-DCONFIG_BPG_VERSION=\"$(shell cat VERSION)\"
45 ifdef USE_JCTVC_HIGH_BIT_DEPTH 55 ifdef USE_JCTVC_HIGH_BIT_DEPTH
46 CFLAGS+=-DRExt__HIGH_BIT_DEPTH_SUPPORT 56 CFLAGS+=-DRExt__HIGH_BIT_DEPTH_SUPPORT
47 endif 57 endif
48 58
175 ifdef CONFIG_APPLE 185 ifdef CONFIG_APPLE
176 LIBS:= 186 LIBS:=
177 else 187 else
178 LIBS:=-lrt 188 LIBS:=-lrt
179 endif # !CONFIG_APPLE 189 endif # !CONFIG_APPLE
190
180 LIBS+=-lm -lpthread 191 LIBS+=-lm -lpthread
181 192 BPGDEC_LIBS:=$(LIBPNG_LDFLAGS) $(LIBS)
182 BPGDEC_LIBS:=-lpng $(LIBS) 193 BPGENC_LIBS+=$(LIBPNG_LDFLAGS) $(LIBJPEG_LDFLAGS) $(LIBS)
183 BPGENC_LIBS+=-lpng -ljpeg $(LIBS) 194 BPGVIEW_LIBS:=$(LIBSDL_LDFLAGS) $(LIBS)
184 BPGVIEW_LIBS:=-lSDL_image -lSDL $(LIBS)
185 195
186 endif #!CONFIG_WIN32 196 endif #!CONFIG_WIN32
187 197
188 bpgenc.o: CFLAGS+=-Wno-unused-but-set-variable 198 bpgenc.o: CFLAGS+=-Wno-unused-but-set-variable
189 199