mmc-utils.mk 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ################################################################################
  2. #
  3. # mmc-utils
  4. #
  5. ################################################################################
  6. MMC_UTILS_VERSION = e1281d4de9166b7254ba30bb58f9191fc2c9e7fb
  7. MMC_UTILS_SITE = https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git
  8. MMC_UTILS_SITE_METHOD = git
  9. MMC_UTILS_LICENSE = GPL-2.0
  10. MMC_UTILS_LICENSE_FILES = README
  11. MMC_UTILS_CFLAGS = $(TARGET_CFLAGS)
  12. ifeq ($(BR2_PACKAGE_MMC_UTILS_ENABLE_DANGEROUS_COMMANDS),y)
  13. MMC_UTILS_CFLAGS += -DDANGEROUS_COMMANDS_ENABLED
  14. endif
  15. # override AM_CFLAGS as the project Makefile uses it to pass
  16. # -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2, and the latter conflicts
  17. # with the _FORTIFY_SOURCE that we pass when hardening options are
  18. # enabled. Starting from commit:
  19. # https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git/commit/?id=958227890690290ee766aaad1b92f3413f67048c
  20. # they use AM_CFLAGS to set VERSION to first 6 digit of git SHA1, so
  21. # let's do this here otherwise it won't be automatically set and build
  22. # will fail
  23. define MMC_UTILS_BUILD_CMDS
  24. $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) \
  25. CFLAGS="$(MMC_UTILS_CFLAGS)" \
  26. AM_CFLAGS='-DVERSION=\"$(shell echo $(MMC_UTILS_VERSION) | head -c 6)\"'
  27. endef
  28. define MMC_UTILS_INSTALL_TARGET_CMDS
  29. $(MAKE) -C $(@D) prefix=/usr DESTDIR=$(TARGET_DIR) install
  30. endef
  31. $(eval $(generic-package))