Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. include $(TOPDIR)/rules.mk
  3. PKG_NAME:=bcm4908img
  4. PKG_RELEASE:=3
  5. PKG_FLAGS:=nonshared
  6. PKG_BUILD_DEPENDS := bcm4908img/host
  7. include $(INCLUDE_DIR)/package.mk
  8. include $(INCLUDE_DIR)/host-build.mk
  9. define Package/bcm4908img
  10. SECTION:=utils
  11. CATEGORY:=Base system
  12. TITLE:=Utility handling BCM4908 images
  13. MAINTAINER:=Rafał Miłecki <[email protected]>
  14. DEPENDS:=@TARGET_bcm4908
  15. endef
  16. define Package/bcm4908img/description
  17. CFE bootloader for BCM4908 uses custom image format. It consists of:
  18. 1. Optional cferom image
  19. 2. bootfs JFFS2 partition (cferam, kernel, DTB and optional helper files)
  20. 3. padding
  21. 4. rootfs simply appended to the bootfs + padding
  22. 5. tail with checksum and basic device info
  23. This util allows creating, modifying and extracting from BCM4908 images.
  24. endef
  25. define Host/Prepare
  26. $(CP) ./src/* $(HOST_BUILD_DIR)
  27. endef
  28. define Build/Compile
  29. $(MAKE) -C $(PKG_BUILD_DIR) \
  30. CC="$(TARGET_CC)" \
  31. CFLAGS="$(TARGET_CFLAGS) -Wall"
  32. endef
  33. define Package/bcm4908img/install
  34. $(INSTALL_DIR) $(1)/usr/bin
  35. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bcm4908img $(1)/usr/bin/
  36. endef
  37. define Host/Install
  38. $(INSTALL_BIN) $(HOST_BUILD_DIR)/bcm4908img $(STAGING_DIR_HOST)/bin/
  39. endef
  40. $(eval $(call BuildPackage,bcm4908img))
  41. $(eval $(call HostBuild))