sdk-hwV1.3/external/eyesee-mpp/middleware/sun8iw21/media/LIBRARY/libcedarx/config/tina.mk

106 lines
3.5 KiB
Makefile
Raw Normal View History

2024-05-07 10:09:20 +00:00
# Makefile for eyesee-mpp/middleware/media/LIBRARY/libcedarx/config
CUR_PATH := .
PACKAGE_TOP := ../../../..
EYESEE_MPP_INCLUDE:=$(STAGING_DIR)/usr/include/eyesee-mpp
EYESEE_MPP_LIBDIR:=$(STAGING_DIR)/usr/lib/eyesee-mpp
# STAGING_DIR is exported in rules.mk, so it can be used directly here.
# STAGING_DIR:=.../tina-v316/out/v316-perfnor/staging_dir/target
include $(PACKAGE_TOP)/config/mpp_config.mk
CEDARM_PATH=$(CUR_PATH)/..
include $(CEDARM_PATH)/config.mk
#set source files here.
SRCCS :=
#include directories
INCLUDE_DIRS :=
LOCAL_SHARED_LIBS :=
LOCAL_STATIC_LIBS :=
# TARGET_BOARD_PLATFORM is exported in middleware's package Makefile, so it can be used here.
product:=$(TARGET_BOARD_PLATFORM)
ifneq ($(filter $(product),v316 v536 v313 v533 v833 v831 v853 v853s r853s v851s v851se v837s qg3101 v851s3 v553),)
product:=v316
endif
LOCAL_CONF_FILE := $(if $(product),$(product)_cedarx.conf,)
$(warning You have selected $(LOCAL_CONF_FILE))
#set dst file name: shared library, static library, execute bin.
LOCAL_TARGET_DYNAMIC :=
LOCAL_TARGET_STATIC :=
LOCAL_TARGET_BIN :=
LOCAL_TARGET_CONF_FILE := cedarx.conf
#generate include directory flags for gcc.
inc_paths := $(foreach inc,$(filter-out -I%,$(INCLUDE_DIRS)),$(addprefix -I, $(inc))) \
$(filter -I%, $(INCLUDE_DIRS))
#Extra flags to give to the C compiler
LOCAL_CFLAGS := $(CFLAGS) $(inc_paths) -fPIC -Wall
#Extra flags to give to the C++ compiler
LOCAL_CXXFLAGS := $(CXXFLAGS) $(inc_paths) -fPIC -Wall
#Extra flags to give to the C preprocessor and programs that use it (the C and Fortran compilers).
LOCAL_CPPFLAGS := $(CPPFLAGS)
#target device arch: x86, arm
LOCAL_TARGET_ARCH := $(ARCH)
#Extra flags to give to compilers when they are supposed to invoke the linker,ld.
LOCAL_LDFLAGS := $(LDFLAGS)
LOCAL_DYNAMIC_LDFLAGS := $(LOCAL_LDFLAGS) -shared \
-L $(EYESEE_MPP_LIBDIR) \
-Wl,-Bstatic \
-Wl,--start-group $(foreach n, $(LOCAL_STATIC_LIBS), -l$(patsubst lib%,%,$(patsubst %.a,%,$(notdir $(n))))) -Wl,--end-group \
-Wl,-Bdynamic \
$(foreach y, $(LOCAL_SHARED_LIBS), -l$(patsubst lib%,%,$(patsubst %.so,%,$(notdir $(y)))))
#generate object files
OBJS := $(SRCCS:%=%.o) #OBJS=$(patsubst %,%.o,$(SRCCS))
#add dynamic lib name suffix and static lib name suffix.
target_dynamic := $(if $(LOCAL_TARGET_DYNAMIC),$(LOCAL_TARGET_DYNAMIC).so,)
target_static := $(if $(LOCAL_TARGET_STATIC),$(LOCAL_TARGET_STATIC).a,)
#generate exe file.
.PHONY: all
all: $(target_dynamic) $(target_static)
if [ -n "$(LOCAL_CONF_FILE)" ]; then \
mkdir -p $(CUR_PATH)/out; \
cp -f $(LOCAL_CONF_FILE) $(CUR_PATH)/out/$(LOCAL_TARGET_CONF_FILE); \
fi
@echo ===================================
@echo build eyesee-mpp-middleware-media-LIBRARY-libcedarx-config done
@echo ===================================
$(target_dynamic): $(OBJS)
$(CXX) $+ $(LOCAL_DYNAMIC_LDFLAGS) -o $@
@echo ----------------------------
@echo "finish target: $@"
# @echo "object files: $+"
# @echo "source files: $(SRCCS)"
@echo ----------------------------
$(target_static): $(OBJS)
$(AR) -rcs -o $@ $+
@echo ----------------------------
@echo "finish target: $@"
# @echo "object files: $+"
# @echo "source files: $(SRCCS)"
@echo ----------------------------
#patten rules to generate local object files
%.cpp.o: %.cpp
$(CXX) $(LOCAL_CXXFLAGS) $(LOCAL_CPPFLAGS) -c -o $@ $<
%.cc.o: %.cc
$(CXX) $(LOCAL_CXXFLAGS) $(LOCAL_CPPFLAGS) -c -o $@ $<
%.c.o: %.c
$(CC) $(LOCAL_CFLAGS) $(LOCAL_CPPFLAGS) -c -o $@ $<
# clean all
.PHONY: clean
clean:
-rm -f $(OBJS) $(target_dynamic) $(target_static)
-rm -rf $(CUR_PATH)/out