Implement a secure ICS protocol targeting LoRa Node151 microcontroller for controlling irrigation.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

98 lines
2.8 KiB

  1. # https://cgit.freebsd.org/src/plain/share/mk/bsd.mkopt.mk?id=36435ca5d3faa869c76f488c41daa9d195496f1f'
  2. #
  3. # $FreeBSD$
  4. #
  5. # Generic mechanism to deal with WITH and WITHOUT options and turn
  6. # them into MK_ options.
  7. #
  8. # For each option FOO in __DEFAULT_YES_OPTIONS, MK_FOO is set to
  9. # "yes", unless WITHOUT_FOO is defined, in which case it is set to
  10. # "no".
  11. #
  12. # For each option FOO in __DEFAULT_NO_OPTIONS, MK_FOO is set to "no",
  13. # unless WITH_FOO is defined, in which case it is set to "yes".
  14. #
  15. # For each entry FOO/BAR in __DEFAULT_DEPENDENT_OPTIONS,
  16. # MK_FOO is set to "no" if WITHOUT_FOO is defined,
  17. # "yes" if WITH_FOO is defined, otherwise the value of MK_BAR.
  18. #
  19. # If both WITH_FOO and WITHOUT_FOO are defined, WITHOUT_FOO wins and
  20. # MK_FOO is set to "no" regardless of which list it was in.
  21. #
  22. # All of __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS and
  23. # __DEFAULT_DEPENDENT_OPTIONS are undef'd after all this processing,
  24. # allowing this file to be included multiple times with different lists.
  25. #
  26. # Other parts of the build system will set BROKEN_OPTIONS to a list
  27. # of options that are broken on this platform. This will not be unset
  28. # before returning. Clients are expected to always += this variable.
  29. #
  30. # Users should generally define WITH_FOO or WITHOUT_FOO, but the build
  31. # system should use MK_FOO={yes,no} when it needs to override the
  32. # user's desires or default behavior.
  33. #
  34. #
  35. # MK_* options which default to "yes".
  36. #
  37. .for var in ${__DEFAULT_YES_OPTIONS}
  38. .if !defined(MK_${var})
  39. .if defined(WITH_${var}) && ${WITH_${var}} == "no"
  40. .warning "Use WITHOUT_${var}=1 instead of WITH_${var}=no"
  41. .endif
  42. .if defined(WITHOUT_${var}) # WITHOUT always wins
  43. MK_${var}:= no
  44. .else
  45. MK_${var}:= yes
  46. .endif
  47. .else
  48. .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
  49. .error "Illegal value for MK_${var}: ${MK_${var}}"
  50. .endif
  51. .endif # !defined(MK_${var})
  52. .endfor
  53. .undef __DEFAULT_YES_OPTIONS
  54. #
  55. # MK_* options which default to "no".
  56. #
  57. .for var in ${__DEFAULT_NO_OPTIONS}
  58. .if !defined(MK_${var})
  59. .if defined(WITH_${var}) && ${WITH_${var}} == "no"
  60. .warning "Use WITHOUT_${var}=1 instead of WITH_${var}=no"
  61. .endif
  62. .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
  63. MK_${var}:= yes
  64. .else
  65. MK_${var}:= no
  66. .endif
  67. .else
  68. .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
  69. .error "Illegal value for MK_${var}: ${MK_${var}}"
  70. .endif
  71. .endif # !defined(MK_${var})
  72. .endfor
  73. .undef __DEFAULT_NO_OPTIONS
  74. #
  75. # MK_* options which are always no, usually because they are
  76. # unsupported/badly broken on this architecture.
  77. #
  78. .for var in ${BROKEN_OPTIONS}
  79. MK_${var}:= no
  80. .endfor
  81. .for vv in ${__DEFAULT_DEPENDENT_OPTIONS}
  82. .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
  83. MK_${vv:H}?= no
  84. .elif defined(WITH_${vv:H})
  85. MK_${vv:H}?= yes
  86. .elif defined(WITHOUT_${vv:H})
  87. MK_${vv:H}?= no
  88. .else
  89. MK_${vv:H}?= ${MK_${vv:T}}
  90. .endif
  91. MK_${vv:H}:= ${MK_${vv:H}}
  92. .endfor
  93. .undef __DEFAULT_DEPENDENT_OPTIONS