Files
libgstnvcustomhelper/gst-nvcustomhelper/Makefile.public
svcmobrel-release 367ef2611f Updating prebuilts and/or headers
58763dce79c555646e8fe2a3c82b99cd73e45726 - gst-nvcustomhelper/Makefile
1d05e15078ee65457a1e033a35ff53969b49dbae - gst-nvcustomhelper/LICENSE.libgstnvcustomhelper
6911bbbbdf879f293204b444447b7c248e713bba - gst-nvcustomhelper/gst-nvcustomevent.c
8f8291f190852841a376cfbf0b5d56f5965913cd - gst-nvcustomhelper/Makefile.public
39d54795c60e7436359259ede5ee6537a11b3fcc - gst-nvcustomhelper/README
d27a433ddeaefb9f42d0312c23472514b0cd6a45 - gst-nvcustomhelper/gst-nvcustomevent.h

Change-Id: I90c527be6c5be4b2ad7e68b47ec878a0f1176cd8
2024-05-02 11:24:18 -07:00

68 lines
2.3 KiB
Makefile

################################################################################
# SPDX-FileCopyrightText: Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: MIT
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
################################################################################
CXX:= gcc
SRCS:= gst-nvcustomevent.c
INCS:= $(wildcard *.h)
OUT_DIR ?= .
SO_NAME := libgstnvcustomhelper.so
LIB:= $(OUT_DIR)/$(SO_NAME)
OBJS := $(SRCS:%.c=$(OUT_DIR)/%.o)
TARGET_DEVICE = $(shell gcc -dumpmachine | cut -f1 -d -)
ifeq ($(TARGET_DEVICE),aarch64)
LIB_INSTALL_DIR?=/usr/lib/aarch64-linux-gnu/tegra/
CFLAGS:=
else
NVDS_VERSION ?=7.0
LIB_INSTALL_DIR ?=/opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/lib/
CFLAGS:= -DDS_VERSION=\"7.0.0\"
endif
CFLAGS+= -fPIC
LIBS := -shared -Wl,-no-undefined
LIBS+= -L$(LIB_INSTALL_DIR) -ldl\
-Wl,-rpath,$(LIB_INSTALL_DIR)
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)
$(OUT_DIR)/%.o: %.c $(INCS) Makefile
@echo $(CFLAGS)
$(CXX) -c -o $@ $(CFLAGS) $<
$(LIB): $(OBJS) Makefile
$(CXX) -o $@ $(OBJS) $(LIBS)
install: $(LIB)
cp -rv $(LIB) $(LIB_INSTALL_DIR)
clean:
rm -rf $(OBJS) $(LIB)