Makefile 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. ################################################################################
  2. # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
  3. #
  4. # Permission is hereby granted, free of charge, to any person obtaining a
  5. # copy of this software and associated documentation files (the "Software"),
  6. # to deal in the Software without restriction, including without limitation
  7. # the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. # and/or sell copies of the Software, and to permit persons to whom the
  9. # Software is furnished to do so, subject to the following conditions:
  10. #
  11. # The above copyright notice and this permission notice shall be included in
  12. # all copies or substantial portions of the Software.
  13. #
  14. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. # DEALINGS IN THE SOFTWARE.
  21. ################################################################################
  22. APP:= deepstream-test5-analytics
  23. TARGET_DEVICE = $(shell gcc -dumpmachine | cut -f1 -d -)
  24. NVDS_VERSION:=5.0
  25. LIB_INSTALL_DIR?=/opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/lib/
  26. APP_INSTALL_DIR?=/opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/bin/
  27. ifeq ($(TARGET_DEVICE),aarch64)
  28. CFLAGS:= -DPLATFORM_TEGRA
  29. endif
  30. SRCS:= deepstream_test5_app_main.c
  31. SRCS+= ../deepstream-test5/deepstream_utc.c
  32. SRCS+= ../deepstream-app/deepstream_app.c ../deepstream-app/deepstream_app_config_parser.c
  33. SRCS+= $(wildcard ../../apps-common/src/*.c)
  34. INCS= $(wildcard *.h)
  35. INC_DIR=../deepstream-test5
  36. PKGS:= gstreamer-1.0 gstreamer-video-1.0 x11 json-glib-1.0
  37. OBJS:= $(SRCS:.c=.o)
  38. OBJS+= deepstream_nvdsanalytics_meta.o
  39. CFLAGS+= -I../../apps-common/includes -I./includes -I../../../includes -I../deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5
  40. CFLAGS+= -I$(INC_DIR)
  41. LIBS+= -L$(LIB_INSTALL_DIR) -lnvdsgst_meta -lnvds_meta -lnvdsgst_helper -lnvdsgst_smartrecord -lnvds_utils -lnvds_msgbroker -lm \
  42. -lgstrtspserver-1.0 -ldl -Wl,-rpath,$(LIB_INSTALL_DIR)
  43. CFLAGS+= `pkg-config --cflags $(PKGS)`
  44. LIBS+= `pkg-config --libs $(PKGS)`
  45. all: $(APP)
  46. deepstream_nvdsanalytics_meta.o: deepstream_nvdsanalytics_meta.cpp $(INCS) Makefile
  47. $(CXX) -c -o $@ -Wall -Werror $(CFLAGS) $<
  48. %.o: %.c $(INCS) Makefile
  49. $(CC) -c -o $@ $(CFLAGS) $<
  50. $(APP): $(OBJS) Makefile
  51. $(CXX) -o $(APP) $(OBJS) $(LIBS)
  52. install: $(APP)
  53. cp -rv $(APP) $(APP_INSTALL_DIR)
  54. clean:
  55. rm -rf $(OBJS) $(APP)