skeleton-custom.mk 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ################################################################################
  2. #
  3. # skeleton-custom
  4. #
  5. ################################################################################
  6. # The skeleton can't depend on the toolchain, since all packages depends on the
  7. # skeleton and the toolchain is a target package, as is skeleton.
  8. # Hence, skeleton would depends on the toolchain and the toolchain would depend
  9. # on skeleton.
  10. SKELETON_CUSTOM_ADD_TOOLCHAIN_DEPENDENCY = NO
  11. SKELETON_CUSTOM_ADD_SKELETON_DEPENDENCY = NO
  12. SKELETON_CUSTOM_PROVIDES = skeleton
  13. SKELETON_CUSTOM_INSTALL_STAGING = YES
  14. SKELETON_CUSTOM_PATH = $(call qstrip,$(BR2_ROOTFS_SKELETON_CUSTOM_PATH))
  15. ifeq ($(BR2_PACKAGE_SKELETON_CUSTOM)$(BR_BUILDING),yy)
  16. ifeq ($(SKELETON_CUSTOM_PATH),)
  17. $(error No path specified for the custom skeleton)
  18. endif
  19. endif
  20. # For a merged /usr, ensure that /lib, /bin and /sbin and their /usr
  21. # counterparts are appropriately setup as symlinks ones to the others.
  22. ifeq ($(BR2_ROOTFS_MERGED_USR),y)
  23. SKELETON_CUSTOM_NOT_MERGED_USR_DIRS = \
  24. $(shell support/scripts/check-merged-usr.sh $(SKELETON_CUSTOM_PATH))
  25. endif # merged /usr
  26. ifeq ($(BR2_PACKAGE_SKELETON_CUSTOM)$(BR_BUILDING),yy)
  27. ifneq ($(SKELETON_CUSTOM_NOT_MERGED_USR_DIRS),)
  28. $(error The custom skeleton in $(SKELETON_CUSTOM_PATH) is not \
  29. using a merged /usr for the following directories: \
  30. $(SKELETON_CUSTOM_NOT_MERGED_USR_DIRS))
  31. endif
  32. endif
  33. # The target-dir-warning file and the lib{32,64} symlinks are the only
  34. # things we customise in the custom skeleton.
  35. define SKELETON_CUSTOM_INSTALL_TARGET_CMDS
  36. $(call SYSTEM_RSYNC,$(SKELETON_CUSTOM_PATH),$(TARGET_DIR))
  37. $(call SYSTEM_USR_SYMLINKS_OR_DIRS,$(TARGET_DIR))
  38. $(call SYSTEM_LIB_SYMLINK,$(TARGET_DIR))
  39. $(INSTALL) -m 0644 support/misc/target-dir-warning.txt \
  40. $(TARGET_DIR_WARNING_FILE)
  41. endef
  42. # For the staging dir, we don't really care what we install, but we
  43. # need the /lib and /usr/lib appropriately setup. Since we ensure,
  44. # above, that they are correct in the skeleton, we can simply copy the
  45. # skeleton to staging.
  46. define SKELETON_CUSTOM_INSTALL_STAGING_CMDS
  47. $(call SYSTEM_RSYNC,$(SKELETON_CUSTOM_PATH),$(STAGING_DIR))
  48. $(call SYSTEM_USR_SYMLINKS_OR_DIRS,$(STAGING_DIR))
  49. $(call SYSTEM_LIB_SYMLINK,$(STAGING_DIR))
  50. endef
  51. $(eval $(generic-package))