Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ###############################################################################
  2. #
  3. # Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
  4. #
  5. # Redistribution and use in source and binary forms, with or without
  6. # modification, are permitted provided that the following conditions
  7. # are met:
  8. # * Redistributions of source code must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. # * Redistributions in binary form must reproduce the above copyright
  11. # notice, this list of conditions and the following disclaimer in the
  12. # documentation and/or other materials provided with the distribution.
  13. # * Neither the name of NVIDIA CORPORATION nor the names of its
  14. # contributors may be used to endorse or promote products derived
  15. # from this software without specific prior written permission.
  16. #
  17. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
  18. # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  20. # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  21. # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  22. # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  23. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  24. # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  25. # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  27. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. #
  29. ###############################################################################
  30. include ../../Rules.mk
  31. APP := cameras_egl_demo
  32. SRCS := \
  33. camera_v4l2_cuda.cpp \
  34. $(wildcard $(NV_CLASS_DIR)/*.cpp)
  35. OBJS := $(SRCS:.cpp=.o)
  36. #OBJS := $(notdir $(OBJS))
  37. OBJS += \
  38. $(ALGO_CUDA_DIR)/NvAnalysis.o \
  39. $(ALGO_CUDA_DIR)/NvCudaProc.o
  40. all: $(APP)
  41. $(NV_CLASS_DIR)/%.o: $(NV_CLASS_DIR)/%.cpp
  42. $(AT)$(MAKE) -C $(NV_CLASS_DIR)
  43. $(ALGO_CUDA_DIR)/%.o: $(ALGO_CUDA_DIR)/%.cpp
  44. $(AT)$(MAKE) -C $(ALGO_CUDA_DIR)
  45. $(ALGO_CUDA_DIR)/%.o: $(ALGO_CUDA_DIR)/%.cu
  46. $(AT)$(MAKE) -C $(ALGO_CUDA_DIR)
  47. %.o: %.cpp
  48. @echo "Compiling: $<"
  49. $(CPP) $(CPPFLAGS) -c $<
  50. $(APP): $(OBJS)
  51. @echo "Linking: $@"
  52. $(CPP) -o $@ $(OBJS) $(CPPFLAGS) $(LDFLAGS)
  53. @mkdir -p $(TOP_DIR)/bin
  54. @cp -rf $(APP) $(TOP_DIR)/bin
  55. clean:
  56. $(AT)rm -rf $(APP) $(OBJS)
  57. $(AT)rm -rf *.o