internal_make_funcs.mk 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. define CompLib_Map
  2. $(eval \
  3. COMP_LIB_COMPONENTS += \
  4. $(if \
  5. $(filter y,$(FEATURE_$(strip $(1)))),$(strip $(2)) \
  6. ) \
  7. )
  8. endef
  9. define CompInc_Map
  10. $(eval \
  11. COMP_LIB_COMPONENTS_INCLUDES += \
  12. $(if \
  13. $(filter y,$(FEATURE_$(strip $(1)))),$(strip $(2)) \
  14. ) \
  15. )
  16. endef
  17. # 31, red. 32, green. 33, yellow. 34, blue. 35, magenta. 36, cyan. 37, white.
  18. define Brief_Log
  19. @if [ "$1" = "CC" ]; then \
  20. if echo "$@"|grep -q "\.so$$"; then \
  21. COLOR_MARK="\e[1;32m"; \
  22. elif echo "$@"|grep -q "\.ko$$"; then \
  23. COLOR_MARK="\e[1;35m"; \
  24. else \
  25. COLOR_MARK="\e[1;36m"; \
  26. fi \
  27. elif [ "$1" = "AR" ]; then \
  28. COLOR_MARK="\e[1;33m"; \
  29. elif [ "$1" = "LD" ]; then \
  30. COLOR_MARK="\e[1;31m"; \
  31. fi; \
  32. echo -ne "$${COLOR_MARK}";
  33. @if [ "$2" = "" ]; then \
  34. FIRST_DEP="$(firstword $(filter-out FORCE,$?))"; \
  35. SPACE_BAR=" "; \
  36. if [ "$${FIRST_DEP}" != "" ]; then \
  37. FIRST_DEP="$$(basename $${FIRST_DEP})"; \
  38. fi; \
  39. printf "\r%-40s%s\n" "[$1] $$(expr substr $$(basename $@) 1 30)" "<= $${FIRST_DEP} $${SPACE_BAR}"; \
  40. else \
  41. printf "\r%-40s%s\n" "[$1] $$(expr substr $(2) 1 30)" "<= $${FIRST_DEP} $${SPACE_BAR}"; \
  42. fi
  43. @for i in $(wordlist 2,100,$^); do \
  44. printf "%-40s%s\n" "" " $$(basename $${i})"; \
  45. done
  46. @echo -ne "\e[0m"
  47. endef
  48. define CC_Log
  49. @if [ "$2" = "" ]; then \
  50. FIRST_DEP="$(firstword $(filter-out FORCE,$?))"; \
  51. SPACE_BAR=" "; \
  52. if [ "$${FIRST_DEP}" != "" ]; then \
  53. FIRST_DEP="$$(basename $${FIRST_DEP})"; \
  54. fi; \
  55. printf "\r%-40s%s\n" "[CC] $$(expr substr $$(basename $@) 1 30)" "<= $${FIRST_DEP} $${SPACE_BAR}"; \
  56. else \
  57. printf "\r%-40s%s\n" "[CC] $$(expr substr $(2) 1 30)" "<= $${FIRST_DEP} $${SPACE_BAR}"; \
  58. fi
  59. @for i in $(wordlist 2,100,$^); do \
  60. printf "%-40s%s\n" "" " $$(basename $${i})"; \
  61. done
  62. endef
  63. define AR_Log
  64. @if [ "$2" = "" ]; then \
  65. FIRST_DEP="$(firstword $(filter-out FORCE,$?))"; \
  66. SPACE_BAR=" "; \
  67. if [ "$${FIRST_DEP}" != "" ]; then \
  68. FIRST_DEP="$$(basename $${FIRST_DEP})"; \
  69. fi; \
  70. printf "\r%-40s%s\n" "[AR] $$(expr substr $$(basename $@) 1 30)" "<= $${FIRST_DEP} $${SPACE_BAR}"; \
  71. else \
  72. printf "\r%-40s%s\n" "[AR] $$(expr substr $(2) 1 30)" "<= $${FIRST_DEP} $${SPACE_BAR}"; \
  73. fi
  74. @for i in $(wordlist 2,100,$^); do \
  75. printf "%-40s%s\n" "" " $$(basename $${i})"; \
  76. done
  77. endef
  78. define Compile_Result
  79. @echo ""
  80. @echo "========================================================================="
  81. @echo "o BUILD COMPLETE WITH FOLLOWING CONFIGS:"
  82. @echo "----"
  83. @( \
  84. $(foreach V,$(SWITCH_VARS), \
  85. $(if $(findstring FEATURE_,$(V)), \
  86. printf "%-36s : %-s\n" " $(V)" "$($(V))"; \
  87. ) \
  88. ) )
  89. @echo ""
  90. @echo "o RELEASE PACKAGE LAYOUT:"
  91. @echo "----"
  92. @cd $(FINAL_DIR) && echo -n " " && pwd && echo "" && \
  93. find . -print | awk '!/\.$$/ { \
  94. for (i = 1; i < NF-1; i++) { \
  95. printf("| "); \
  96. } \
  97. print "+-- "$$NF}' FS='/' | sed 's!\(.*\)! &!g'
  98. @echo ""
  99. @echo "o BINARY FOOTPRINT CONSIST:"
  100. @echo "----"
  101. @chmod a+x $(SCRIPT_DIR)/stats_static_lib.sh
  102. @$(SCRIPT_DIR)/stats_static_lib.sh $(FINAL_DIR)/lib/$(COMP_LIB)
  103. @$(SCRIPT_DIR)/stats_static_lib.sh $(FINAL_DIR)/lib/$(PLATFORM_LIB)
  104. @echo "========================================================================="
  105. @echo ""
  106. endef