-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile_codec
executable file
·61 lines (44 loc) · 1.67 KB
/
Makefile_codec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
CC = $(CROSS_COMPILE)gcc --sysroot=$(SDKTARGETSYSROOT)
AR = $(CROSS_COMPILE)ar
CFLAGS ?= -O2
SOURCE_ROOT = decoder_sw/software
OMX_SRC_ROOT = openmax_il/source
INCLUDE_HEADERS = -I$(OMX_SRC_ROOT) -I$(OMX_SRC_ROOT)/../headers/ -I$(OMX_SRC_ROOT)/decoder -I$(SOURCE_ROOT)/source/inc/
LIBS = -L./ -lhantro -lg1 -lpthread
CFLAGS += -DSET_OUTPUT_CROP_RECT -DUSE_EXTERNAL_BUFFER -DUSE_OUTPUT_RELEASE -DVSI_API -DIS_G1_DECODER -DENABLE_CODEC_VP8 -DVP8_HWTIMEOUT_WORKAROUND -DENABLE_CODEC_MJPEG -DGET_FREE_BUFFER_NON_BLOCK -DDOWN_SCALER
CFLAGS += $(INCLUDE_HEADERS)
OBJ = $(OMX_SRC_ROOT)/decoder/codec_hevc.o \
$(OMX_SRC_ROOT)/decoder/codec_vp9.o \
$(OMX_SRC_ROOT)/decoder/codec_h264.o \
$(OMX_SRC_ROOT)/decoder/codec_avs.o \
$(OMX_SRC_ROOT)/decoder/codec_jpeg.o \
$(OMX_SRC_ROOT)/decoder/codec_mpeg2.o \
$(OMX_SRC_ROOT)/decoder/codec_mpeg4.o \
$(OMX_SRC_ROOT)/decoder/codec_rv.o \
$(OMX_SRC_ROOT)/decoder/codec_vc1.o \
$(OMX_SRC_ROOT)/decoder/codec_vp6.o \
$(OMX_SRC_ROOT)/decoder/codec_vp8.o \
$(OMX_SRC_ROOT)/decoder/codec_webp.o \
$(OMX_SRC_ROOT)/decoder/test/queue.o \
$(OMX_SRC_ROOT)/OSAL.o
LIBNAME = libcodec
SONAMEVERSION = 1
VERSION = imx8mq
all: $(LIBNAME).so $(LIBNAME).a
install: install_headers
@mkdir -p $(DEST_DIR)/usr/lib
cp -P $(LIBNAME).* $(DEST_DIR)/usr/lib
install_headers:
@mkdir -p $(DEST_DIR)/usr/include
cp $(OMX_SRC_ROOT)/*.h $(DEST_DIR)/usr/include
%.o: %.c
$(CC) -Wall -fPIC $(CFLAGS) -c $^ -o $@
$(LIBNAME).so.$(SONAMEVERSION): $(OBJ)
$(CC) -shared -nostartfiles -Wl,-soname,$@ $^ -o $@ $(LDFLAGS) $(LIBS)
$(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
ln -s $< $@
$(LIBNAME).a: $(OBJ)
$(AR) -rc $@ $^
.PHONY: clean
clean:
rm -f $(LIBNAME).* $(OBJ)