gst-nvdsosd-plugin/Makefile
nqthai199@gmail.com 1a8e32d6d3 init
2022-07-14 11:21:33 +07:00

68 lines
1.8 KiB
Makefile
Executable File

################################################################################
# Copyright (c) 2017-2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA Corporation and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA Corporation is strictly prohibited.
#################################################################################
CUDA_VER?=
ifeq ($(CUDA_VER),)
$(error "CUDA_VER is not set")
endif
CXX:= g++
SRCS:= gstnvdsosd.c
INCS:= gstnvdsosd.h
INCS+=httplib.h
INCS+=json.hpp
LIB:=libnvdsgst_osd.so
TARGET_DEVICE = $(shell gcc -dumpmachine | cut -f1 -d -)
NVDS_VERSION:=6.0
GST_INSTALL_DIR?=/opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/lib/gst-plugins/
LIB_INSTALL_DIR?=/opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/lib/
CFLAGS+= -fPIC -DDS_VERSION=\"6.0.1\" \
-I../../includes \
-I/usr/local/cuda-$(CUDA_VER)/include \
-I ./
ifeq ($(TARGET_DEVICE),aarch64)
CFLAGS+= -DPLATFORM_TEGRA
endif
LIBS := -shared -Wl,-no-undefined \
-L/usr/local/cuda-$(CUDA_VER)/lib64/ -lcudart
LIBS+= -L$(LIB_INSTALL_DIR) -lnvdsgst_helper -lnvdsgst_meta -lnvds_meta \
-lnvds_osd -lnvbufsurface -lnvbufsurftransform -ldl -lpthread \
-Wl,-rpath,$(LIB_INSTALL_DIR)
OBJS:= $(SRCS:.c=.o)
PKGS:= gstreamer-1.0 gstreamer-base-1.0 gstreamer-video-1.0
CFLAGS+= $(shell pkg-config --cflags $(PKGS))
LIBS+= $(shell pkg-config --libs $(PKGS))
all: $(LIB)
%.o: %.c $(INCS) Makefile
@echo $(CFLAGS)
$(CXX) -c -o $@ $(CFLAGS) $<
$(LIB): $(OBJS) $(DEP) Makefile
$(CXX) -o $@ $(OBJS) $(LIBS)
install: $(LIB)
cp -rv $(LIB) $(GST_INSTALL_DIR)
clean:
rm -rf $(OBJS) $(LIB)