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