build.param 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ##
  2. # Copyright (C) 2021 Alibaba Group Holding Limited
  3. # Author: LuChongzhi <chongzhi.lcz@alibaba-inc.com>
  4. #
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License version 2 as
  7. # published by the Free Software Foundation.
  8. ##
  9. BUILD_LOG_START="\n\033[47;30m>>> $(MODULE_NAME) $@ begin >>>\033[0m"
  10. BUILD_LOG_END ="\033[47;30m<<< $(MODULE_NAME) $@ end <<<\033[0m"
  11. PLATFORM ?= simulator
  12. ROOT_DIR=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
  13. SO_LIB_DIR=lib_so
  14. ifeq ($(PLATFORM),simulator)
  15. CFLAGS := -O0 -g -Werror -fPIC -DPLATFORM_SIMULATOR
  16. else
  17. CFLAGS := -O2 -g -Werror -fPIC
  18. endif
  19. LFLAGS := -no-pie
  20. LIBS := -L$(ROOT_DIR)/output/common \
  21. -L$(ROOT_DIR)/output/hal
  22. ifeq ($(PLATFORM),light)
  23. INCLUDE := -I$(ROOT_DIR)/include/common \
  24. -I$(ROOT_DIR)/include/hal \
  25. -I$(ROOT_DIR)/include/lib_camera \
  26. -I$(ROOT_DIR)/src/lib_camera/camera_action/include\
  27. -I$(ROOT_DIR)/examples/camera/camera_demo3_srcs \
  28. -I$(ROOT_DIR)/src/lib_camera \
  29. -I$(ROOT_DIR)/../recipe-sysroot/usr/include/csi_hal/
  30. else
  31. INCLUDE := -I$(ROOT_DIR)/include/common \
  32. -I$(ROOT_DIR)/include/hal \
  33. -I$(ROOT_DIR)/include/lib_camera \
  34. -I$(ROOT_DIR)/src/lib_camera/camera_action/include
  35. endif
  36. ifeq ($(PLATFORM),simulator)
  37. CC := gcc
  38. CXX := g++
  39. CPP := g++
  40. AR := ar
  41. LD := ld
  42. RAN := ranlib
  43. LIBOPENCV_INC = $(shell pkg-config --cflags opencv)
  44. LIBOPENCV_LIBS = $(shell pkg-config --libs opencv)
  45. else ifeq ($(PLATFORM),light)
  46. # PARAM_FILE = ../.param
  47. # -include $(PARAM_FILE)
  48. test = $(shell if [ -f "../.param" ]; then echo "exist"; else echo "noexist"; fi)
  49. ifeq ("$(test)", "exist")
  50. -include ../.param
  51. endif
  52. else
  53. $(error PLATFORM undefined)
  54. endif